16.12.2014, 04:08
That is because you lose your object reference!
What you need to do since you can rob multiple stores is create a clean up function and call it on a timer instead for instance.
Pretty simple to do here is some more ideas.
So I changed it to return the objectid that is created in the streamer so you can supply that return value in your timer. I am guessing that you would have another function that calls CreateLocker() so that is where you will want to initiate your timer to clean up.
What you need to do since you can rob multiple stores is create a clean up function and call it on a timer instead for instance.
pawn Код:
SetTimeEx("CleanupStore", 60000, false, "ii", storeid, objectid);
pawn Код:
CreateLocker(playerid)
{
new Locker = 1829;
new Float:pos[3];
new Float:Angle;
new pworld = GetPlayerVirtualWorld(playerid);
new pint = GetPlayerInterior(playerid);
GetPlayerFacingAngle(playerid, Angle);
GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
pos[0] += (1 * floatsin(-Angle, degrees));
pos[1] += (1 * floatcos(-Angle, degrees));
return CreateDynamicObject(Locker,pos[0],pos[1],pos[2],0,0,Angle,pworld,pint);
}