19.03.2013, 10:51
Код:
public OnPlayerEnterCheckpoint(playerid) { if(FarmerVar[playerid] == 1) { if (IsPlayerInAnyVehicle(playerid)) { new carid = GetPlayerVehicleID(playerid); new cash=(random(550-150)+50); if(Harvestcars(carid)) { switch(FarmerPickup[playerid][0]) { case 0: { SetPlayerCheckpoint(playerid, 961.6472,-328.4826,63.6927, 5.0); if(JustStarted[playerid] != 0) { JustStarted[playerid] = 0; } } case 1: { SetPlayerCheckpoint(playerid, 1019.8516,-318.3922,73.5071, 5.0); if(JustStarted[playerid] != 0) { JustStarted[playerid] = 0; } } case 2: { if(JustStarted[playerid] != 1) { SafeGivePlayerMoney(playerid, cash); format(string, sizeof(string), "~w~Added to your pay~n~~g~$%d",cash); GameTextForPlayer(playerid, string, 5000, 1); } else { JustStarted[playerid] = 0; } SetPlayerCheckpoint(playerid, 870.9973,-292.5718,30.4907, 5.0); } case 3: { SetPlayerCheckpoint(playerid, 1019.8516,-318.3922,73.5071, 5.0); if(JustStarted[playerid] != 0) { JustStarted[playerid] = 0; } } case 4: { if(JustStarted[playerid] != 1) { SafeGivePlayerMoney(playerid, cash); format(string, sizeof(string), "~w~Added to your pay~n~~g~$%d",cash); GameTextForPlayer(playerid, string, 5000, 1); } else { JustStarted[playerid] = 0; } SetPlayerCheckpoint(playerid, 847.2054,-259.1252,20.3124, 5.0); } case 5: { SetPlayerCheckpoint(playerid, 1019.8516,-318.3922,73.5071, 5.0); if(JustStarted[playerid] != 0) { JustStarted[playerid] = 0; } } case 6: { if(JustStarted[playerid] != 1) { SafeGivePlayerMoney(playerid, cash); format(string, sizeof(string), "~w~Added to your pay~n~~g~$%d",cash); GameTextForPlayer(playerid, string, 5000, 1); } else { JustStarted[playerid] = 0; } SetPlayerCheckpoint(playerid, 846.8538,-236.5611,19.6668, 5.0); } case 7: { SetPlayerCheckpoint(playerid, 1019.8516,-318.3922,73.5071, 5.0); if(JustStarted[playerid] != 0) { JustStarted[playerid] = 0; } } case 8: { if(JustStarted[playerid] != 1) { SafeGivePlayerMoney(playerid, cash); format(string, sizeof(string), "~w~Added to your pay~n~~g~$%d",cash); GameTextForPlayer(playerid, string, 5000, 1); } else { JustStarted[playerid] = 0; } SetPlayerCheckpoint(playerid, 817.0619,-258.6868,19.0548, 5.0); } case 9: { SetPlayerCheckpoint(playerid, 1019.8516,-318.3922,73.5071, 5.0); if(JustStarted[playerid] != 0) { JustStarted[playerid] = 0; } } case 10: { if(JustStarted[playerid] != 1) { SafeGivePlayerMoney(playerid, cash); format(string, sizeof(string), "~w~Added to your pay~n~~g~$%d",cash); GameTextForPlayer(playerid, string, 5000, 1); } else { JustStarted[playerid] = 0; } SetPlayerCheckpoint(playerid, 810.2362,-354.9428,22.9976, 5.0); } case 11: { SetPlayerCheckpoint(playerid, 1019.8516,-318.3922,73.5071, 5.0); if(JustStarted[playerid] != 0) { JustStarted[playerid] = 0; } } case 12: { if(JustStarted[playerid] != 1) { SafeGivePlayerMoney(playerid, cash); format(string, sizeof(string), "~w~Added to your pay~n~~g~$%d",cash); GameTextForPlayer(playerid, string, 5000, 1); } else { JustStarted[playerid] = 0; } SetPlayerCheckpoint(playerid, 837.2936,-381.2329,29.8975, 5.0); } case 13: { SetPlayerCheckpoint(playerid, 1019.8516,-318.3922,73.5071, 5.0); if(JustStarted[playerid] != 0) { JustStarted[playerid] = 0; } } case 14: { if(JustStarted[playerid] != 1) { SafeGivePlayerMoney(playerid, cash); format(string, sizeof(string), "~w~Added to your pay~n~~g~$%d",cash); GameTextForPlayer(playerid, string, 5000, 1); } else { JustStarted[playerid] = 0; } SetPlayerCheckpoint(playerid, 850.2153,-417.0349,32.7842, 5.0); } case 15: { SetPlayerCheckpoint(playerid, 1019.8516,-318.3922,73.5071, 5.0); if(JustStarted[playerid] != 0) { JustStarted[playerid] = 0; } } case 16: { if(JustStarted[playerid] != 1) { SafeGivePlayerMoney(playerid, cash); format(string, sizeof(string), "~w~Added to your pay~n~~g~$%d",cash); GameTextForPlayer(playerid, string, 5000, 1); } else { JustStarted[playerid] = 0; } SetPlayerCheckpoint(playerid, 941.0540,-432.7286,57.9490, 5.0); } case 17: { SetPlayerCheckpoint(playerid, 1019.8516,-318.3922,73.5071, 5.0); if(JustStarted[playerid] != 0) { JustStarted[playerid] = 0; } } case 18: { if(JustStarted[playerid] != 1) { SafeGivePlayerMoney(playerid, cash); format(string, sizeof(string), "~w~Added to your pay~n~~g~$%d",cash); GameTextForPlayer(playerid, string, 5000, 1); } else { JustStarted[playerid] = 0; } SetPlayerCheckpoint(playerid, 877.1450,-375.3396,40.3532, 5.0); } case 19: { SetPlayerCheckpoint(playerid, 1019.8516,-318.3922,73.5071, 5.0); if(JustStarted[playerid] != 0) { JustStarted[playerid] = 0; } } case 20: { if(JustStarted[playerid] != 1) { SafeGivePlayerMoney(playerid, cash); format(string, sizeof(string), "~w~Added to your pay~n~~g~$%d",cash); GameTextForPlayer(playerid, string, 5000, 1); } else { JustStarted[playerid] = 0; } SetPlayerCheckpoint(playerid, 938.8719,-364.1842,58.0818, 5.0); } case 21: { SetPlayerCheckpoint(playerid, 1019.8516,-318.3922,73.5071, 5.0); if(JustStarted[playerid] != 0) { JustStarted[playerid] = 0; } } case 22: { DisablePlayerCheckpoint(playerid); TogglePlayerControllable(playerid, 0); GameTextForPlayer(playerid, "~w~Use /exit to leave a harvest~n~~r~Bonus 300$ in cash", 5000, 1); SafeGivePlayerMoney(playerid, 300); } } FarmerPickup[playerid][0]++; PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0); } } }
help me please if you know