03.07.2016, 14:21
When i start a job (go through checkpoints for money) and quit while it is active, then when i reconnect and i start the job again, i go through the first marker and get payed (I'm supposed to go through like 8, not 1). Then again i start the job, it still gives the money on the first checkpoint.
Defining the checkpoint checker (If a player goes through the first checkpoint, pokupipostu[playerid] = 2;)
When the player connects, pokupipostu[playerid] = 0;
When the player disconnects, pokupipostu[playerid] = 0;
If a player is in range of a checkpoint, pokupipostu[playerid] = some number;
Command to start the job (first checks if the player has a job as 'POSTAR' in my language, then does the command).
Defining the checkpoint checker (If a player goes through the first checkpoint, pokupipostu[playerid] = 2;)
Код:
new pokupipostu[MAX_PLAYERS];
Код:
public OnPlayerConnect(playerid) { pokupipostu[playerid] = 0; return 1; }
Код:
public OnPlayerDisconnect(playerid) { pokupipostu[playerid] = 0; return 1; }
Код:
if(IsPlayerInRangeOfPoint(playerid, 3.0, -2358.3467,803.3227,38.3803) && pokupipostu[playerid] == 1 && IsPlayerInVehicle(playerid, pv6) || IsPlayerInVehicle(playerid, pv7)) { pokupipostu[playerid] = 2; SetPlayerCheckpoint(playerid, -2224.3804,804.1550,49.2969, 3.0); } if(IsPlayerInRangeOfPoint(playerid, 3.0, -2224.3804,804.1550,49.2969) && pokupipostu[playerid] == 2 && IsPlayerInVehicle(playerid, pv6) || IsPlayerInVehicle(playerid, pv7)) { pokupipostu[playerid] = 3; SetPlayerCheckpoint(playerid, -2151.5386,786.5508,69.4141, 3.0); } if(IsPlayerInRangeOfPoint(playerid, 3.0, -2151.5386,786.5508,69.4141) && pokupipostu[playerid] == 3 && IsPlayerInVehicle(playerid, pv6) || IsPlayerInVehicle(playerid, pv7)) { pokupipostu[playerid] = 4; SetPlayerCheckpoint(playerid, -2151.6677,644.7795,52.3672, 3.0); } if(IsPlayerInRangeOfPoint(playerid, 3.0, -2151.6677,644.7795,52.3672) && pokupipostu[playerid] == 4 && IsPlayerInVehicle(playerid, pv6) || IsPlayerInVehicle(playerid, pv7)) { pokupipostu[playerid] = 5; SetPlayerCheckpoint(playerid, -2185.7598,573.2388,35.0156, 3.0); } if(IsPlayerInRangeOfPoint(playerid, 3.0, -2185.7598,573.2388,35.0156) && pokupipostu[playerid] == 5 && IsPlayerInVehicle(playerid, pv6) || IsPlayerInVehicle(playerid, pv7)) { pokupipostu[playerid] = 6; SetPlayerCheckpoint(playerid, -2246.9546,620.5477,45.3104, 3.0); } if(IsPlayerInRangeOfPoint(playerid, 3.0, -2246.9546,620.5477,45.3104) && pokupipostu[playerid] == 6 && IsPlayerInVehicle(playerid, pv6) || IsPlayerInVehicle(playerid, pv7)) { pokupipostu[playerid] = 7; SetPlayerCheckpoint(playerid, -2321.4087,674.2640,42.0596, 3.0); } if(IsPlayerInRangeOfPoint(playerid, 3.0, -2321.4087,674.2640,42.0596) && pokupipostu[playerid] == 7 && IsPlayerInVehicle(playerid, pv6) || IsPlayerInVehicle(playerid, pv7)) { pokupipostu[playerid] = 8; SetPlayerCheckpoint(playerid, -2468.9990,798.5485,35.1797, 3.0); } if(IsPlayerInRangeOfPoint(playerid, 3.0, -2468.9990,798.5485,35.1797) && pokupipostu[playerid] == 8 && IsPlayerInVehicle(playerid, pv6) || IsPlayerInVehicle(playerid, pv7)) { pokupipostu[playerid] = 0; SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[IN:RP] {FFFFFF}Uspesno ste pokupili postu, pa ste dobili $100 i 1 EXP."); PlayerInfo[playerid][pExp] += 1; GivePlayerMoney(playerid, 100); DisablePlayerCheckpoint(playerid); } return 1; }
Код:
CMD:pokupipostu(playerid, params[]) { if(PlayerInfo[playerid][pPosao] == 1) { SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[IN:RP] {FFFFFF}Uspesno ste poceli da pokupljate postu."); SetPlayerCheckpoint(playerid, -2358.3467, 803.3227, 38.3803, 3.0); pokupipostu[playerid] = 1; } else { SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}ERROR: {FFFFFF}Morate biti zaposleni kao POSTAR!"); } return 1; }