Help with small prob
#1

Anyone know how could i make like when i type /rcar it gives a random car? rcar = random car xD
_______________________
1-3$ fix warnings 1-5$fix errors
6-15$ make gamemodes(not roleplay) 3-10$ make filterscripts-scriptfiles
Dont ASK! me RolePlay questions
www.mefreeroam.tk
Reply
#2

Yes, use CreateVehicle(random(212),...); but check if the random isn't 0.
Reply
#3

wait i dont get it O.o
Reply
#4

pawn Код:
if(strcmp(cmdtext,"/rcar",true) == 0)
    {
        new car = randomEx(400,611),vehicleid;
        new Float:x,Float:y,Float:z,Float:a;
        GetPlayerPos(playerid,x,y,z);
        GetPlayerFacingAngle(playerid,a);
        vehicleid = CreateVehicle(car,x,y,z,a,-1,-1,-1);
        PutPlayerInVehicle(playerid,vehicleid,0);
        return 1;
    }
And you will need:
pawn Код:
stock randomEx(minnum = cellmin, maxnum = cellmax) return random(maxnum - minnum + 1) + minnum;
//Credits: ******
Reply
#5

Sorry, i messed up.
Reply
#6

thanks [XST]O_x worked perfectly xD
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)