03.06.2012, 16:14
Hey, i'm working on admin mode, And i'm just done with the register login thing, now i'm willing to do a /admins command.
First time i'm using zCMD.
Warnings :
pawn Code:
CMD:admins( playerid,params[])
{
if ( GetPVarInt( playerid, "Logged" ) == 1 )
return SendClientMessage( playerid, -1, ""COL_RED"ERROR:{FFFFFF} You have to login to see the admins list.");
new count=0;
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(GetPVarInt(i) >= 1 && GetPVarInt(i) < 3)
{
new str[128];
GetName(i, pName, 24);
format(str, sizeof(str), "%s [ID:%d] Level:[%d]",GetName(i),i,GetPVarInt(i));
count++;
ShowPlayerDialog(playerid,2,DIALOG_STYLE_MSGBOX,"Online admins:",str,"Close"," ");
}
}
}
if(count == 0)
{
ShowPlayerDialog(playerid,2,DIALOG_STYLE_MSGBOX,"Online admins:","There's no admins online right now.","Close"," ");
}
return 1;
}
Warnings :
pawn Code:
pawno\include\YSI\internal\y_dohooks.inc(2501) : warning 235: public function lacks forward declaration (symbol "OnVehicleDamageStatusUpdate")
pawno\include\YSI\internal\y_dohooks.inc(2566) : warning 235: public function lacks forward declaration (symbol "OnUnoccupiedVehicleUpdate")
pawno\include\YSI\internal\y_dohooks.inc(3426) : warning 235: public function lacks forward declaration (symbol "OnPlayerTakeDamage")
pawno\include\YSI\internal\y_dohooks.inc(3495) : warning 235: public function lacks forward declaration (symbol "OnPlayerGiveDamage")
(473) : warning 202: number of arguments does not match definition
(473) : warning 202: number of arguments does not match definition
(476) : error 076: syntax error in the expression, or invalid function call
pawn Code:
473 : if(GetPVarInt(i) >= 1 && GetPVarInt(i) < 3) // This one checking if player level 1-3 means admin.
476 : GetName(i, pName, 24);