Help with command - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help with command (
/showthread.php?tid=576548)
Help with command -
dundolina - 05.06.2015
Hello i have one command wich is /isadmin. Her function is to show what level of admin is the player. But the problem it's always show me 7 level..
Код:
if(strcmp(cmd,"/isadmin",true)==0)
{
new adminstring[256];
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "ИЗПОЛЗВАЙ: /isadmin [ номер на играча ]");
return 1;
}
giveplayerid = ReturnUser(tmp);
new admin = PlayerInfo[playerid][pAdmin];
format(adminstring, sizeof(adminstring), "Играчът е %d ниво администратор!",admin);
SendClientMessage(playerid, COLOR_RED,adminstring);
}
}
return 1;
}
Re: Help with command -
Threshold - 05.06.2015
I'm guessing this:
pawn Код:
new admin = PlayerInfo[playerid][pAdmin];
Should be 'giveplayerid', and not 'playerid'?
Also, check if giveplayerid is valid before using it in an array...
Re: Help with command -
dundolina - 05.06.2015
Thank u!