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; }
public OnPlayerEnterCheckpoint(playerid)
if(Activejob[playerid] == 1)
{
...
Activejob[playerid] = 2;
...
}
if(Activejob[playerid] == 2)
...
You should process like this.
There a way more easy to do. Add a variable in your like ActiveJob[playerid] = 1; when you do the command. Use PHP код:
|
if(IsPlayerInRangeOfPoint(playerid, 3.0, -2541.7466, 896.7819, 64.9844) && raznesipostu1[playerid] == 7 && IsPlayerInVehicle(playerid, pv1) || IsPlayerInVehicle(playerid, pv2) || IsPlayerInVehicle(playerid, pv3) || IsPlayerInVehicle(playerid, pv4) || IsPlayerInVehicle(playerid, pv5)) { raznesipostu1[playerid] = 8; SetPlayerCheckpoint(playerid, -2467.7964,797.8687,35.1719, 3.0); }
public OnPlayerEnterCheckpoint(playerid) { 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; }
public OnPlayerEnterCheckpoint(playerid)
{
DisablePlayerCheckpoint(playerid);
if(IsPlayerInVehicle(playerid,pv6) || IsPlayerInVehicle(playerid,pv7))
{
switch(pokupipostu[playerid])
{
case 1:{
if(!IsPlayerInRangeOfPoint(playerid, 3.0, -2358.3467,803.3227,38.3803))return 1;
pokupipostu[playerid] = 2;
SetPlayerCheckpoint(playerid, -2224.3804,804.1550,49.2969, 3.0);
return 1;
}
case 2:{
if(!IsPlayerInRangeOfPoint(playerid, 3.0, -2224.3804,804.1550,49.2969))return 1;
pokupipostu[playerid] = 3;
SetPlayerCheckpoint(playerid, -2151.5386,786.5508,69.4141, 3.0);
return 1;
}
case 3:{
if(!IsPlayerInRangeOfPoint(playerid, 3.0, -2151.5386,786.5508,69.4141))return 1;
pokupipostu[playerid] = 4;
SetPlayerCheckpoint(playerid, -2151.6677,644.7795,52.3672, 3.0);
return 1;
}
case 4:{
if(!IsPlayerInRangeOfPoint(playerid, 3.0, -2151.6677,644.7795,52.3672))return 1;
pokupipostu[playerid] = 5;
SetPlayerCheckpoint(playerid, -2185.7598,573.2388,35.0156, 3.0);
return 1;
}
case 5:{
if(!IsPlayerInRangeOfPoint(playerid, 3.0, -2185.7598,573.2388,35.0156))return 1;
pokupipostu[playerid] = 6;
SetPlayerCheckpoint(playerid, -2246.9546,620.5477,45.3104, 3.0);
return 1;
}
case 6:{
if(!IsPlayerInRangeOfPoint(playerid, 3.0, -2246.9546,620.5477,45.3104))return 1;
pokupipostu[playerid] = 7;
SetPlayerCheckpoint(playerid, -2321.4087,674.2640,42.0596, 3.0);
return 1;
}
case 7:{
if(!IsPlayerInRangeOfPoint(playerid, 3.0, -2321.4087,674.2640,42.0596))return 1;
pokupipostu[playerid] = 8;
SetPlayerCheckpoint(playerid, -2468.9990,798.5485,35.1797, 3.0);
return 1;
}
case 8:{
if(!IsPlayerInRangeOfPoint(playerid, 3.0, -2468.9990,798.5485,35.1797))return 1;
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;
}
}
}
return 1;
}
if(!IsPlayerInRangeOfPoint(playerid, 3.0, -2151.5386,786.5508,69.4141))return 1;