Random car spawn - 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: Random car spawn (
/showthread.php?tid=506326)
Random car spawn -
Tadas - 12.04.2014
Hello, I have this code:
pawn Код:
new Float:Randomaa[][][] =
{
{-5.5838,2526.7129,23.9974},
{403.9305,2450.6448,16.2974},
{323.6853,2543.3269,16.5355},
{292.0462,2544.9385,16.5478}
};
And command:
pawn Код:
CMD:AA(playerid, params[])
{
SetVehiclePos(cartype, Randomaa[random(sizeof(Randomaa))]);
And I get this error:
error 035: argument type mismatch (argument 2)
How to fix that ?
Re: Random car spawn -
MrCallum - 12.04.2014
What is on line 035?
SetVehiclePos(cartype, Randomaa[random(sizeof(Randomaa))]);
Well do
CMD:aa(playerid, params[])
{
SetVehiclePos(cartype, random[Randomaa(sizeof(Randomaa);
return 1;
}
_____________________________________________
+rep if i helped u
Re: Random car spawn -
Threshold - 12.04.2014
pawn Код:
CMD:AA(playerid, params[])
{
new rand = random(sizeof(Randomaa));
SetVehiclePos(cartype, Randomaa[rand][0], Randomaa[rand][1], Randomaa[rand][2]);
//....