SA-MP Forums Archive
Looking for help with a gift command. - 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: Looking for help with a gift command. (/showthread.php?tid=395794)



Looking for help with a gift command. - ArmandoRamiraz - 27.11.2012

This guy gave me an idea about making a gift system. But I tweeked it a little. When I spawn a gift box by an Admin. I want other players to type /getgift to get some random gift I make. How would I make the command for this?

My giftbox spawning:
Код:
CMD:xmas(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, COLOR_GREY,"You are not authorized to use that command!");
	{
		new Float:x,Float:y,Float:z;
		GetPlayerPos(playerid,x,y,z);
		CreateObject(19054,x+2.0,y,z,0.0,1,0,300);
		SendClientMessageToAll(COLOR_RED, "An Admin has set a gift box!");
		return 1;
	}
}



Re: Looking for help with a gift command. - Riddick94 - 27.11.2012

Save object to variable index and then check is player near object and give them their gift. You should also make an boolean var for check is gift party started or not.


Re: Looking for help with a gift command. - ArmandoRamiraz - 27.11.2012

I cant seem to get it to work...An example please?


Re: Looking for help with a gift command. - ArmandoRamiraz - 28.11.2012

its been 24 hours...Can someone give me an example of the command I could use?