Trying Checkpoints :)
#1

Hello!

So, I tried to make a checkpoint...Everything is working fine, but checkpoint doesn't want to show again after 5 seconds : (

Code:

pawn Код:
new money[MAX_PLAYERS];

forward GiveMoney(playerid);

public GiveMoney(playerid)
{
    GivePlayerMoney(playerid, 2500);
    SendClientMessage(playerid, -1, "You have earned 2500 cash!");
    DisablePlayerCheckpoint(playerid);
    return 1;
}
forward EnableMoney(playerid);

public EnableMoney(playerid)
{
    money[playerid] = SetPlayerCheckpoint(playerid, 1958.3783, 1343.1572, 15.3746, 2.0);
    return 1;
}

public OnPlayerSpawn(playerid)
{
    money[playerid] = SetPlayerCheckpoint(playerid, 1958.3783, 1343.1572, 15.3746, 2.0);
    return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
    if(money[playerid])
    {
      SendClientMessage(playerid, -1, "Stay in Checkpoint for 10 seconds!");
      SetTimerEx("GiveMoney", 10000, false, "i", playerid);
    }
    return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
    SetTimerEx("EnableMoney", 5000, false, "i", playerid);
    return 1;
}
Thanks for help
Reply


Messages In This Thread
Trying Checkpoints :) - by Areax - 12.06.2013, 19:45
Re: Trying Checkpoints :) - by OrMisicL - 12.06.2013, 20:52
Re: Trying Checkpoints :) - by park4bmx - 12.06.2013, 21:04

Forum Jump:


Users browsing this thread: 1 Guest(s)