SA-MP Forums Archive
Multipliation Problems - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Multipliation Problems (/showthread.php?tid=624790)



Multipliation Problems - SytonicX - 22.12.2016

Код:
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 ".


Re: Multipliation Problems - SickAttack - 22.12.2016

Your priorities aren't straight.

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

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


Re: Multipliation Problems - SytonicX - 22.12.2016

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