SA-MP Forums Archive
[Include] GiftBoxes 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)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] GiftBoxes System (/showthread.php?tid=552421)



GiftBoxes System - Mihaitza97 - 24.12.2014

How it works
This include is actually a kind of event with gift boxes who is activate by a function and disable by another. Isn't complicated because i added a description for every function in my code.
Well, about how it works, system is easy: someone start the event and on the map will be placed in different and random places those gift boxes. When a player pick up a gift box will receive a reward who is set by the owner/founder in gamemode.

Functions
pawn Код:
InitiateGifts(); //This function creates giftboxes and resets variables to default.
DestroyGifts(); //This function destroys every giftbox and resets variables to default.
CheckGift(playerid,pickupid); //You must insert this function in your OnPlayerPickUpPickup public from your gamemode.
public PlayerGiftReward(playerid,pickupid); //You must use this public in your gamemode in order to set a bonus for the player to receive when he picks up a giftbox.
Read this (important)
If you will use this include, you have to know few things:
InitiateGifts(); - This function creates giftboxes and will start the event.
DestroyGifts(); - This function destroys all the gift boxes and will stop the event.
CheckGift(playerid,pickupid); - You must insert this function in OnPlayerPickUpPickup public! If you didn't, the player can't take the gift box.
public PlayerGiftReward(playerid,pickupid); - This public will be called every time when a player pick up a gift box. So, you can add a reward.
Look in include: new Float:GiftPos[][] - This array have giftboxes positions. If you want to add more, all you have to do is to edit this array.

And, that's all.

Video
http://*********/vitV80cefnA

Download
http://pastebin.com/F9i2jeyn


Re: GiftBoxes System - Ryz - 24.12.2014

Awesome work!


Re: GiftBoxes System - LivingLikeYouDo - 24.12.2014

Definitely not cool. Should be dynamic. There is no function to create a gift box.

Nothing else to say.


Re: GiftBoxes System - TheRaGeLord - 15.01.2015

Nice Work