04.05.2014, 12:09
I think that the problem is in this
pawn Код:
if(!IsPlayerInAnyVehicle(playerid) && FarmerPosejano[playerid] == 1) // Checking on Variables
{
new Float:Pos[3], Farmer_Slot = -1; // Farmer_Slot is slot that will convert ID to it.
for(new id = 0; id < 11; id++) // loop
{
GetDynamicObjectPos(FarmerObjekt[playerid][id], Pos[0], Pos[1], Pos[2]); // Getting the position of the object
if(IsPlayerInRangeOfPoint(playerid, 2.0, Pos[0], Pos[1], Pos[2]+3)) // Checking if the player is in the range of the point
{
Farmer_Slot = id; // Converting id to Farmer Slot
}
}
if(Farmer_Slot != -1) // If farmer slot is not negative command will execute
{
if(UzeoUsev[playerid] == 1) return SCM(playerid, TOMATO, " (greska) Vec ste pokupili jedan usev, odnesite ga u staju !"); // If the function has already been used
SetPlayerAttachedObject(playerid, 0, 2901, 1, -0.022000, -0.212999, -0.007000, 0.000000, -2.099999, -2.599998, 0.612999, 0.439000, 0.607999, 0, 0); // attaching object
SCM(playerid, YELLOW, " (info) Uspesno ste uzeli usev, odnesite ga u staju !"); // Shows the message if the command is sucessfully executed
UzeoUsev[playerid] = 1; // Sets variable to 1 for something other
DestroyDynamicObject(FarmerObjekt[playerid][Farmer_Slot]); // Destroyin the Object
}
}
}