SA-MP Forums Archive
How make this command Rcon Admins ONLY? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How make this command Rcon Admins ONLY? (/showthread.php?tid=268468)



How make this command Rcon Admins ONLY? - phil_lendon - 12.07.2011

So you log into rcon
eg
/rcon login bob
then i want it so you can type in
/cash and it gives you 1k like the code below
pawn Код:
if (strcmp("/cash", cmdtext, true, 10) == 0)
    {
    GivePlayerMoney(playerid, 1000);
        return 1;
}
and only rcon logged in people can do it?


Re: How make this command Rcon Admins ONLY? - Jochemd - 12.07.2011

pawn Код:
if(!strcmp(cmdtext,"/cash",true))
{
    if(IsPlayerAdmin(playerid))
    {
        GivePlayerCash(playerid,1000);
        return 1;
    }
    return 1;
}
You might need to get a bit more experience before starting scripting


Re: How make this command Rcon Admins ONLY? - BigETI - 12.07.2011

pawn Код:
if(!strcmp(cmdtext, "/cash", true))
{
    if(!IsPlayerAdmin(playerid)) return 0;
    GivePlayerMoney(playerid, 1000);
    return 1;
}
The function
pawn Код:
IsPlayerAdmin(playerid)
checks for if this Player ID is logged in as RCON admin.