SA-MP Forums Archive
Deleting Vehicle command? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Deleting Vehicle command? (/showthread.php?tid=247219)



Deleting Vehicle command? - Luis- - 08.04.2011

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;
}



Re: Deleting Vehicle command? - Infamous - 08.04.2011

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


Re: Deleting Vehicle command? - xir - 08.04.2011

change "u" to "d" or "i"


Re: Deleting Vehicle command? - Infamous - 08.04.2011

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


Re: Deleting Vehicle command? - xir - 08.04.2011

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