How make this command Rcon Admins ONLY?
#1

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?
Reply
#2

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
Reply
#3

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)