SA-MP Forums Archive
[FilterScript] Xmas Giftbox System - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Xmas Giftbox System (/showthread.php?tid=597393)



Xmas Giftbox System - MafiaOink - 30.12.2015

Hey guys, today I'm presenting my Xmas Giftbox system, It uses dini for saving(I know it sucks but I did it in a real hurry) which saves the cooldown and you can edit it from toes finger to hair, You can set the cooldown, everything.. There is a /gift command scripted which will be used to get a random gift, created from filterscript, then it will call a function to your gamemode which will send the id, and the gift will be added/given by gamemode because filterscript wont give actual money etc

Downloads
Version 1.1
Version 1.0

Change Log
Version 1.1
[+] Added Y_INI
[-] Removed Dini
[!] Fixed a problem in Y_INI saving where GetPlayerPoolSize(); does not work in saving everyone(Replaced with MAX_PLAYERS)


Version 1.0
[*] Initial Release


Screenshots

http://imgur.com/a/DZanz


Example used on SS(gamemode: grandlarc, forwarding is required!)

Code:
forward OnPlayerRetrieveGift(playerid, randomid);
public OnPlayerRetrieveGift(playerid, randomid)
{
	if(randomid == 1)
	{
	    SendClientMessage(playerid, -1, "You won free 300 HP!");
	    SetPlayerHealth(playerid, 300);
	}
	else if(randomid == 2)
	{
	    SendClientMessage(playerid, -1, "You won free 300 armour!");
	    SetPlayerArmour(playerid, 300);
	}
	else if(randomid == 3)
	{
	    SendClientMessage(playerid, -1, "You won free deagle with 70 ammo!");
	    GivePlayerWeapon(playerid, 24, 70);
	}
	else if(randomid == 4)
	{
	    SendClientMessage(playerid, -1, "You won free $9000!");
	    GivePlayerMoney(playerid, 9000);
	}
	else if(randomid == 5)
	{
	    SendClientMessage(playerid, -1, "You won the Advanced Weapon Kit!");
		GivePlayerWeapon(playerid, 24, 200);
		GivePlayerWeapon(playerid, 27, 200);
		GivePlayerWeapon(playerid, 29, 200);
		GivePlayerWeapon(playerid, 31, 200);
		GivePlayerWeapon(playerid, 8, 1);
		GivePlayerWeapon(playerid, 34, 200);
	}
	return 1;
}



Re: Xmas Giftbox System - Crystallize - 30.12.2015


It looks cool , try to update it to another saving system like ini


Re: Xmas Giftbox System - MafiaOink - 30.12.2015

I'll look forward if there are any suggestions

~ Switched to Y_INI, Older version is still available