HELP PLEASE
#3

What to you mean by reviving dead player?

I made this command to heal a chosen player if he have less than 10 HP.
Код:
CMD:revive(playerid, params[])
{
	new ChosenPlayerID, Float:health;
	if (!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Only admins can use this command."); // This is your admin check
	if (sscanf(params, "u", ChosenPlayerID)) SendClientMessage(playerid, -1, "Usage: /revive <playerid>");
	if (ChosenPlayerID == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "That player is not connected");
	GetPlayerHealth(ChosenPlayerID, health);
    	if (health > 10.0) return SendClientMessage(playerid, -1, "This player has enough health.");
        SetPlayerHealth(ChosenPlayerID, 100.0); // Heal the player
	SendClientMessage(ChosenPlayerID, -1, "You was revived by admin."); // Inform the player that he was revived
	return 1;
}
Notes:
  • I used the IsPlayerAdmin (RCON admin) check, if you use other admin check change it.
  • If the player is dead or was killed he can't be revived but he will respawn as usually.
  • This command is not tested.
Reply


Messages In This Thread
HELP PLEASE - by DAREL - 13.05.2016, 21:31
Re: HELP PLEASE - by Dayrion - 13.05.2016, 21:34
Re: HELP PLEASE - by Darkwood17 - 13.05.2016, 21:55
Re: HELP PLEASE - by BloodyDexter - 13.05.2016, 22:03
Re: HELP PLEASE - by Darkwood17 - 13.05.2016, 22:11
Re: HELP PLEASE - by Dayrion - 13.05.2016, 22:13
Re: HELP PLEASE - by BloodyDexter - 13.05.2016, 22:14
Re: HELP PLEASE - by Darkwood17 - 13.05.2016, 22:24

Forum Jump:


Users browsing this thread: 1 Guest(s)