Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2012-02-11, 01:25


eras800







Wiek: 31
Na forum: 5768 dni
Posty: 30
Nick w MP: Jobas

Piwa: 1049

Respekt: 33

Ostrzeżeń: 20%
Witam potrzebuje pomocy jak mam do tego kodu doda? nicki aby tylko one mog?y otwiera? bramy?

Kod:

#include <a_samp>
#pragma tabsize 0
new brama ;

public OnGameModeInit()
{
brama = CreateObject(980, 2906.66, 2400.20, 12.14, 0.00, 0.00, 0.00);
}

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/brama.close", true)==0){
{
GameTextForPlayer(playerid, "~n~Brama3 ~r~Zamknieta", 2500, 5);
MoveObject(brama, 1206.66, 2400.20, 12.14, 3);

}
return 1;
}

if (strcmp(cmdtext, "/brama.open", true)==0){
{
GameTextForPlayer(playerid, "n~Brama3 ~g~Otwrata", 2500, 5);
MoveObject(brama, 2896.45, 2400.16, 12.35, 3);
}
return 1;
}
return 0;
}


Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-02-11, 11:26


xxmikel611xx

~!@#$%^!






Wiek: 30
Na forum: 5813 dni
Posty: 163
Nick w MP: Mikel__xD

Piwa: 159

Respekt: 35,3

A ja mam takie pytanie czy dzia?a ci to MoveObject ??

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-02-11, 13:18


MG303







Wiek: 30
Na forum: 6418 dni
Posty: 654

Piwa: 2990

Respekt: 231,6
Respekt: 231,6Respekt: 231,6

xxmikel611xx, w 0.3d b?dzie to tak:

Kod:

MoveObject(brama, 2896.45, 2400.16, 12.35, 3, 0.0, 0.0, 0.0);


eras800,

robisz co? takiego:

Kod:

if (strcmp(cmdtext, "/brama.close", true)==0){
{
if (!strcmp(PlayerName(playerid), "NICK1", true) || !strcmp(PlayerName(playerid), "NICK2", true) || !strcmp(PlayerName(playerid), "NICK3", true)){
GameTextForPlayer(playerid, "~n~Brama3 ~r~Zamknieta", 2500, 5);
MoveObject(brama, 1206.66, 2400.20, 12.14, 3);
}

}
return 1;
}


Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-02-11, 17:06


xxmikel611xx

~!@#$%^!






Wiek: 30
Na forum: 5813 dni
Posty: 163
Nick w MP: Mikel__xD

Piwa: 159

Respekt: 35,3

Mattwell, ja wiem co to jest MoveObject tylko pytam czy dzia?a bo ja robi? wind? no to jako? nic si? nie dzieje.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-02-11, 18:34


eras800







Wiek: 31
Na forum: 5768 dni
Posty: 30
Nick w MP: Jobas

Piwa: 1049

Respekt: 33

Ostrzeżeń: 20%
Zrobi?em tak

Kod:

#include <a_samp>
#pragma tabsize 0
new brama ;

public OnGameModeInit()
{
brama = CreateObject(980, 2906.66, 2400.20, 12.14, 0.00, 0.00, 0.00);
}

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/brama.close", true)==0){
{
if (!strcmp(PlayerName(playerid), "NICK1", true) || !strcmp(PlayerName(playerid), "NICK2", true) || !strcmp(PlayerName(playerid), "NICK3", true)){
GameTextForPlayer(playerid, "~n~Brama3 ~r~Zamknieta", 2500, 5);
MoveObject(brama, 1206.66, 2400.20, 12.14, 3);
}

}
return 1;
}

if (strcmp(cmdtext, "/brama.open", true)==0){
{
GameTextForPlayer(playerid, "n~Brama3 ~g~Otwrata", 2500, 5);
MoveObject(brama, 2896.45, 2400.16, 12.35, 3);
}
return 1;
}
return 0;
}


a mam taki error
Kod:

C:\Users\Komputer\Desktop\bramy.pwn(14) : error 017: undefined symbol "PlayerName"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


1 Error.


A po dodaniu new PlayerName;

Kod:

C:\Users\Komputer\Desktop\bramy.pwn(15) : error 012: invalid function call, not a valid address
C:\Users\Komputer\Desktop\bramy.pwn(15) : warning 215: expression has no effect
C:\Users\Komputer\Desktop\bramy.pwn(15) : error 001: expected token: ";", but found ")"
C:\Users\Komputer\Desktop\bramy.pwn(15) : error 029: invalid expression, assumed zero
C:\Users\Komputer\Desktop\bramy.pwn(15) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.


Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-02-12, 10:36


optimus

PawnoMen






Wiek: 27
Na forum: 5614 dni
Posty: 453
Nick w MP: [PMS]ReveresPL

Piwa: 159

Respekt: 59

Ostrzeżeń: 80%
Na pocz?tku piszesz:
Cytat:

new Player[MAX_PLAYER_NAME];


Potem tam gdzie masz komende:
Cytat:

GetPlayerName(playerid, Player, sizeof(Player));


Pami?taj je?eli chcesz gdzie? definiowa? nazwe gracza to musisz ko?o tej funcji (w callbacku) przynajmniej raz:
Cytat:

GetPlayerName(playerid, Player, sizeof(Player));

Aby pobra?o nazwe gracza !! !

Pomog?em ?? ? postaw :piwo:

[ Dodano: 2012-02-12, 10:37 ]
A i jeszcze czy na ko?cu gdzie jest return 0; nie powinno by? return 1; ?? ??

Podpis
Prpgramujesz w Unity i potrzebujesz pomocy?
|?Zapraszamy na forum Unity?|
http://www.unity3d.ugu.pl
Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-02-13, 01:40


eras800







Wiek: 31
Na forum: 5768 dni
Posty: 30
Nick w MP: Jobas

Piwa: 1049

Respekt: 33

Ostrzeżeń: 20%
mo?esz to odrazu zrobi?? Dam piwko.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-02-13, 11:39


Mlody951







Wiek: 28
Na forum: 5229 dni
Posty: 7
Nick w MP: Mlody

Piwa: 2

Respekt: 50

Kod:

#include <a_samp>

#pragma tabsize 0

new brama;

public OnFilterScriptInit()
{
brama = CreateObject(980, 2906.66, 2400.20, 12.14, 0.00, 0.00, 0.00);
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/brama.close", true)==0)
{
if (!strcmp(PlayerName(playerid), "NICK1", true) || !strcmp(PlayerName(playerid), "NICK2", true) || !strcmp(PlayerName(playerid), "NICK3", true))
{
GameTextForPlayer(playerid, "~n~Brama3 ~r~Zamknieta", 2500, 5);
MoveObject(brama, 1206.66, 2400.20, 12.14, 3);
}
return 1;
}

if (strcmp(cmdtext, "/brama.open", true)==0)
{
if (!strcmp(PlayerName(playerid), "NICK1", true) || !strcmp(PlayerName(playerid), "NICK2", true) || !strcmp(PlayerName(playerid), "NICK3", true))
{
GameTextForPlayer(playerid, "n~Brama3 ~g~Otwrata", 2500, 5);
MoveObject(brama, 2896.45, 2400.16, 12.35, 3);
}
return 1;
}
return 0;
}

stock PlayerName(playerid)
{
new name[24];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
return name;
}


Postaw piwo autorowi tego posta
 

 
Tagi: otwieranie :: bram :: kilka :: nicków.
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » PAWN Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku