CMD:v ..

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.");
    new Float:X,Float:Y,Float:Z;
    vehicleid = CreateVehicle(vehicleid,X,Y,Z,0,1, 1, 60);
    PutPlayerInVehicle(playerid, vehicleid, 0);
    return 1;

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

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

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

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..)

With Mselection :
Or you can make them manualy by making model textdraws and using onplayerclicktextdraw but MSelection makes it much more easy.

Thanks Zues

Forum Jump:

Users browsing this thread: 1 Guest(s)