Need help with car spawner [+REP]
#1

Hey, im making an Car Spawner for my new gamemode.

But i dont know how to make 1 thing.

If i choose 1 cars in list, like Sport Cars.

Then will come another dialog.

Sorry about my bad english !
Reply
#2

pawn Код:
if(strcmp(cmd,"/veh", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [carid] [color1] [color2]");
                return 1;
            }
            new car;
            car = strval(tmp);
            if(car < 400 || car > 611) { SendClientMessage(playerid, COLOR_GREY, "   Vehicle Number can't be below 400 or above 611 !"); return 1; }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [carid] [color1] [color2]");
                return 1;
            }
            new color1;
            color1 = strval(tmp);
            if(color1 < -1 || color1 > 126) { SendClientMessage(playerid, COLOR_GREY, "   Color Number can't be below 0 or above 126 !"); return 1; }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [carid] [color1] [color2]");
                return 1;
            }
            new color2;
            color2 = strval(tmp);
            if(color2 < -1 || color2 > 126) { SendClientMessage(playerid, COLOR_GREY, "   Color Number can't be below 0 or above 126 !"); return 1; }
            new Float:X,Float:Y,Float:Z;
            GetPlayerPos(playerid, X,Y,Z);
            new Float:Angle;
            GetPlayerFacingAngle(playerid, Angle);
            new carid = CreateVehicle(car, X,Y,Z, Angle, color1, color2, 60000);
            GetPlayerName(playerid, sendername, sizeof(sendername));
            LinkVehicleToInterior(carid, GetPlayerInterior(playerid));
            SetVehicleVirtualWorld(carid, GetPlayerVirtualWorld(playerid));
            PutPlayerInVehicle(playerid, carid, 0);
            }
        }
        return 1;
    }
This will spawn any vehicle that a player requests.
/veh ID COLOR COLOR

you can get vehicle ids here
https://sampwiki.blast.hk/wiki/Vehicle_Model_ID_List
Reply
#3

I need help with dialog !
Reply
#4

Sorry, This will be perfect for what you're looking for
https://sampforum.blast.hk/showthread.php?tid=112166
Reply
#5

HERE is everything you need to know!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)