06.08.2018, 13:05
Hi guys! I tried to make a farmer job, but when i enter a checkpoint nothing happens.
Codes:
These are the codes(i have another codes below them).
Could you help me please?(I used this tutorial: https://www.youtube.com/watch?v=CTzYoMtUqWc)
Codes:
Код:
new FarmerCars[5]; new FarmerCP[MAX_PLAYERS]; At OnPlayerConnect(playerid) FarmerCP[playerid] = 0; At public OnPlayerEnterCheckpoint(playerid) if(FarmerCP[playerid] == 1) { DisablePlayerCheckpoint(playerid); FarmerCP[playerid] = 2; SetPlayerCheckpoint(playerid, -113.0628, 123.3756, 4.1399, 3.0); } else if(FarmerCP[playerid] == 2) { DisablePlayerCheckpoint(playerid); FarmerCP[playerid] = 3; SetPlayerCheckpoint(playerid, -106.8495, 144.7129, 4.1399, 3.0); } else if(FarmerCP[playerid] == 3) { DisablePlayerCheckpoint(playerid); FarmerCP[playerid] = 4; SetPlayerCheckpoint(playerid, -121.2858, 154.0076, 4.1399, 3.0); } else if(FarmerCP[playerid] == 4) { DisablePlayerCheckpoint(playerid); FarmerCP[playerid] = 5; SetPlayerCheckpoint(playerid, -128.7277, 132.1946, 4.1399, 3.0); } else if(FarmerCP[playerid] == 5) { DisablePlayerCheckpoint(playerid); FarmerCP[playerid] = 6; SetPlayerCheckpoint(playerid, -137.4122, 107.6167, 4.1399, 3.0); } else if(FarmerCP[playerid] == 6) { DisablePlayerCheckpoint(playerid); FarmerCP[playerid] = 7; SetPlayerCheckpoint(playerid, -158.0390, 110.7103, 4.1399, 3.0); } else if(FarmerCP[playerid] == 7) { DisablePlayerCheckpoint(playerid); FarmerCP[playerid] = 8; SetPlayerCheckpoint(playerid, -150.1971, 134.3430, 4.1399, 3.0); } else if(FarmerCP[playerid] == 8) { DisablePlayerCheckpoint(playerid); FarmerCP[playerid] = 9; SetPlayerCheckpoint(playerid, -142.0317, 158.0460, 7.3978, 3.0); } else if(FarmerCP[playerid] == 9) { DisablePlayerCheckpoint(playerid); FarmerCP[playerid] = 10; SetPlayerCheckpoint(playerid, -162.1988, 167.5285, 8.7845, 3.0); } else if(FarmerCP[playerid] == 10) { DisablePlayerCheckpoint(playerid); FarmerCP[playerid] = 11; SetPlayerCheckpoint(playerid, -170.5844, 144.3569, 5.9828, 3.0); } else if(FarmerCP[playerid] == 11) { DisablePlayerCheckpoint(playerid); FarmerCP[playerid] = 12; SetPlayerCheckpoint(playerid, -178.1332, 122.6578, 5.9828, 3.0); } else if(FarmerCP[playerid] == 12) { DisablePlayerCheckpoint(playerid); FarmerCP[playerid] = 13; SetPlayerCheckpoint(playerid, -196.8972, 130.0796, 5.1046, 3.0); } else if(FarmerCP[playerid] == 13) { DisablePlayerCheckpoint(playerid); FarmerCP[playerid] = 14; SetPlayerCheckpoint(playerid, -190.7050, 150.9116, 7.2901, 3.0); } else if(FarmerCP[playerid] == 14) { DisablePlayerCheckpoint(playerid); FarmerCP[playerid] = 15; SetPlayerCheckpoint(playerid, -183.4293, 170.1678, 9.8435, 3.0); } else if(FarmerCP[playerid] == 15) { DisablePlayerCheckpoint(playerid); FarmerCP[playerid] = 16; SetPlayerCheckpoint(playerid, -197.9584, 175.4385, 9.5182, 3.0); } else if(FarmerCP[playerid] == 16) { DisablePlayerCheckpoint(playerid); FarmerCP[playerid] = 17; SetPlayerCheckpoint(playerid, -212.5797, 145.6497, 4.8729, 3.0); } else if(FarmerCP[playerid] == 17) { DisablePlayerCheckpoint(playerid); FarmerCP[playerid] = 0; SetVehicleToRespawn(GetPlayerVehicleID(playerid)); new rand = 80 + random(20); new string[254]; format(string, sizeof(string), "Ai terminat de recoltat si ai primit $%d", rand); SendClientMessage(playerid, -1, string); GivePlayerMoney(playerid, rand); } at public OnPlayerStateChange(playerid, newstate, oldstate) { if(newstate == PLAYER_STATE_DRIVER) { new vehicleid = GetPlayerVehicleID(playerid); if(vehicleid == FarmerCars[0] || FarmerCars[1] || FarmerCars[2] || FarmerCars[3] || FarmerCars[4]) { FarmerCP[playerid] = 1; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -121.4122, 98.2748, 4.1399, 3.0); } parcurs[GetPlayerVehicleID(playerid)] = 0; } at public OnPlayerExitVehicle(playerid, vehicleid) { if(vehicleid == FarmerCars[0] || vehicleid == FarmerCars[1] || vehicleid == FarmerCars[2] || vehicleid == FarmerCars[3] || vehicleid == FarmerCars[4]) { DisablePlayerCheckpoint(playerid); FarmerCP[playerid] = 0; SetVehicleToRespawn(vehicleid); SendClientMessage(playerid, -1, "Jobul tau a esuat"); } at public OnGameModeInit() { FarmerCars[0] = CreateVehicle(531, -69.0045, 104.6856, 4.1399, 70.7400, -1, -1, 100); FarmerCars[1] = CreateVehicle(531, -78.5449, 73.8370, 4.1399, 70.7400, -1, -1, 100); FarmerCars[2] = CreateVehicle(531, -81.5622, 64.9746, 4.1399, 70.7400, -1, -1, 100); FarmerCars[3] = CreateVehicle(531, -94.3062, 40.7965, 4.1399, 70.7400, -1, -1, 100); FarmerCars[4] = CreateVehicle(531, -97.9146, 30.7870, 4.1399, 70.7400, -1, -1, 100);
Could you help me please?(I used this tutorial: https://www.youtube.com/watch?v=CTzYoMtUqWc)