I have no idea, function won't run - 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: I have no idea, function won't run (
/showthread.php?tid=546028)
I have no idea, function won't run -
csganja - 12.11.2014
So i have 2 functions that should run on game mode init:
Код:
public OnGameModeInit()
{
[... other code ...]
JobsInit();
AtmsInit();
}
But AtmsInit won't run if jobsinit is called first, and jobsinit won't run if atmsinit is called first.
The 2 functions are looking smth like this
Код:
JobsInit(){
for (new i=0; i<=sizeof(Job); i++)
{
Job[i][jPickup] = CreatePickup(1318, 1, Job[i][jx], Job[i][jy], Job[i][jz]-2, -1); //z-2
format(str, sizeof(str), "%s\n%s\n%i$ (+0-%i$) per checkpoint", Job[i][jName], Job[i][jDescription], Job[i][jMoney], Job[i][jRandMoney]);
Create3DTextLabel(str, ORANGE, Job[i][jx], Job[i][jy], Job[i][jz]-1, 40.0, 0, 0); //z-1
}
}
same for
Код:
AtmsInit(){
for (new i=0; i<=sizeof(Atm); i++)
{
CreateObject(2942 , Atm[i][ax], Atm[i][ay], Atm[i][az], Atm[i][arx], Atm[i][ary], Atm[i][arz]); // Train station atm
Atm[i][aPickup] = CreatePickup(1318, 1, Atm[i][ax], Atm[i][ay], Atm[i][az]-1.2, -1); //z-2
format(str, sizeof(str), "%s\n%s", Atm[i][aName], Atm[i][aDescription]);
Create3DTextLabel(str, GREEN, Atm[i][ax], Atm[i][ay], Atm[i][az]+1.5, 40.0, 0, 0); //z-1
}
}
Any idea? Ask if you need more code...
Re: I have no idea, function won't run -
csganja - 12.11.2014
freakin' idiot... i<sizeof(...) not i<=sizeof(...)...