SA-MP Forums Archive
CMD:v .. - 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: CMD:v .. (/showthread.php?tid=477438)



CMD:v .. - Kyance - 24.11.2013

Well, I'm not really so good at CreateVehicle stuff, but i tried creating a simple command, that would allow admins to spawn their own vehicle, but sadly the vehicle doesn't appear..

pawn Код:
CMD:v(playerid, params[]) {
    new vehicleid;
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "[ADMIN] - Only admins can use command!");
    if(sscanf(params, "u", vehicleid)) SendClientMessage(playerid, COLOR_ORANGE, "[USAGE] - /v [ID]");
    if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "[NOTE] - You can't be in a vehicle if you want to use this command.");
    else
    {
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid,X,Y,Z);
    vehicleid = CreateVehicle(vehicleid,X,Y,Z,0,1, 1, 60);
    PutPlayerInVehicle(playerid, vehicleid, 0);
    }
    return 1;
}



Re: CMD:v .. - Zues - 24.11.2013

don't forget to add : if(vehicleid < 400 || vehicleid > 611) return SendClientMessage(playerid, red, " Invalid vehicle model!");


Re: CMD:v .. - Emmet_ - 24.11.2013

Change the "u" in "sscanf(params, "u", vehicleid)" to "d".


Re: CMD:v .. - Kyance - 24.11.2013

Thank you guys so much, been having this problem for weeks.
+Rep for both of you


Re: CMD:v .. - Kyance - 24.11.2013

Uh, sorry for the double-post, but i have another question.
I've seen some servers with the command v, then a dialog comes, they select the Type(Sport cars, Industrial etc), and then there comes this "list" with pictures of the Vehicles.
How can you create the Pictures(I know that the feature has been added in 0.3x, but i would want to know how do you "access" or "enable" it..)


Re: CMD:v .. - Zues - 24.11.2013

With Mselection : https://sampforum.blast.hk/showthread.php?tid=407045
Or you can make them manualy by making model textdraws and using onplayerclicktextdraw but MSelection makes it much more easy.


Re: CMD:v .. - Kyance - 24.11.2013

Thanks Zues