[HELP] Admin Commands
#6

For dcmd, here is the example code with sscanf usage. So mind getting sscanf or i can also make a "strtok" function.
sscanf: https://sampforum.blast.hk/showthread.php?tid=120356
pawn Код:
dcmd_forcerules(playerid, params[])
{
    new targetID;
    if(! sscanf(params, "u", targetID))
    {
        if(IsPlayerConnected(targetID))
        {
            ShowPlayerRules(targetID); // you have manage to make your own stock function, this one is just an  example
        }
    }
    return true;
}
OR, for a strtok function:
pawn Код:
dcmd_forcerules(playerid, params[])
{
    new tmp[128], idx;
    tmp = strtok(params, idx);
    new targetID = strval(tmp);
    if(IsPlayerConnected(targetID))
    {
        ShowPlayerRules(targetID); // you have manage to make your own stock function, this one is just an  example
    }
    return true;
}
If you want to use the same stock function "ShowPlayerRules", here it is:
pawn Код:
stock ShowPlayerRules(playerid)
{
    //your rules system here, pretty simple!
    return true;
}
RECOMMENDATIONS: use sscanf unformating, use ZCMD command processor!

I haven't tested this, if problems, kindly contact here!
Reply


Messages In This Thread
[HELP] Admin Commands - by Thoma - 07.01.2015, 06:34
Re: [HELP] Admin Commands - by Banana_Ghost - 07.01.2015, 06:44
Re: [HELP] Admin Commands - by Thoma - 07.01.2015, 06:56
Re: [HELP] Admin Commands - by Banana_Ghost - 07.01.2015, 06:58
Re: [HELP] Admin Commands - by Thoma - 07.01.2015, 07:08
Re: [HELP] Admin Commands - by Gammix - 07.01.2015, 07:41

Forum Jump:


Users browsing this thread: 1 Guest(s)