17.03.2013, 20:39
Then you can't use this code
You need to check if the player is still on the pickup.
What you can do, is the following
Then, under OnPlayerUpdate (not recommended, I suggest you set a timer to do this each 2 seconds or something), place this: IsonPickup[playerid] = 0;
The variable will be set to 1 as long as the player is on the pickup, as soon as he leaves it, the timer will set the variable to 0, which should end your robtimer.
Note, that this is only an idea, I have no idea how your robtimer and things are made, so try to get the idea I sketched above, so you can make it to your needs.
pawn Код:
public OnPlayerLeaveCheckpoint(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, -8.3713,-31.1897,3.9439))
{
if(RobbingMagasin247[playerid] >= 1)
{
SendClientMessage(playerid,COLOR_ERROR,"La tentative de vol a йchouйe. Vous кtes sorti du Checkpoint.");
RobbingMagasin247[playerid] =0;
return 1;
}
return 1;
}
What you can do, is the following
pawn Код:
public OnPlayerPickupPickup(playerid,pickupid)
{
if(pickupid == storepickup)//replace with the pickup id
{
IsonPickup[playerid] = 1;
}
}
//then in your rob timer add
if(IsonPickup[playerid] != 1) return
{
SendClientMessage(playerid,COLOR_ERROR,"La tentative de vol a йchouйe.
Vous кtes sorti du Checkpoint.");
RobbingMagasin247[playerid] =0;
}
The variable will be set to 1 as long as the player is on the pickup, as soon as he leaves it, the timer will set the variable to 0, which should end your robtimer.
Note, that this is only an idea, I have no idea how your robtimer and things are made, so try to get the idea I sketched above, so you can make it to your needs.