Trying Checkpoints :)
#3

something like this i guess ?
pawn Код:
new money[MAX_PLAYERS];
new MoneyTimer[MAX_PLAYERS];

forward GiveMoney(playerid);
public GiveMoney(playerid)
{
    if(money[playerid]==0) return 0;
    GivePlayerMoney(playerid, 2500);
    SendClientMessage(playerid, -1, "You have earned 2500 cash!");
    DisablePlayerCheckpoint(playerid);
    //EnableMoney(playerid);/*use this to restart the checkpoint! after they have waited the 10sec*/
    return 1;
}
forward EnableMoney(playerid);
public EnableMoney(playerid)
{
    money[playerid]=0;
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 1958.3783, 1343.1572, 15.3746, 2.0);
    return 1;
}

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

public OnPlayerLeaveCheckpoint(playerid)
{
    SendClientMessage(playerid, -1, "You Left The Checkpoint!");
    money[playerid]=0;
    KillTimer(MoneyTimer[playerid]);
    EnableMoney(playerid);
    return 1;
}
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)