SA-MP Forums Archive
spawn car - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: spawn car (/showthread.php?tid=244951)



spawn car - Venice - 29.03.2011

i need cmd for spawn car please give

/veh carid color1 color2


Re: spawn car - HyperZ - 29.03.2011

Created with Sscanf2 And Zcmd
pawn Код:
CMD:veh( playerid, params[ ] )
{
    new string[128], car, colour1, colour2;
    if(sscanf(params, "ddd", car, colour1, colour2)) return SendClientMessage(playerid, -1, "USAGE: /car [Model] [Colour 1] [Colour 2]");
    if(car < 400 || car > 611) return  SendClientMessage(playerid, -1, "ERROR: Invalid Vehicle Model ID!");
    new VehicleID;
    new Float:X,Float:Y,Float:Z;
    new Float:Angle,int1;
    GetPlayerPos(playerid, X,Y,Z);
    GetPlayerFacingAngle(playerid,Angle);
    int1 = GetPlayerInterior(playerid);
    VehicleID = CreateVehicle(car, X+3,Y,Z, Angle, colour1, colour2, -1);
    LinkVehicleToInterior(VehicleID,int1);
    format(string, sizeof(string), "You have Spawned a Vehicle (Model: %d) with Colours: %d,%d", car, colour1, colour2);
    SendClientMessage(playerid,-1, string);
    return 1;
}