SA-MP Forums Archive
STOCK - 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: STOCK (/showthread.php?tid=578686)



STOCK - ItzRbj - 21.06.2015

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

Thanks in advance


Re: STOCK - Jonny5 - 21.06.2015

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


Re: STOCK - shocktheripper - 21.06.2015

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.


Re: STOCK - Stanford - 21.06.2015

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