SA-MP Forums Archive
Question: Make into Code for all of callbacks - 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: Question: Make into Code for all of callbacks (/showthread.php?tid=411661)



Question: Make into Code for all of callbacks - jakejohnsonusa - 29.01.2013

I want to in some way make the outcome of h usable in my entire GM, but how can I do this?

Thanks in advance: jakejohnsonusa

Under OnGameModeInt (what I want h to be usable for in the ENTIRE GM(All Callbacks):
pawn Код:
new string2[64];
    for(new h = 1; h < sizeof(CarInfo); h++)
    {
        format(string2, sizeof(string2), "LARP/Vehicles/%d.ini",h);
        if(dini_Exists(string2))
        {
Basically how can I add this code to the very beggining of My GM with " new LoadedCarID = h; " ?


Re: Question: Make into Code for all of callbacks - Roach_ - 29.01.2013

I think you can do this:
pawn Код:
new LoadedCarID = 1;
public OnGameModeInit()
{
    new string2[64];
    for(LoadedCarID < sizeof CarInfo; LoadedCarID ++)
    {
        format(string2, 64, "LARP/Vehicles/%d.ini", LoadedCarID);
        // Other Code
    }
    // Other Code
    return 1;
}
And then use it in your all gamemode...


Re: Question: Make into Code for all of callbacks - jakejohnsonusa - 29.01.2013

The problem is, is that I need this for things above OnGameModeInt, meaning I need to add it bellow all the new's in the beggining of my script. Anyone else know?

It'll be so I can use the variable h all through my GM.