#1

how can i use stock in the admin system using Y_ini , i dont need commands i just need the stock

Thanks in advance
Reply
#2

what do you want the stock todo?

a stock is just a function/ or var that may or may-not be used at run-time.

the compiler checks at compile time for its usage and if it is not used it is removed from compilation

https://sampwiki.blast.hk/wiki/Keywords:Initialisers#stock
Reply
#3

I think you're looking for this.

PHP код:
stock GetAdminLvlName(playerid)
{
        new 
str[64];
        if (
PlayerInfo[playerid][pAdmin] == 0str = ("None");
        if (
PlayerInfo[playerid][pAdmin] == 1str = ("Moderator");
        if (
PlayerInfo[playerid][pAdmin] == 2str = ("Junior Admin");
        if (
PlayerInfo[playerid][pAdmin] == 3str = ("Admin");
        if (
PlayerInfo[playerid][pAdmin] == 4str = ("General Admin");
        if (
PlayerInfo[playerid][pAdmin] == 5str = ("Owner");
        return 
str;

Feel free to edit it.
Reply
#4

the word stock does not mean 'function', I think it's like something that prevents the compiler from compiling the code that got 'stock' if its not used in the script!

Your question is general, I will answer generally as a result, y_INI is a saving,loading system if you mean saving or loading values from your script then here's a tutorial: https://sampforum.blast.hk/showthread.php?tid=273088

Using y_ini is not a must, you can use something like MySQL or SQLite or normal file saving
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)