Quote:
Originally Posted by facemelt0r
Код:
func LisaObjekt(playerid)
{
for(new o = 1; o <= MAX_OBJEKTE; o++)
{
if(Objekt[o][Mudel] == 0)
{
Objekt[o][VW] = IG[playerid][PVW];
Objekt[o][Int] = IG[playerid][PINT];
Objekt[o][PositsionX] = IG[playerid][PosX];
Objekt[o][PositsionZ] = IG[playerid][PosY];
Objekt[o][PositsionY] = IG[playerid][PosZ];
Objekt[o][Mudel] = IG[playerid][Mudel];
Objekt[o][PositsionRX] = 0;
Objekt[o][PositsionRY] = 0;
Objekt[o][PositsionRZ] = 0;
Objekt[o][Ob] = CreateDynamicObject(Objekt[o][Mudel], Objekt[o][PositsionX], Objekt[o][PositsionY], Objekt[o][PositsionZ],IG[playerid][PVW],IG[playerid][PINT],100.0);
EditDynamicObject(playerid, Objekt[o][Ob]);
GameTextForPlayer(playerid, "~g~Objekt lisatud", 5000, 1);
return 1;
}
}
return 1;
}
|
Will probably produce a runtime error.
The indexes of arrays work like follows:
If you have an array of the size 10, you must access it from 0 to 9, not 1 to 10.
Your loop starts at 1, and runs until the size of the array (which is 1 too high).
Change the loop to:
Код:
for(new o = 0; o < MAX_OBJEKTE; o++)
Quote:
Originally Posted by Loinal
PHP код:
new Objekt[o][Ob];
|
You are trying to help, but please think a bit more before replying. He didn't say anything about compiler errors, also your code would not work at all either.