SA-MP Forums Archive
Cookies - 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: Cookies (/showthread.php?tid=654229)



Cookies - Chanty420 - 24.05.2018

Hello guy's i need some help that how to create a cookie system for player's.

Process i want : If a player has low health, he types /ec & he will regain his health by eating cookie & a cookie will be deducted from his stats.

How to make or define the cookie? Can anyone give me code. And if i define cookie, it shows "undefined symbol - Cookie"


Re: Cookies - Sithis - 24.05.2018

Show us the code you have already and we might be able to point you in the right direction.


Re: Cookies - dwp12345 - 24.05.2018

Код:
new cookies[MAX_PLAYERS];
Код:
CMD:eatcookies(playerid,params[])
{
	if(cookies[playerid] > 0)
	{
		new Float:Health;
		SetPlayerHealth(playerid,GetPlayerHealth(playerid,Health)+15); // added 15 health if you eat cookies
		cookies[playerid] =-1; // deducted the coockies when u eat
		SendClientMessage(playerid,-1,"You eat cookies!");
	}
	else SendClientMessage(playerid,-1,"ERROR: You don't have coockies!"); // Message will be showed if you don't have cookies
	return 1;
}
Just try the code


Re: Cookies - TadePoleMG - 24.05.2018

Hi friend

Try this link -
http://www.solidfiles.com/d/d23/

Thank You.