SA-MP Forums Archive
Help me more ! - 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: Help me more ! (/showthread.php?tid=473218)



Help me more ! - kingcrome - 01.11.2013

Is it possible to spawn a vehicle at a players position when doing a command.


Re: Help me more ! - Patrick - 01.11.2013

Yes, it is possible, not that hard


Re: Help me more ! - kingcrome - 01.11.2013

How can i do it?


Re: Help me more ! - Zex Tan - 01.11.2013

Create a command. Afterwards, GetPlayerPos and CreateVehicle. Lastly, PutPlayerInVehicle if you want and the closing brackets.


Re: Help me more ! - Patrick - 01.11.2013

Quote:
Originally Posted by kingcrome
Посмотреть сообщение
How can i do it?
Scripting, of course, One moment, I'm writing you the code

EDIT: This is a quick sample of the code
pawn Код:
CMD:createveh(playerid, params[])
{
    new
        VehicleID, CarColor[2], Position[4];

    if(sscanf(params, "iii", VehicleID, CarColor[0], CarColor[1]))
        return SendClientMessage(playerid, -1, "Syntax: /createveh [Vehicle ID] [Color 1] [Color 2]");

    GetPlayerPos(playerid, Position[0], Position[1], Position[2]), GetPlayerFacingAngle(playerid, Position[4]);

    CreateVehicle(VehicleID, Position[0], Position[1], Position[2], Position[3], CarColor[0], CarColor[1], 300);
    return true;
}



Re: Help me more ! - kingcrome - 01.11.2013

Thank you