Random car spawn
#1

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

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
Reply
#3

pawn Код:
CMD:AA(playerid, params[])
{
    new rand = random(sizeof(Randomaa));
    SetVehiclePos(cartype, Randomaa[rand][0], Randomaa[rand][1], Randomaa[rand][2]);
//....
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)