[Help] Not working 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] Not working objects (
/showthread.php?tid=510386)
[Help] Not working objects -
ShoortyFl - 30.04.2014
So, recently i've created system for some job, now the problem is that timer function is not working !
I've put it like this:
Код:
public PsenicaTimer(playerid)
{
new Float:Pos[3];
if(GetVehicleModel(GetClosestVehicle(playerid)) == 532 )
{
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]))
{
MoveDynamicObject(farmerobjekt[playerid][id], Pos[0], Pos[1], Pos[2]-3, 2, 0.00000000,0.00000000,0.00000000);
}
if(kreiranihobjekata[playerid] == 10)
{
PreradjujeSeme[playerid] = 0;
SemePreradjeno[playerid] = 1;
}
}
}
return 1;
}
and when i go trought the object, everything works, but now this function can't be executed:
Код:
if(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]))
{
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] --;
}
if(kreiranihobjekata[playerid] == 0)
{
KillTimer(FarmerTimer[playerid]);
}
else return SCM(playerid, TOMATO, " (greska) Ne nalazite se blizu vaseg useva !");
}
}
but without going trought the object function actually works.