Multipliation Problems
#1

Код:
COMMAND:applydamage(playerid, params[])
{
	new type[124],appdam;
	new Float: cHealth;
	if(sscanf(params, "ss", type,appdam))
	{
		SendClientMessage(playerid, COLOR_WHITE, "USAGE: /(a)pply(d)amage [bashing(6.0)");
	}
	else
	{
		if(strcmp(type, "bash", true) ==0)
		{
		GetPlayerHealth(playerid, cHealth);
		SetPlayerHealth(playerid, cHealth-6*appdam);
		return 1;
		}
	}
	return 1;
}
Each time when I get IG and try this command, it is killing me, when I remove the multiplication, it is decreasing the " 6 HP " as I want. The point over here, I want it once you type the amount you want, it multiplies the " -6 ".
Reply
#2

Your priorities aren't straight.

if(sscanf(params, "s[124]i", type,appdam))

SetPlayerHealth(playerid, cHealth+(-6*appdam));
Reply
#3

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
Your priorities aren't straight.

if(sscanf(params, "s[124]i", type,appdam))

SetPlayerHealth(playerid, cHealth+(-6*appdam));
Thanks for the fast respond, Fixed
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)