SA-MP Forums Archive
What are the functions used in includes? - 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: What are the functions used in includes? (/showthread.php?tid=617062)



What are the functions used in includes? - XHunterZ - 15.09.2016

What funcs are used? like Native GetPlayerStats




and like if we want to create a command and use this code


if [playerData][playerLevel] >= 3 //admin lvl

SendClientMessage(playerid, "You don't have enough administration level to use this command");

Else
SendClientMessage(playerid, "command success" smth like dat..


Re: What are the functions used in includes? - K0P - 15.09.2016

Код:
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.

Код:
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;
}



Re: What are the functions used in includes? - Fratello - 15.09.2016

XhunterZ please get some help from wiki for mySQL. If you make command or update and if bug comes up, you won't be able to solve it.

CNRSF is your project how I see.

"one day you will face bug which you wont be able to solve" - SecretBoss.

Just kidding, go on we won't stop you from risking script and stuff.


Re: What are the functions used in includes? - XHunterZ - 15.09.2016

You're wrong, i'm just learning and will create a gamemode from scratch, i got 2 friends who script for me..


Re: What are the functions used in includes? - Fratello - 15.09.2016

I'd love to check out. CNRSF has same valutes as your gamemode.

You got 2 friends who script for you? Why don't you learn it and make your gamemode.

Anways about Lorenc he is like that sorry, His Irressiable Gaming is like that.
You wasted cash you could use for your own community. Thats why I never donated to any community.


Re: What are the functions used in includes? - GoldenLion - 15.09.2016

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


Re: What are the functions used in includes? - K0P - 15.09.2016

Quote:
Originally Posted by GoldenLion
Посмотреть сообщение
Oh didn't noticed,thanks for sharing.