What are the functions used in includes?
#1

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

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

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

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

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)