[Help] Objects
#1

So i've got a problem, i've created a function that will destroy an objest when player presses the LMB, it works but only on every second object, i mean, it shows the message on every object but every second is going to be destroyed.

Код:
		if(!IsPlayerInAnyVehicle(playerid) && SemePreradjeno[playerid] == 1)
		{
		    new Float:Pos[3], obj_slot = -1;
		    for(new id = 0; id < 10; id++)
		    {
		        GetDynamicObjectPos(farmerobjekt[playerid][id], Pos[0], Pos[1], Pos[2]);
		        if(IsPlayerInRangeOfPoint(playerid, 3.0, Pos[0], Pos[1], Pos[2]+3))
		        {
		            obj_slot = id;
		        }
		    }
		    if (obj_slot != -1)
		    {
		        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);
		        SCM(playerid, YELLOW, " (info) Uzeli ste preradjeno zito, odnesite ga u staju !");
		        DestroyDynamicObject(farmerobjekt[playerid][obj_slot]);
		        kreiranihobjekata[playerid] --;
		    }
		    else return SCM(playerid, TOMATO, " (greska) Ne nalazite se blizu vaseg useva !");
		}
	}
Reply
#2

anyone ?
Reply
#3

Bump
Reply
#4

obj_slot


it depends on wat slot the object it is in.
just go download a gamemode like lvcnr look at there objects cmd in game then copy it to yours
Reply
#5

Nah, its not a slot, its just a variable that will convert object id, but it doesn't work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)