29.10.2018, 22:21
Is this what you're looking for?
PHP Code:
#include <a_samp>
new bool:g_CPCheck1[MAX_PLAYERS];
new bool:g_CPCheck2[MAX_PLAYERS];
public OnPlayerSpawn(playerid)
{
SetPlayerCheckpoint(playerid, 2493.9133, -1682.3986, 13.3387, 3.0);/*XYZ Coords*/
g_CPCheck1[playerid] = true;
/*XYZ Coords*/
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
new money = GetPlayerMoney(playerid);
if(money < 300 && g_CPCheck2[playerid])
{
DisablePlayerCheckpoint(playerid);
return SendClientMessage(playerid, -1, "Failed");
}
if(money <= 0 && g_CPCheck1[playerid])
{
GivePlayerMoney(playerid, 300);
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 2483.9133, -1672.3986, 13.3387, 3.0);
SendClientMessage(playerid, -1, "Take $300, go to the next checkpoint.");
g_CPCheck2[playerid] = true;
g_CPCheck1[playerid] = false;
}
else
return SendClientMessage(playerid, -1, "You must have $0");
return 1;
}