16.10.2013, 20:16
This should work
Код:
CMD:revive(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 1) { SendClientMessage(playerid, COLOR_GRAD1, " You are not authorized to use that command !"); return 1; } new toplayerid; if(!sscanf(params, "u", toplayerid)) { if(IsPlayerConnected(toplayerid)) { if(toplayerid != INVALID_PLAYER_ID) { if(PlayerJustDied[toplayerid] == 1) { if(PlayerCalledEMS[playerid] == 0) { KillTimer(DeathTimer(toplayerid)); SetPlayerHealth(toplayerid, 100); SetPlayerArmour(toplayerid, 0); ClearAnimations(toplayerid); PlayerJustDied[toplayerid] = 0; TextDrawHideForPlayer(toplayerid, Text:DieText); TextDrawHideForPlayer(toplayerid, Text:InjuredText); SendClientMessage(toplayerid, COLOR_WHITE, " Revived by admin !"); format(string, sizeof(string), "{FF0000}AdmWarning{FFFFFF}: %s has revived %s.",PlayerRPName(playerid),PlayerRPName(toplayerid)); ABroadCast(COLOR_WHITE,string,1); } else { SendClientMessage(playerid, COLOR_GRAD1, " The player is awaiting a paramedic !"); } } else { SendClientMessage(playerid, COLOR_GRAD1, " Player is not injured !"); } } } } else { SendClientMessage(playerid, COLOR_GREY, "USAGE: '/revive [playerid/PartOfName]'"); } return 1; }