27.04.2012, 17:03
Code:
Queria coloca o comando de deleta veнculos para deleta todos os veнculos criados.
+REP
pawn Код:
if(strcmp(cmd, "/criarveiculo", true) == 0 || strcmp(cmd, "/cv", true) == 0)
{
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(pAdmin[playerid] == 1 || IsPlayerAdmin(playerid)) {
new plid;
new Float:X,Float:Y,Float:Z,Float:Angle;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, Vermelho, "* Use: /Criarveiculo [ID do veiculo]");
return 1;
}
plid = strval(tmp);
if(IsPlayerConnected(playerid)) {
if(plid >= 400 && plid <= 611) {
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
new carro = CreateVehicle(plid, X, Y, Z, Angle, -1, -1, 120000);
PutPlayerInVehicle(playerid,carro,0);
if(GetPlayerInterior(playerid))
LinkVehicleToInterior(carro,GetPlayerInterior(playerid));
SetVehicleVirtualWorld(carro,GetPlayerVirtualWorld(playerid));
NaoUsado[carro] = true;
format(string, sizeof(string), "| INFO | Veiculo ID '%d' criado com sucesso.", plid);
SendClientMessage(playerid, outraadm, string);
return 1;
}
else {
SendClientMessage(playerid, Vermelho, "| ERRO | ID invбlido, digite um ID vбlido. ID's permitidos = 400 б 611.");
return 1;
}
}
}
}
pawn Код:
if(strcmp(cmd, "/dv", true) == 0)
{
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(pAdmin[playerid] == 5)
{
new vid;
vid = GetPlayerVehicleID(playerid);
if(vid == DPLS[0] || vid == DPLS[1] || vid == DPLS[2] || vid == DPLS[3] || vid == DPLS[4] || vid == DPLS[5] || vid == DPLS[6] || vid == DPLS[7] || vid == DPLS[8] || vid == DPLS[9] || vid == DPLS[10] || vid == DPLS[11] || vid == DPLS[12] || vid == DPLS[13] || vid == DPLS[14]
|| vid == hospcars[0] || vid == hospcars[1] || vid == hospcars[2] || vid == hospcars[3] || vid == hospcars[4] || vid == hospcars[5]) {
SendClientMessage(playerid, Vermelho, "| ERRO | Esse veiculo nгo pode ser deletado!");
return 1;
}
for(new carro = 0; carro < MAX_CARROS; carro++) {
format(string, sizeof(string), "carro%d.ini", carro);
if(vid == dini_Int(string, "Id")) {
SendClientMessage(playerid, Vermelho, "| ERRO | Esse veiculo nгo pode ser deletado!");
return 1;
}
}
DestroyVehicle(vid);
SendClientMessage(playerid,0x0080FFAA,"| INFO | Veiculo deletado com sucesso!");
return 1;
}
}