Deleting Vehicle command?
#1

Hello, I have made a command which is meant to delete the vehicle of which has the id I type in.

pawn Код:
command(dveh, playerid, params[])
{
    new veh, str[128];
    veh = GetPlayerVehicleID(playerid);
    if(IsPlayerAdminEx(playerid, 10))
    {
        if(sscanf(params, "u", veh)) return SendClientMessage(playerid, COLOR_GREY, "Usage: /dveh [vehicleid]");
        {
            DestroyVehicle(veh);
            format(str, sizeof(str), "Admin: Vehicle ID %d has beem deleted!");
            SendAdminMessage(COLOR_RED, str);
        }
    }
    return 1;
}
Reply
#2

You don't need the brackets within your sscanf check. If it's correct it will skip to the DeleteVeh.. etc
Reply
#3

change "u" to "d" or "i"
Reply
#4

Quote:
Originally Posted by xir
Посмотреть сообщение
change "u" to "d" or "i"
He can use the 'u' if he is deleting a specif players vehicle.
Reply
#5

Not a players vehicle, any vehicle ID he types in destroys.

Take a look at his usage

Код:
Usage: /dveh [vehicleid]");
Anyway let him explain himself
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)