SA-MP Forums Archive
Need help with car spawner [+REP] - 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: Need help with car spawner [+REP] (/showthread.php?tid=324367)



Need help with car spawner [+REP] - tuuler - 09.03.2012

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 !


Re: Need help with car spawner [+REP] - Marco_Valentine - 09.03.2012

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


Re: Need help with car spawner [+REP] - tuuler - 09.03.2012

I need help with dialog !


Re: Need help with car spawner [+REP] - Marco_Valentine - 09.03.2012

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


Re: Need help with car spawner [+REP] - Twisted_Insane - 09.03.2012

HERE is everything you need to know!