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

Wysłany: 2012-01-03, 16:41


Michalek12







Wiek: 33
Na forum: 5272 dni
Posty: 9
Nick w MP: Michcio



Respekt: 50

Witam!

Mam napisany sw?j system Admina, komendy s? dost?pne gdy gracz ma:
Kod:

Admin[playerid] = 1;


moje pytanie brzmi:
jak zrobi? komend? /admin id i pod t? komend? by?o by napisane:

Gdy gracz ma Admin[playerid] = 0; pisze: Ten gracz nie ma Admina.
a jak ma Admin[playerid] = 1; to pisze: Ten gracz jest Adminem serwera.

nie chodzi mi o komend? /admins, gdzie jest wy?wietlana lista komend. To potrafi? zrobi? i ja sam :)

za pomoc :piwo:

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-01-03, 16:51


CRX







Wiek: 34
Na forum: 5671 dni
Posty: 114

Piwa: 106

Respekt: 51,6

Ostrzeżeń: 60%
Zcmd:
Pawn
CMD:admin(playeridparams[])
{
if(isnull(strval(params)))
return SendClientMessage(playerid, -1"* Wpisz /admin [ID]");

if(!IsPlayerConnected(strval(params))
        return SendClientMessage(playerid, -1"* Nie odnaleziono podanego ID!");

if(Admin[strval(params)] == 1)
{ 
SendClientMessage(playerid, -1"* Ten gracz ma Administratora!");
}
else
{
SendClientMessage(playerid, -1"* Ten gracz nie mma Administratora!");
}
return 1;
}


Mog? by? drobne b??dy, pisane na szybko.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-01-03, 17:17


Michalek12







Wiek: 33
Na forum: 5272 dni
Posty: 9
Nick w MP: Michcio



Respekt: 50

a da rady zrobi? to w zwyk?ej cmd?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-01-03, 17:27


CRX







Wiek: 34
Na forum: 5671 dni
Posty: 114

Piwa: 106

Respekt: 51,6

Ostrzeżeń: 60%
Pawn
#define isnull(%1)             ((!(%1[0])) || (((%1[0]) == '') && (!(%1[1]))))

if(strcmp(cmd"/admin"true) == 0)
{
if(isnull(strval(params)))
return SendClientMessage(playerid, -1"* Wpisz /admin [ID]");

if(!IsPlayerConnected(strval(params))
        return SendClientMessage(playerid, -1"* Nie odnaleziono podanego ID!");

if(Admin[strval(params)] == 1)
{ 
SendClientMessage(playerid, -1"* Ten gracz ma Administratora!");
}
else
{
SendClientMessage(playerid, -1"* Ten gracz nie mma Administratora!");
}
return 1;
}


Mo?liwe, ?e b?dzie dzia?a?.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-01-05, 23:17


Michalek12







Wiek: 33
Na forum: 5272 dni
Posty: 9
Nick w MP: Michcio



Respekt: 50

Takie errory mam po wklejeniu twojego kodu :(


Kod:

C:\Documents and Settings\Michal\Pulpit\mapa.pwn(1987) : error 017: undefined symbol "params"
C:\Documents and Settings\Michal\Pulpit\mapa.pwn(1987) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Michal\Pulpit\mapa.pwn(1987) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Michal\Pulpit\mapa.pwn(1987) : 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-01-06, 00:20


BraYaN_







Wiek: 34
Na forum: 6602 dni
Posty: 276
Nick w MP: BraYaN_

Piwa: 1614

Respekt: 63

Pawn
if(strcmp(cmdtext"/admin"true) == 0)
{
if(isnull(strval(cmdtext)))
return SendClientMessage(playerid, -1"* Wpisz /admin [ID]");

if(!IsPlayerConnected(strval(params))
        return SendClientMessage(playerid, -1"* Nie odnaleziono podanego ID!");

if(Admin[strval(params)] == 1)
{ 
SendClientMessage(playerid, -1"* Ten gracz ma Administratora!");
}
else
{
SendClientMessage(playerid, -1"* Ten gracz nie mma Administratora!");
}
return 1;
}
tak spr?buj..

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-01-06, 00:48


Michalek12







Wiek: 33
Na forum: 5272 dni
Posty: 9
Nick w MP: Michcio



Respekt: 50

C:\Documents and Settings\Michal\Pulpit\mapa.pwn(1681) : error 017: undefined symbol "isnull"
C:\Documents and Settings\Michal\Pulpit\mapa.pwn(1684) : error 017: undefined symbol "params"
C:\Documents and Settings\Michal\Pulpit\mapa.pwn(1685) : error 001: expected token: ")", but found "return"
C:\Documents and Settings\Michal\Pulpit\mapa.pwn(1687) : error 017: undefined symbol "params"
C:\Documents and Settings\Michal\Pulpit\mapa.pwn(5690) : warning 203: symbol is never used: "ret_memcpy"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-01-06, 08:38


CRX







Wiek: 34
Na forum: 5671 dni
Posty: 114

Piwa: 106

Respekt: 51,6

Ostrzeżeń: 60%
Teraz b?dzie dzia?a?. Zapomnia?em zmieni? parametr.
Pawn
#define isnull(%1)             ((!(%1[0])) || (((%1[0]) == '') && (!(%1[1]))))

if(strcmp(cmd"/admin"true) == 0)
{
if(isnull(strval(cmd)))
return SendClientMessage(playerid, -1"* Wpisz /admin [ID]");

if(!IsPlayerConnected(strval(cmd))
        return SendClientMessage(playerid, -1"* Nie odnaleziono podanego ID!");

if(Admin[strval(cmd)] == 1)
{ 
SendClientMessage(playerid, -1"* Ten gracz ma Administratora!");
}
else
{
SendClientMessage(playerid, -1"* Ten gracz nie mma Administratora!");
}
return 1;
}


Oczywi?cie define na g?rze GameModa.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-01-06, 13:39


Michalek12







Wiek: 33
Na forum: 5272 dni
Posty: 9
Nick w MP: Michcio



Respekt: 50

C:\Documents and Settings\Michal\Pulpit\mapa.pwn(2070) : error 001: expected token: ")", but found "["
C:\Documents and Settings\Michal\Pulpit\mapa.pwn(2070) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Michal\Pulpit\mapa.pwn(2070) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Michal\Pulpit\mapa.pwn(2070) : 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.

linijka:

470: if(isnull(strval(cmd)))
471: return SendClientMessage(playerid, -1, "* Wpisz /admin [ID]");

Postaw piwo autorowi tego posta
 

 
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » PAWN » [DM] Sprawdzanie Admina 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