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;
}
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
473 : if(GetPVarInt(i) >= 1 && GetPVarInt(i) < 3) // This one checking if player level 1-3 means admin.
476 : GetName(i, pName, 24);
|
It would be helpful if you could show us which lines are 473 and 476. As for the first 4 errors they seem to occur in the SA-MP 0.3e server package update and not script related.
|

|
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. |
error 017: undefined symbol "varname"
GetPVarInt(playerid, varname[]);
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;
}
if(GetPVarInt(i) >= 1 && GetPVarInt(i) < 3)
if(GetPVarInt(i, variable-for-admin-level) >= 1 && GetPVarInt(i, variable-for-admin-level) < 3)
GetPVarInt(playerid, varname[]);
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,"Admin") >= 1 && GetPVarInt(i,"Admin") < 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,"Admin"));
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;
}
|
You need to find out what variable is used to store admin level and replace "Admin" with it.
|