Meh.. i will try to explain you a bit of "your" code
pawn Код:
if(giftsenabled) // If this variable is 1 the code will continue and you will recieve gift, so it means that you must set this variable on 0 if you want to skip this process for some time
{
if(gifttimer[playerid]) return SendClientMessage(playerid, GREY, "You must wait an hour before getting another gift.");
new Float:x, Float:y, Float:z;
GetDynamicObjectPos(dynamicgift, x, y, z);
if(gettinggift[playerid]) return 1;
if(IsPlayerInRangeOfPoint(playerid, 3.0, x, y, z))
{
//When is everything correct, then you will get your gift
giftsenabled = 0;//So you can block this part of code for some time
gettinggift[playerid] = 1;
format(string, sizeof(string), "* %s reaches inside the box with their eyes closed and grabs something.", PlayerName(playerid));
ProxDetector(30.0, playerid, string, PURPLE, PURPLE, PURPLE, PURPLE, PURPLE);
SetTimerEx("Gift", 1000, false, "i", playerid); //you will block it for an hour (3600000) and then
return 1;
}
else
{
SendClientMessage(playerid, GREY, "You are not near the gift box.");
return 1;
}
...
public Gift(playerid) //this will be processed every 1 hour
{
GiftPlayer(playerid, 1);
gifttimer[playerid] = 0;
gettinggift[playerid] = 0;
giftsenabled = 1;//and there you will enable the /getgift command
return 1;
}