/heal another player
#5

Quote:
Originally Posted by Rock18
Посмотреть сообщение
Try this

Код:
if(strcmp("/heal", cmdtext, true, 4) == 0)
        {
            if(!strlen(cmdtext[8])) return SendClientMessage(playerid, 0xFF0000AA, "Use: /heal [playerid]");
            new gp = strval(cmdtext[8]);
            if(!IsPlayerConnected(gp)) return SendClientMessage(playerid, 0xFF0000AA, "Invalid Playerid");
            new pn[24], an[24], str[70];
            GetPlayerName(playerid, an, 24); GetPlayerName(gp, pn, 24);
            format(str, sizeof(str), "%s is healed by %s", pn, an);
            SendClientMessageToAll(0xA9A9A9AA, str);
            SetPlayerHealth(playerid, 100);
            return 1;
        }
Don't work ...

Quote:
Originally Posted by FreshDoubleX
Посмотреть сообщение
Код:
CMD:heal(playerid, params[])
{
	new
		otherId
	;
        if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You're not an admin");
        if(!IsPlayerConnected(otherId)) return SendClientMessage(playerid, -1, "ERROR: Invalid ID");
	if(sscanf(params, "d", otherId)) return SendClientMessage(playerid, -1, "USAGE: /heal [Name/ID]");
	SetPlayerHealth(otherId, 100.0);
	return 1;
}
ZCMD Is much easier and faster.
Also if you haven't defined sscanf, then add this native:
Код:
native sscanf(const data[], const format[], {Float,_}:...);
Yeah ok It doesn't work too ... (i know zcmd is better but ... i don't like to use it xD)
but thanks
Reply


Messages In This Thread
/heal another player - by Michael@Belgium - 28.01.2011, 19:51
Re: /heal another player - by Larsey123IsMe - 28.01.2011, 20:07
Re: /heal another player - by Rock18 - 28.01.2011, 20:34
Re: /heal another player - by FreshDoubleX - 28.01.2011, 20:38
Re: /heal another player - by Michael@Belgium - 29.01.2011, 10:25
Re: /heal another player - by [CrC]reinixx - 29.01.2011, 10:31
Re: /heal another player - by Lorenc_ - 29.01.2011, 10:33
Re: /heal another player - by Michael@Belgium - 29.01.2011, 10:56
Re: /heal another player - by alpha500delta - 30.01.2011, 11:56
Re: /heal another player - by [CrC]reinixx - 01.02.2011, 16:40

Forum Jump:


Users browsing this thread: 1 Guest(s)