SA-MP Forums Archive
help me - 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: help me (/showthread.php?tid=291062)



help me - Kakioshe22 - 18.10.2011

At random spawn i copy this:

new Float:RandomSpawns[][] =
{
{2019.5605, 1342.9292, 10.8130, 269.6241},
{2173.3254, 1413.6172, 11.0625, 91.6514},
{2029.7556, 1008.3373, 10.8203, 266.1024},
{1584.5201, 1516.7324, 10.8318, 152.0789},
{340.4337, 2536.5776, 16.7865, 178.8486},
{-542.6747, 2592.3892, 53.5156, 272.1947},
{-1299.0413, -291.0421, 14.1484, 314.6614},
{-1475.9054, -210.6690, 14.1484, 335.9929},
{-2049.0117, -103.5660, 35.2071, 180.0000},
{2521.3262, -1678.7485, 15.3710, 89.9897},
{2134.3323, -2597.0308, 13.5469, 77.7263},
}: //<-- this is the line eror is, pls help

and on player spawn:

public OnPlayerSpawn(playerid)
{
new Random = random(sizeof(RandomSpawns));
SetPlayerPos(playerid, RandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2]);
SetPlayerFacingAngle(playerid, RandomSpawns[Random][3]);
return 1;
}


and i get this eror:
C:\Users\Mario\Desktop\matta\Mata Server\gamemodes\Test.pwn(294) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.


Re: help me - nilanjay - 18.10.2011

pawn Код:
new Float:RandomSpawns[][] =
{
{2019.5605, 1342.9292, 10.8130, 269.6241},
{2173.3254, 1413.6172, 11.0625, 91.6514},
{2029.7556, 1008.3373, 10.8203, 266.1024},
{1584.5201, 1516.7324, 10.8318, 152.0789},
{340.4337, 2536.5776, 16.7865, 178.8486},
{-542.6747, 2592.3892, 53.5156, 272.1947},
{-1299.0413, -291.0421, 14.1484, 314.6614},
{-1475.9054, -210.6690, 14.1484, 335.9929},
{-2049.0117, -103.5660, 35.2071, 180.0000},
{2521.3262, -1678.7485, 15.3710, 89.9897},
{2134.3323, -2597.0308, 13.5469, 77.7263},
}; //use this



Re: help me - TheMaddox - 18.10.2011

YOu have to replace the "}:" with the "};" this is the error that you've over there.


Re: help me - Kakioshe22 - 18.10.2011

if i do that:

new Float:RandomSpawns[][] =
{
{2019.5605, 1342.9292, 10.8130, 269.6241},
{2173.3254, 1413.6172, 11.0625, 91.6514},
{2029.7556, 1008.3373, 10.8203, 266.1024},
{1584.5201, 1516.7324, 10.8318, 152.0789},
{340.4337, 2536.5776, 16.7865, 178.8486},
{-542.6747, 2592.3892, 53.5156, 272.1947},
{-1299.0413, -291.0421, 14.1484, 314.6614},
{-1475.9054, -210.6690, 14.1484, 335.9929},
{-2049.0117, -103.5660, 35.2071, 180.0000},
{2521.3262, -1678.7485, 15.3710, 89.9897},
{2134.3323, -2597.0308, 13.5469, 77.7263},
};

error:
C:\Users\Mario\Desktop\matta\Mata Server\gamemodes\Test.pwn(294) : error 029: invalid expression, assumed zero
C:\Users\Mario\Desktop\matta\Mata Server\gamemodes\Test.pwn(294) : error 008: must be a constant expression; assumed zero
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.


Re: help me - Jason_Thunde - 18.10.2011

pawn Код:
new Float:RandomSpawns[][] =
{
{2019.5605, 1342.9292, 10.8130, 269.6241},
{2173.3254, 1413.6172, 11.0625, 91.6514},
{2029.7556, 1008.3373, 10.8203, 266.1024},
{1584.5201, 1516.7324, 10.8318, 152.0789},
{340.4337, 2536.5776, 16.7865, 178.8486},
{-542.6747, 2592.3892, 53.5156, 272.1947},
{-1299.0413, -291.0421, 14.1484, 314.6614},
{-1475.9054, -210.6690, 14.1484, 335.9929},
{-2049.0117, -103.5660, 35.2071, 180.0000},
{2521.3262, -1678.7485, 15.3710, 89.9897},
{2134.3323, -2597.0308, 13.5469, 77.7263}
};



Re: help me - Kakioshe22 - 18.10.2011

thank you


Re: help me - nilanjay - 18.10.2011

[deleted


Re: help me - Jason_Thunde - 18.10.2011

Np Let me tell you what prob is so you understand:

Your code where:
pawn Код:
new Float:RandomSpawns[][] =
{
{2019.5605, 1342.9292, 10.8130, 269.6241},
{2173.3254, 1413.6172, 11.0625, 91.6514},
{2029.7556, 1008.3373, 10.8203, 266.1024},
{1584.5201, 1516.7324, 10.8318, 152.0789},
{340.4337, 2536.5776, 16.7865, 178.8486},
{-542.6747, 2592.3892, 53.5156, 272.1947},
{-1299.0413, -291.0421, 14.1484, 314.6614},
{-1475.9054, -210.6690, 14.1484, 335.9929},
{-2049.0117, -103.5660, 35.2071, 180.0000},
{2521.3262, -1678.7485, 15.3710, 89.9897},
{2134.3323, -2597.0308, 13.5469, 77.7263},
};
At the last line before };

You hade a , That is not needed when somefhing ends like an enum the last enum dosent need a ,