Healing a player?
#1

Hi so i made this code but i know i messed up something, so some help fixing the code would be nice.
The healer has to be close to the other person.
PlayerDied = When a person is dying.


Код:
		COMMAND:heal(playerid, params[])
{
        new deadid;
        if(sscanf(params, "i", deadid)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /aheal [ID].");
        if(PlayerDied[playerid] == 1) {
        if(IsPlayerInRangeOfPoint(playerid, 7.0, deadid, deadid, deadid)) {
        if(!IsPlayerConnected(deadid)) return SendClientMessage(playerid, COLOR_GREY, "That Player Is Not Connected!");
        SetPlayerHealth(deadid, 100);
		} else {
		SCM(playerid, COLOR_GREEN, "l"); }
		}
        return 1;
}
Reply
#2

Код:
		COMMAND:heal(playerid, params[])
{
        new deadid;
        if(sscanf(params, "u", deadid)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /aheal [ID].");
        if(targetid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Error: Invalid Playerid");
        if(PlayerDied[playerid] == 1) {
        new Float:X, Float:Y, Float:Z;
        GetPlayerPos(deadid, X, Y, Z);
        if(IsPlayerInRangeOfPoint(playerid, 7.0, X, Y, Z)) {
        if(!IsPlayerConnected(deadid)) return SendClientMessage(playerid, COLOR_GREY, "That Player Is Not Connected!");
        SetPlayerHealth(deadid, 100);
		} else {
		SCM(playerid, COLOR_GREEN, "l"); }
		}
        return 1;
}
Okay done if it doesnt work i'll recode it
Reply
#3

Yeah thank you, i had to do some changes tho.

+Rep.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)