12.06.2013, 21:04
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;
}