if(strcmp(params, "death", true) == 0) { if(GetPVarInt(playerid, "Injured") == 1) { SendClientMessageEx(playerid, COLOR_WHITE, "You gave up hope and fell unconscious, you were immediately sent to the hospital."); KillEMSQueue(playerid); ResetPlayerWeaponsEx(playerid); SpawnPlayer(playerid); } else { SendClientMessageEx(playerid, COLOR_GREY, " You are not injured, you can't do this right now !"); }
for(new i; i < MAX_PLAYERS; i++) { // GetPlayerPool() or foreach is highly recommended!
if(playervar[i][emsvar/faction]) {
return SendClientMessage(playerid, COLOR_GREY, "There is a EMS online!");
break;
}
}
PHP код:
|
if(strcmp(params, "death", true) == 0) {
if(GetPVarInt(playerid, "Injured") == 1) {
for(new i; i < MAX_PLAYERS; i++) { // GetPlayerPool() or foreach is highly recommended!
if(playervar[i][emsvar/faction]) {
return SendClientMessage(playerid, COLOR_GREY, "There is a EMS online!");
break;
}
}
SendClientMessageEx(playerid, COLOR_WHITE, "You gave up hope and fell unconscious, you were immediately sent to the hospital.");
KillEMSQueue(playerid);
ResetPlayerWeaponsEx(playerid);
SpawnPlayer(playerid);
}
else { SendClientMessageEx(playerid, COLOR_GREY, " You are not injured, you can't do this right now !"); }
You would need to put that at the start.
PHP код:
|
new OnDutyMedics; foreach(new i: Player) { if(IsAMedic(i) && PlayerInfo[i][pDuty] == 1) { OnDutyMedics++; } } if(OnDutyMedics < 1) {
if(strcmp(params, "death", true) == 0) {
if(GetPVarInt(playerid, "Injured") == 1) {
new cnt;
foreach(new i : Player) { // GetPlayerPool() or foreach is highly recommended!
if(IsAMedic(i) && PlayerInfo[i][pDuty] == 1) {
cnt++;
}
else if(!IsAMedic(i)) continue;
}
if(cnt != 0)
return SendClientMessage(playerid, COLOR_GREY, "There is a EMS online!");
SendClientMessageEx(playerid, COLOR_WHITE, "You gave up hope and fell unconscious, you were immediately sent to the hospital.");
KillEMSQueue(playerid);
ResetPlayerWeaponsEx(playerid);
SpawnPlayer(playerid);
}
else { SendClientMessageEx(playerid, COLOR_GREY, " You are not injured, you can't do this right now !"); }