29.05.2012, 21:12
Deve ser isso que vocк quer..
pawn Код:
new Blindagem[MAX_VEHICLES];
public OnPlayerCommandText(playerid, cmdtext[]) {
if(!strcmp(cmdtext, "/blindar", true)) {
if(!IsPlayerInAnyVehicle(playerid))
return false;
SendClientMessage(playerid, -1, "Blindagem adcionada");
Blindagem[GetPlayerVehicleID(playerid)] = 1000;
RepairVehicle(GetPlayerVehicleID(playerid));
return 1;
}
if(!strcmp(cmdtext, "/verblindagem", true)) {
if(!IsPlayerInAnyVehicle(playerid))
return false;
new s[50];
format(s, 50, "Esse veнculo tem %i de blindagem", Blindagem[GetPlayerVehicleID(playerid)]);
SendClientMessage(playerid, -1, s);
return true;
}
return false;
}
public OnVehicleDamageStatusUpdate(vehicleid, playerid) {
if(Blindagem[vehicleid] > 0) {
Blindagem[vehicleid] --;
RepairVehicle(vehicleid);
if(!Blindagem[vehicleid]) {
SendClientMessage(playerid, -1, "Blindagem acabou..!");
}
}
return true;
}