04.06.2012, 14:43
Quote:
Hey
![]() To fix these error you need to remove or comment line 476. Its unnecessary because your'e using it below this line. The warnings comes from the part when you've checked, I guess, the admin level of the players? GetPlayerPVar() requires 2 parameters as I believe you know, which one of them is the ID of the player and the second is the variable name. At the line with both of the warnings you've used this function twice without adding a variable name. What you need to do is to add the variable name as second parameter. |
pawn Code:
error 017: undefined symbol "varname"
pawn Code:
GetPVarInt(playerid, varname[]);
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];
GetPVarInt(playerid, varname[]);
// 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;
}
