I have no idea, function won't run
#1

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

freakin' idiot... i<sizeof(...) not i<=sizeof(...)...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)