12.11.2013, 18:25
I work at a garbage man job and i set the checkpoints
For start you need to write /start, for stoping you need to write /stop
The racecheckponts was here:
my problem is when i reach first raecheckpoint, exactly this not disappear and the racecheckpoint was freeze.
The same system i use for bus driver and there works fine.
For start you need to write /start, for stoping you need to write /stop
Код:
public OnPlayerCommandText(playerid, cmdtext[]) { ... if (strcmp("/start", cmdtext, true, 10) == 0) { if (gunoicp[playerid] == 0) { if (GetPlayerState(playerid)==PLAYER_STATE_DRIVER && GetVehicleModel(GetPlayerVehicleID(playerid)) == 408 && PlayerInfo[playerid][pJob] == 2 && PlayerInfo[playerid][pCarLic] == 1) { SCM(playerid,COLOR_CRS3,"** Mergi la fiecare checkpoint ca sa colectezi gunoiul."); SetPlayerRaceCheckpoint(playerid, 0, 2117.547,-1779.123,13.947, 1851.122,-1863.614,14.127, 4.0); gunoicp[playerid] = 1; } } return 1; } if (strcmp("/stop", cmdtext, true, 10) == 0) { if (gunoicp[playerid] == 15) { if (GetPlayerState(playerid)==PLAYER_STATE_DRIVER && GetVehicleModel(GetPlayerVehicleID(playerid)) == 408 && PlayerInfo[playerid][pJob] == 2 && PlayerInfo[playerid][pCarLic] == 1) { DisablePlayerRaceCheckpoint(playerid); GivePlayerMoney(playerid, random(1000) + 1000); SCM(playerid,COLOR_CRS3,"** Gunoiul a fost deversat, daca mai vrei sa faci o tura scrie din nou /start."); gunoicp[playerid] = 0; } } return 1; } .... }
Код:
forward Continue(playerid,Float:x,Float:y,Float:z,Float:x2,Float:y2,Float:z2,cpbusnou); public nextcontainer(playerid,Float:x,Float:y,Float:z,Float:x2,Float:y2,Float:z2,ngunoicp) { if(IsPlayerInRangeOfPoint(playerid, 5.0, Float:x,Float:y,Float:z)) { GivePlayerMoney(playerid, random(1000) + 1000); DisablePlayerRaceCheckpoint(playerid); gunoicp[playerid] = ngunoicp; SCM(playerid, CRISTIAN, "** Mergi la urmatoarea locatie."); SetPlayerRaceCheckpoint(playerid, 0, Float:x,Float:y,Float:z,Float:x2,Float:y2,Float:z2, 4.0); return 1; } return 1; } public OnPlayerEnterRaceCheckpoint(playerid) { if(gunoicp[playerid]==1) { SCM(playerid, CRISTIAN, "** Trebuie sa astepti sa ridici gunoiul ca sa primesti bani."); new Float:x = 1851.122; new Float:y = -1863.614; new Float:z = 14.127; new Float:x2 = 1258.149; new Float:y2 = -1802.818; new Float:z2 = 13.987; new ngunoicp = 2; SetTimerEx("nextcontainer",4000,false,"iffffffi",playerid,Float:x,Float:y,Float:z,Float:x2,Float:y2,Float:z2,ngunoicp); } else if(gunoicp[playerid]==2) { SCM(playerid, CRISTIAN, "** Trebuie sa astepti sa ridici gunoiul ca sa primesti bani."); new Float:x = 1258.149; new Float:y = -1802.818; new Float:z = 13.987; new Float:x2 = 858.468; new Float:y2 = -1665.248; new Float:z2 = 14.095; new ngunoicp = 3; SetTimerEx("nextcontainer",4000,false,"iffffffi",playerid,Float:x,Float:y,Float:z,Float:x2,Float:y2,Float:z2,ngunoicp); } else if(gunoicp[playerid]==3) { SCM(playerid, CRISTIAN, "** Trebuie sa astepti sa ridici gunoiul ca sa primesti bani."); new Float:x = 858.468; new Float:y = -1665.248; new Float:z = 14.095; new Float:x2 = 358.098; new Float:y2 = -1782.932; new Float:z2 = 5.962; new ngunoicp = 4; SetTimerEx("nextcontainer",4000,false,"iffffffi",playerid,Float:x,Float:y,Float:z,Float:x2,Float:y2,Float:z2,ngunoicp); } else if(gunoicp[playerid]==4) { SCM(playerid, CRISTIAN, "** Trebuie sa astepti sa ridici gunoiul ca sa primesti bani."); new Float:x = 358.098; new Float:y = -1782.932; new Float:z = 5.962; new Float:x2 = 569.388; new Float:y2 = -1297.078; new Float:z2 = 17.790; new ngunoicp = 5; SetTimerEx("nextcontainer",4000,false,"iffffffi",playerid,Float:x,Float:y,Float:z,Float:x2,Float:y2,Float:z2,ngunoicp); } else if(gunoicp[playerid]==5) { SCM(playerid, CRISTIAN, "** Trebuie sa astepti sa ridici gunoiul ca sa primesti bani."); new Float:x = 569.388; new Float:y = -1297.078; new Float:z = 17.790; new Float:x2 = 850.428; new Float:y2 = -1067.341; new Float:z2 = 25.652; new ngunoicp = 6; SetTimerEx("nextcontainer",4000,false,"iffffffi",playerid,Float:x,Float:y,Float:z,Float:x2,Float:y2,Float:z2,ngunoicp); } else if(gunoicp[playerid]==6) { SCM(playerid, CRISTIAN, "** Trebuie sa astepti sa ridici gunoiul ca sa primesti bani."); new Float:x = 850.428; new Float:y = -1067.341; new Float:z = 25.652; new Float:x2 = 980.445; new Float:y2 = -896.147; new Float:z2 = 43.633; new ngunoicp = 7; SetTimerEx("nextcontainer",4000,false,"iffffffi",playerid,Float:x,Float:y,Float:z,Float:x2,Float:y2,Float:z2,ngunoicp); } else if(gunoicp[playerid]==7) { SCM(playerid, CRISTIAN, "** Trebuie sa astepti sa ridici gunoiul ca sa primesti bani."); new Float:x = 980.445; new Float:y = -896.147; new Float:z = 43.633; new Float:x2 = 1218.817; new Float:y2 = -877.788; new Float:z2 = 43.447; new ngunoicp = 8; SetTimerEx("nextcontainer",4000,false,"iffffffi",playerid,Float:x,Float:y,Float:z,Float:x2,Float:y2,Float:z2,ngunoicp); } else if(gunoicp[playerid]==8) { SCM(playerid, CRISTIAN, "** Trebuie sa astepti sa ridici gunoiul ca sa primesti bani."); new Float:x = 1218.817; new Float:y = -877.788; new Float:z = 43.447; new Float:x2 = 1527.906; new Float:y2 = -1020.283; new Float:z2 = 24.514; new ngunoicp = 9; SetTimerEx("nextcontainer",4000,false,"iffffffi",playerid,Float:x,Float:y,Float:z,Float:x2,Float:y2,Float:z2,ngunoicp); } else if(gunoicp[playerid]==9) { SCM(playerid, CRISTIAN, "** Trebuie sa astepti sa ridici gunoiul ca sa primesti bani."); new Float:x = 1527.906; new Float:y = -1020.283; new Float:z = 24.514; new Float:x2 = 1777.471; new Float:y2 = -1161.290; new Float:z2 = 24.375; new ngunoicp = 10; SetTimerEx("nextcontainer",4000,false,"iffffffi",playerid,Float:x,Float:y,Float:z,Float:x2,Float:y2,Float:z2,ngunoicp); } else if(gunoicp[playerid]==10) { SCM(playerid, CRISTIAN, "** Trebuie sa astepti sa ridici gunoiul ca sa primesti bani."); new Float:x = 1777.471; new Float:y = -1161.290; new Float:z = 24.375; new Float:x2 = 1868.589; new Float:y2 = -1395.636; new Float:z2 = 14.053; new ngunoicp = 11; SetTimerEx("nextcontainer",4000,false,"iffffffi",playerid,Float:x,Float:y,Float:z,Float:x2,Float:y2,Float:z2,ngunoicp); } else if(gunoicp[playerid]==11) { SCM(playerid, CRISTIAN, "** Trebuie sa astepti sa ridici gunoiul ca sa primesti bani."); new Float:x = 1868.589; new Float:y = -1395.636; new Float:z = 14.053; new Float:x2 = 1791.519; new Float:y2 = -1619.872; new Float:z2 = 14.079; new ngunoicp = 12; SetTimerEx("nextcontainer",4000,false,"iffffffi",playerid,Float:x,Float:y,Float:z,Float:x2,Float:y2,Float:z2,ngunoicp); } else if(gunoicp[playerid]==12) { SCM(playerid, CRISTIAN, "** Trebuie sa astepti sa ridici gunoiul ca sa primesti bani."); new Float:x = 1791.519; new Float:y = -1619.872; new Float:z = 14.079; new Float:x2 = 1568.616; new Float:y2 = -1609.358; new Float:z2 = 13.930; new ngunoicp = 13; SetTimerEx("nextcontainer",4000,false,"iffffffi",playerid,Float:x,Float:y,Float:z,Float:x2,Float:y2,Float:z2,ngunoicp); } else if(gunoicp[playerid]==13) { SCM(playerid, CRISTIAN, "** Trebuie sa astepti sa ridici gunoiul ca sa primesti bani."); new Float:x = 1568.616; new Float:y = -1609.358; new Float:z = 13.930; new Float:x2 = 2106.269; new Float:y2 = -2013.438; new Float:z2 = 14.105; new ngunoicp = 14; SetTimerEx("nextcontainer",4000,false,"iffffffi",playerid,Float:x,Float:y,Float:z,Float:x2,Float:y2,Float:z2,ngunoicp); } else if(gunoicp[playerid]==14) { SCM(playerid, CRISTIAN, "** Acum trebuie sa scrii /stop pentru a deversa gunoiul adunat."); gunoicp[playerid]=15; }
The same system i use for bus driver and there works fine.