What are the functions used in includes?
#6

Quote:
Originally Posted by K0P
Посмотреть сообщение
Код:
CMD:yourcommand(playerid, params[]) //ZCMD
{
    if(PlayerData[playerid][PlayerLevel] >= 3)
    {
        //Do your stuff here 
    }
    else SendClientMessage(playerid, 0xFFFFFFFF, "You don't have enough administration level to use this command");
    return 1;
}
Here i made a quick stock (Sorry if there is a mistake) which you can use to prevent writing the above code again and again in each admin command.

Код:
stock CheckLevel(playerid, level);
{
    if(PlayerData[playerid][PlayerLevel] >= level) return 1;
    else
    {
        SendClientMessage(playerid, 0xFFFFFFFF, "You don't have enough administration level to use this command");
        return 0;
    }
}
After adding this stock in your gamemode/script,you will just need this one line of code to check if player has admin level "-" or not:

Код:
CMD:yourcommand(playerid, params[])
{
    CheckLevel(playerid, 3);
    return 1;
}
https://sampforum.blast.hk/showthread.php?tid=570635
Reply


Messages In This Thread
What are the functions used in includes? - by XHunterZ - 15.09.2016, 05:45
Re: What are the functions used in includes? - by K0P - 15.09.2016, 06:27
Re: What are the functions used in includes? - by Fratello - 15.09.2016, 09:24
Re: What are the functions used in includes? - by XHunterZ - 15.09.2016, 13:16
Re: What are the functions used in includes? - by Fratello - 15.09.2016, 13:54
Re: What are the functions used in includes? - by GoldenLion - 15.09.2016, 13:57
Re: What are the functions used in includes? - by K0P - 15.09.2016, 14:19

Forum Jump:


Users browsing this thread: 2 Guest(s)