Strange problem - 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: Strange problem (
/showthread.php?tid=348971)
Strange problem -
SpankMe2 - 07.06.2012
pawn Код:
new Float:FunTP[][8] =
{
{678.7383, 341.4823, 230.3493+2, 44.2607, 667.3849, 347.2433, 232.2656, 312.4264}
};
new Float:JumpTP[][8] =
{
{2454.2620, 17.2514, 275.3959+2, 358.4811, 2441.7283, 8.2975, 282.3803, 358.4811}
};
Hey I get these 2 errors on the new.. lines
(147) : error 008: must be a constant expression; assumed zero
(157) : error 008: must be a constant expression; assumed zero
can anyone help with this?? THanks
Re: Strange problem -
alpha500delta - 07.06.2012
The code compiles fine for me... Are you sure these are actually the correct lines?
Re: Strange problem -
SpankMe2 - 07.06.2012
Yeah they are :S, thats the reason I can't understand why it fails to compile.
EDIT: THe ones above compile fine..?
pawn Код:
new Float:GeneralTP[][8] =
{
{1348.7295, 2999.0210, 1721.4387, 179.8686, 1334.9700,2990.3110, 1720.9999, 178.6952}
};
new GeneralTPNames[][] =
{
"San Andreas"
};
Re: Strange problem -
alpha500delta - 07.06.2012
Can you post a bit more of the code maybe?
Re: Strange problem -
SpankMe2 - 07.06.2012
Just did

My usage is fine as I copyed the sage for the one I just pasted.
Heres some more... This is the usage in a switch statement
pawn Код:
case 2:
{
if(IsPlayerInAnyVehicle(playerid))
{
SetVehiclePos(GetPlayerVehicleID(playerid), FunTP[listitem][4], FunTP[listitem][5], FunTP[listitem][6]);
SetVehicleZAngle(GetPlayerVehicleID(playerid), FunTP[listitem][7]);
}
else
{
SetPlayerPos(playerid, FunTP[listitem][0], FunTP[listitem][1], FunTP[listitem][2]);
SetPlayerFacingAngle(playerid, FunTP[listitem][3]);
}
format(string, sizeof(string), "%s has teleported to %s", GetPlayerNameEx(playerid), FunTPNames[listitem]);
}
Re: Strange problem -
alpha500delta - 07.06.2012
Well to be honest with ya, I don't see anything wrong with the code D:
Re: Strange problem -
SpankMe2 - 07.06.2012
Quote:
Originally Posted by alpha500delta
Well to be honest with ya, I don't see anything wrong with the code D:
|
No problem I will experiment with things in the code.
Re: Strange problem -
IceCube! - 07.06.2012
Sorry for the bump but I was sent to this thread, the problem is you cant do maths in an array. Remove +2 whereever you have placed it.
Re: Strange problem -
SpankMe2 - 07.06.2012
Thanks

, It worked!