02.10.2018, 23:37
I would like to add on my command, when some player enters an invalid vehicle ID send the message: "Vehicle not found"
Taking into account that it has the command to delete vehicles "deletar", thus, the vehicle that is deleted could not receive more actions, for example: I deleted the vehicle from ID 2, then any other command that I put with id 2 send the message "Vehicle not found"
Thanks in advance.
Taking into account that it has the command to delete vehicles "deletar", thus, the vehicle that is deleted could not receive more actions, for example: I deleted the vehicle from ID 2, then any other command that I put with id 2 send the message "Vehicle not found"
Thanks in advance.
pawn Код:
ACMD:veiculo[3](playerid, params[])
{
if(!IsPlayerOnAdminDuty(playerid) && GetPlayerAdminLevel(playerid) < STAFF_LEVEL_LEAD)
return 6;
new
command[30],
vehicleid;
if(sscanf(params, "s[30]D(-1)", command, vehicleid))
{
Msg(playerid, NovoA, "[ > ] Uso correto: /veiculo [puxar/ir/entrar/dono/deletar/respawn/resetar/trancar/destrancar/removerchave] [id]");
return 1;
}
if(vehicleid == -1)
vehicleid = GetPlayerVehicleID(playerid);
if(!IsValidVehicle(vehicleid))
return 4;
if(!strcmp(command, "entrar"))
{
PutPlayerInVehicle(playerid, vehicleid, 0);
MsgAdminsF(1, NovoA, "{00CED1}[ > ] O(a) administrador(a) %P{00CED1} usou o comando de entrar no veнculo de ID {FFFFFF}%d !", playerid, vehicleid);
return 1;
{
if(!strcmp(command, "deletar"))
{
DestroyWorldVehicle(vehicleid);
MsgF(playerid, RED, "[x] Veнculo %d foi deletado!", vehicleid);
MsgAdminsF(1, NovoA, "{00CED1}[ > ] O(a) administrador(a) %P{00CED1} deletou o veнculo de ID {FFFFFF}%d !", playerid, vehicleid);
return 1;
}