05.03.2019, 10:18
Quote:
Yeah format the text, forgot about it.
Well then your check returns false, no one called or you didn't set the variable ems_called to true after a player calling. |
PHP код:
CMD:callems(playerid,params[]){
if(PlayerInfo[playerid][pInjured] != 1) return SendClientMessage(playerid, COLOR_RED, "Error:{FFFFFF} This command can be used only when you are injured.");
if(EMSCall[playerid][ems_called]) return SendClientMessage(playerid, COLOR_GREY, "You already called for EMS service, please wait...");
GetPlayerPos(playerid, EMSCall[playerid][ems_pos][0], EMSCall[playerid][ems_pos][1], EMSCall[playerid][ems_pos][2]);
if(EMSCall[playerid][ems_pos][0]==0.0000 && EMSCall[playerid][ems_pos][1]==0.0000&&EMSCall[playerid][ems_pos][2]==0.0000){
EMSCall[playerid][ems_pos][0] = PlayerInfo[playerid][pPosX];
EMSCall[playerid][ems_pos][1] = PlayerInfo[playerid][pPosY];
EMSCall[playerid][ems_pos][2] = PlayerInfo[playerid][pPosZ];
}
EMSCall[playerid][ems_called]=1;
SendFactionMessage(FACTION_FMD,0xE4A3E2FF,"[DISPATCH] %s is calling EMS at %s. (( Use /emscalls to list calls, /acceptcall to accept call. ))",PlayerICName(playerid),GetPlayerZone(playerid));
return 1;
}