Pickup
#1

Hey , today i was wondering how to make something like if somebody enter a pickup to rob or to get something to have to wait 10 maybe 20 seconds and if he leave pickup nothing happens.
I mean to make something work if they stay 10 seconds in the pickup.

So ...how to do it ?
Give me a simple example , i will understand .
Reply
#2

pawn Код:
new RobTime[MAX_PLAYERS];
OnGameModeInit
pawn Код:
SetTimer("RobTimer", 1000, true);
pawn Код:
public RobTimer()
{
    for(new i=0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(IsPlayerInRangeOfPoint(i, 2.0, /*pickup coords*/))
            {
                RobTime[i]++;
                if(RobTime[i] == 10)
                {
                    // 10 seconds passed
                }
            }
            else
            {
                RobTime[i] = 0;
            }
        }
    }
}
Reply
#3

Ooo , thanks man...really love you.
( I'm not gay )
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)