[Help] Objects - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [Help] Objects (
/showthread.php?tid=510635)
[Help] Objects -
ShoortyFl - 01.05.2014
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 !");
}
}
Re: [Help] Objects -
ShoortyFl - 01.05.2014
anyone ?
Re: [Help] Objects -
ShoortyFl - 02.05.2014
Bump
Re: [Help] Objects -
EpicMan - 02.05.2014
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
Re: [Help] Objects -
ShoortyFl - 02.05.2014
Nah, its not a slot, its just a variable that will convert object id, but it doesn't work