CMD:v ..
#1

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;
}
Reply
#2

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

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

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

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..)
Reply
#6

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.
Reply
#7

Thanks Zues
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)