SA-MP Forums Archive
AddStaticVehicleEx help - 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: AddStaticVehicleEx help (/showthread.php?tid=470681)



AddStaticVehicleEx help - DamonD - 19.10.2013

Just a random question but is there a way to generate an AddStaticVehicleEx IG(in ZCMD), with the vehicle you're in


Re: AddStaticVehicleEx help - Patrick - 19.10.2013

Yes, using zcmd and sscanf2

pawn Код:
#include <zcmd>
#include <sscanf>

CMD:spawnveh(playerid, params[])
{

    new
        _VehicleID,
        Float:_Pos[4],
        _VehicleColor[2]
    ;

    GetPlayerPos(playerid, _Pos[0], _Pos[1], _Pos[2]), GetPlayerFacingAngle(playerid, _Pos[3]);
    if(sscanf(params, "iii", _VehicleID, _VehicleColor[0], _VehicleColor[1]))
        return SendClientMessage(playerid, -1, "Syntax: /spawnveh [Vehicle ID] [Vehicle Color 1] [Vehicle Color 2]")
    AddStaticVehicleEx(_VehicleID, _Pos[0], _Pos[1], _Pos[2], _Pos[3], _VehicleColor[0], _VehicleColor[1], 120+60)//3 minutes all together
    return 1;
}