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



Help - Swans - 24.11.2015

Can someone help on how to do this means when a player buys booklet that his hospital treatment takes $ 100 and who does booklet that takes his $ 500 means when a player dies and who has a booklet that it took $ 100 and who does not have $ 500


Re: Help - MeCom - 24.11.2015

Код:
#include <ZCMD>

new booklet[MAX_PLAYERS];

CMD:buybooklet(playerid, params[])
{
    SendClientMessage(playerid, 0x00FF00FF, "You have bought a booklet.");
    booklet[playerid] = 1;
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
	if(booklet[playerid] == 1)
	{
	    GivePlayerMoney(playerid, -100);
	}
	else if(booklet[playerid] == 0)
	{
	    GivePlayerMoney(playerid, -500);
	}
	return 1;
}