Giftbox issue
#10

Quote:
Originally Posted by Matess
Посмотреть сообщение
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;
}
All changing the timer does is change the amount of time it takes for the box to get your gift. So during the trial, setting it to 15,000, (15 seconds I think), just makes it so the box takes 15 seconds to give you your gift. Either I'm not understanding something or changing the timer does absolutely nothing.
Reply


Messages In This Thread
Giftbox issue - by K9IsGodly - 13.03.2014, 20:43
Re: Giftbox issue - by Matess - 13.03.2014, 20:47
Re: Giftbox issue - by K9IsGodly - 13.03.2014, 21:07
Re: Giftbox issue - by Matess - 13.03.2014, 21:11
Re: Giftbox issue - by K9IsGodly - 13.03.2014, 21:17
Re: Giftbox issue - by Matess - 13.03.2014, 21:17
Re: Giftbox issue - by K9IsGodly - 13.03.2014, 21:19
Re: Giftbox issue - by K9IsGodly - 13.03.2014, 21:25
Re: Giftbox issue - by Matess - 13.03.2014, 21:25
Re: Giftbox issue - by K9IsGodly - 13.03.2014, 21:43

Forum Jump:


Users browsing this thread: 1 Guest(s)