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 []/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, "puxar")) { new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); PutPlayerInVehicle(playerid, vehicleid, 0); SetVehiclePos(vehicleid, x, y, z); SetPlayerPos(playerid, x, y, z + 2); SetCameraBehindPlayer(playerid); MsgAdminsF(1, NovoA, "{00CED1}[ > ] O(a) administrador(a) %P{00CED1} puxou o veнculo de ID {FFFFFF}%d !", playerid, vehicleid); return 1; } if(!strcmp(command, "ir")) { new Float:x, Float:y, Float:z; GetVehiclePos(vehicleid, x, y, z); SetPlayerPos(playerid, x, y, z); MsgAdminsF(1, NovoA, "{00CED1}[ > ] O(a) administrador(a) %P{00CED1} foi atй o veнculo de ID {FFFFFF}%d !", playerid, vehicleid); return 1; } 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, "dono")) { new owner[MAX_PLAYER_NAME]; GetVehicleOwner(vehicleid, owner); MsgF(playerid, NovoA, "[ > ] O dono desse veнculo й: {FFFFFF}'%s'", owner); MsgAdminsF(1, NovoA, "{00CED1}[ > ] O(a) administrador(a) %P{00CED1} estб vendo quem й o dono do 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; } if(!strcmp(command, "respawn")) { RespawnVehicle(vehicleid); MsgF(playerid, RED, "[x] Veнculo %d foi respawnado!", vehicleid); MsgAdminsF(1, NovoA, "{00CED1}[ > ] O(a) administrador(a) %P {00CED1}respawnou o veнculo de ID {FFFFFF}%d !", playerid, vehicleid); return 1; } if(!strcmp(command, "resetar")) { ResetVehicle(vehicleid); MsgF(playerid, RED, "[x] Veнculo %d foi resetado!", vehicleid); MsgAdminsF(1, NovoA, "{00CED1}[ > ] O(a) administrador(a) %P {00CED1}resetou o veнculo de ID {FFFFFF}%d !", playerid, vehicleid); return 1; } if(!strcmp(command, "trancar")) { SetVehicleExternalLock(vehicleid, 1); MsgF(playerid, RED, "[x] Veнculo %d foi trancado!", vehicleid); MsgAdminsF(1, NovoA, "{00CED1}[ > ] O(a) administrador(a) %P {00CED1}trancou o veнculo de ID {FFFFFF}%d !", playerid, vehicleid); return 1; } if(!strcmp(command, "destrancar")) { SetVehicleExternalLock(vehicleid, 0); MsgF(playerid, RED, "[x] Veнculo %d foi destrancado!", vehicleid); MsgAdminsF(1, NovoA, "{00CED1}[ > ] O(a) administrador(a) %P {00CED1}destrancou o veнculo de ID {FFFFFF}%d !", playerid, vehicleid); return 1; } if(!strcmp(command, "removerchave")) { SetVehicleKey(vehicleid, 0); MsgF(playerid, RED, "[x] Veнculo %d teve sua chave removida!", vehicleid); MsgAdminsF(1, NovoA, "{00CED1}[ > ] O(a) administrador(a) %P{00CED1} removeu a chave do veнculo de ID {FFFFFF}%d !", playerid, vehicleid); return 1; } Msg(playerid, NovoA, "[ > ] Uso correto: /veiculo [puxar/entrar/dono/deletar/respawn/resetar/trancar/destrancar] [id]"); return 1; }
when putting the wrong car ID appears: "Vehicle not found" |
CMD:vehicle(playerid, params[])
{
new vehicleid;
sscanf(params, "d", vehicleid);
if(vehicleid < 400 || vehicleid > 611) {
SendClientMessage(playerid, -1, "Vehicle not found");
return 1;
}
return 1;
}
ACMD:veiculo(playerid, params[])
{
if(!IsPlayerOnAdminDuty(playerid) && GetPlayerAdminLevel(playerid) < STAFF_LEVEL_LEAD) return 0;
new command[24], vehicleid;
if(sscanf(params, "s[24]d", command, vehicleid)) return Msg(playerid, NovoA, "[ > ] Uso correto: /veiculo /ir/entrar/dono/deletar/respawn/resetar/trancar/destrancar/removerchave] [id]");
if(vehicleid < 1 || vehicleid > 3) return SendClientMessage(playerid, -1, "Error: vehicle slots 1 - 3.");
if(!IsValidVehicle(vehicleid)) return 0;
if(!strcmp(command, "puxar", true))
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
PutPlayerInVehicle(playerid, vehicleid, 0);
SetVehiclePos(vehicleid, x, y, z);
SetPlayerPos(playerid, x, y, z + 2);
SetCameraBehindPlayer(playerid);
MsgAdminsF(1, NovoA, "{00CED1}[ > ] O(a) administrador(a) %P{00CED1} puxou o veнculo de ID {FFFFFF}%d !", playerid, vehicleid);
return 1;
}
else if(!strcmp(command, "ir", true))
{
new Float:x, Float:y, Float:z;
GetVehiclePos(vehicleid, x, y, z);
SetPlayerPos(playerid, x, y, z);
MsgAdminsF(1, NovoA, "{00CED1}[ > ] O(a) administrador(a) %P{00CED1} foi atй o veнculo de ID {FFFFFF}%d !", playerid, vehicleid);
return 1;
}
else if(!strcmp(command, "entrar", true))
{
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;
}
else if(!strcmp(command, "dono", true))
{
new owner[MAX_PLAYER_NAME];
GetVehicleOwner(vehicleid, owner);
MsgF(playerid, NovoA, "[ > ] O dono desse veнculo й: {FFFFFF}'%s'", owner);
MsgAdminsF(1, NovoA, "{00CED1}[ > ] O(a) administrador(a) %P{00CED1} estб vendo quem й o dono do veнculo de ID {FFFFFF}%d !", playerid, vehicleid);
return 1;
}
else if(!strcmp(command, "deletar", true))
{
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;
}
else if(!strcmp(command, "respawn", true))
{
RespawnVehicle(vehicleid);
MsgF(playerid, RED, "[x] Veнculo %d foi respawnado!", vehicleid);
MsgAdminsF(1, NovoA, "{00CED1}[ > ] O(a) administrador(a) %P {00CED1}respawnou o veнculo de ID {FFFFFF}%d !", playerid, vehicleid);
return 1;
}
else if(!strcmp(command, "resetar", true))
{
ResetVehicle(vehicleid);
MsgF(playerid, RED, "[x] Veнculo %d foi resetado!", vehicleid);
MsgAdminsF(1, NovoA, "{00CED1}[ > ] O(a) administrador(a) %P {00CED1}resetou o veнculo de ID {FFFFFF}%d !", playerid, vehicleid);
return 1;
}
else if(!strcmp(command, "trancar", true))
{
SetVehicleExternalLock(vehicleid, 1);
MsgF(playerid, RED, "[x] Veнculo %d foi trancado!", vehicleid);
MsgAdminsF(1, NovoA, "{00CED1}[ > ] O(a) administrador(a) %P {00CED1}trancou o veнculo de ID {FFFFFF}%d !", playerid, vehicleid);
return 1;
}
else if(!strcmp(command, "destrancar", true))
{
SetVehicleExternalLock(vehicleid, 0);
MsgF(playerid, RED, "[x] Veнculo %d foi destrancado!", vehicleid);
MsgAdminsF(1, NovoA, "{00CED1}[ > ] O(a) administrador(a) %P {00CED1}destrancou o veнculo de ID {FFFFFF}%d !", playerid, vehicleid);
return 1;
}
else if(!strcmp(command, "removerchave", true))
{
SetVehicleKey(vehicleid, 0);
MsgF(playerid, RED, "[x] Veнculo %d teve sua chave removida!", vehicleid);
MsgAdminsF(1, NovoA, "{00CED1}[ > ] O(a) administrador(a) %P{00CED1} removeu a chave do veнculo de ID {FFFFFF}%d !", playerid, vehicleid);
return 1;
}
else Msg(playerid, NovoA, "[ > ] Uso correto: /veiculo /ir/entrar/dono/deletar/respawn/resetar/trancar/destrancar/removerchave] [id]");
return 1;
}
According to this "veiculo [3]" I imagine that there are 3 vehicle slots for each player, then:
PHP код:
|