Wysłany: 2012-01-03, 16:41
Michalek12
Wiek: 33 Na forum: 5272 dni Posty: 9
Nick w MP: Michcio
Witam!
Mam napisany sw?j system Admina, komendy s? dost?pne gdy gracz ma:
Kod:
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
Wysłany: 2012-01-03, 16:51
CRX
Wiek: 34 Na forum: 5671 dni Posty: 114
Piwa : 106
Zcmd:
Pawn CMD : admin ( playerid , params [])
{
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.
Wysłany: 2012-01-03, 17:17
Michalek12
Wiek: 33 Na forum: 5272 dni Posty: 9
Nick w MP: Michcio
a da rady zrobi? to w zwyk?ej cmd?
Wysłany: 2012-01-03, 17:27
CRX
Wiek: 34 Na forum: 5671 dni Posty: 114
Piwa : 106
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?.
Wysłany: 2012-01-05, 23:17
Michalek12
Wiek: 33 Na forum: 5272 dni Posty: 9
Nick w MP: Michcio
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.
Wysłany: 2012-01-06, 00:20
BraYaN_
Wiek: 34 Na forum: 6602 dni Posty: 276
Nick w MP: BraYaN_
Piwa : 1614
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..
Wysłany: 2012-01-06, 00:48
Michalek12
Wiek: 33 Na forum: 5272 dni Posty: 9
Nick w MP: Michcio
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.
Wysłany: 2012-01-06, 08:38
CRX
Wiek: 34 Na forum: 5671 dni Posty: 114
Piwa : 106
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.
Wysłany: 2012-01-06, 13:39
Michalek12
Wiek: 33 Na forum: 5272 dni Posty: 9
Nick w MP: Michcio
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]");
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: