Problem with checkpoints and CreateObject
#1

pawn Код:
if(GetPVarInt(playerid, "Farming") == 2) {
        farmerCrop[0] = CreateObject(872, -1190.1591, -1058.8303, 128.0696, 0, 0, 0);
        TogglePlayerControllable(playerid, 1);
        SetPVarInt(playerid, "Farming", 3);
        SetPlayerCheckpoint(playerid, -1164.7809, -1059.2003, 129.2188, 4.0);
        GameTextForPlayer(playerid, "~g~+$10", 1000, 1);
        GivePlayerCash(playerid, 10);
    }
    else if(GetPVarInt(playerid, "Farming") == 3) {
        farmerCrop[1] = CreateObject(872, -1164.7809, -1059.2003, 128.0696, 0, 0, 0);
        TogglePlayerControllable(playerid, 1);
        SetPVarInt(playerid, "Farming", 4);
        SetPlayerCheckpoint(playerid, -1173.5958, -1032.9147, 129.2188, 4.0);
        GameTextForPlayer(playerid, "~g~+$10", 1000, 1);
        GivePlayerCash(playerid, 10);
    }
    else if(GetPVarInt(playerid, "Farming") == 4) {
        farmerCrop[2] = CreateObject(872, -1173.5958, -1032.9147, 128.0696, 0, 0, 0);
        TogglePlayerControllable(playerid, 1);
        SetPVarInt(playerid, "Farming", 5);
        SetPlayerCheckpoint(playerid, -1150.0453, -1029.7294, 128.0188, 4.0);
        GameTextForPlayer(playerid, "~g~+$10", 1000, 1);
        GivePlayerCash(playerid, 10);
    }
    else if(GetPVarInt(playerid, "Farming") == 5) {
        farmerCrop[3] = CreateObject(872, -1150.0453, -1029.7294, 128.0188, 0, 0, 0); // THIS ONE HERE
        TogglePlayerControllable(playerid, 1);
        SetPVarInt(playerid, "Farming", 6);
        SetPlayerCheckpoint(playerid, -1115.7924, -1036.8137, 129.2188, 4.0); // IT CREATES IT AT THAT LOCATION
        GameTextForPlayer(playerid, "~g~+$10", 1000, 1);
        GivePlayerCash(playerid, 10);
    }
    else if(GetPVarInt(playerid, "Farming") == 6) {
        farmerCrop[4] = CreateObject(872, -1115.7924, -1036.8137, 129.2188, 0, 0, 0);
        TogglePlayerControllable(playerid, 1);
        SetPVarInt(playerid, "Farming", 7);
        SetPlayerCheckpoint(playerid, -1113.9963, -1014.8454, 129.2188, 4.0);
        GameTextForPlayer(playerid, "~g~+$10", 1000, 1);
        GivePlayerCash(playerid, 10);
    }
Is my code, when they enter '-1150.0453, -1029.7294, 128.0188' checkpoint, it doesn't create the object at that co-ordinates, it creates it at the next checkpoint, any help on this?

I cannot get around it, it does it for the rest after that, but the first 3 createobjects are fine!
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)