Problem with object
#1

I have some problem when i try to make locker in front of players, the object created, but won't show up when players attempted robbery.
Here's the code :
Код:
COMMAND:rob(playerid, params[])
{
	if(GetDistanceToPoint(playerid, 2325.4512, -6.8572, 22.8317) < 2)
	{
		SetPlayerFacingAngle(playerid, 273.2785);
		ClearAnimations(playerid);
		ApplyAnimation(playerid,"ROB_BANK","CAT_Safe_Open", 4.1, 1, 0, 0, 0, 0, 1);
		SetPlayerAttachedObject(playerid, 0, 1550, 1, 0.158482, -0.203833, 0.000000, 167.302505, 79.854949, 342.084838, 1.000000, 1.000000, 1.000000);
		SetTimerEx("startRobbery", 2000, false, "d", playerid);
	}
}
Код:
public startRobbery(playerid)
{
	ClearAnimations(playerid);
	ApplyAnimation(playerid, "ROB_BANK", "CAT_Safe_Rob", 1, 1, 0, 0, 0, 0, 1);
	DestroyDynamicObject(lockerBank);
	lockerBank = CreateDynamicObject(1829, 2326.22119, -6.84190, 22.63459,   0.00000, 0.00000, -90.00000); // The code to make a locker object
	return 1;
}
The object created but it's invisible when the robbery animation running.
Please help me.
Reply
#2

I don't understand. Are you talking about player's object or CreateDynamicObject ? I can't see an error in your script.
Reply
#3

Yeah, the code worked for me, but the object that i created with "CreateDynamicObject" won't show up when the players attempted robbery.
Reply
#4

Try to update the streamer after CreateDynamicObject

Код:
public startRobbery(playerid)
{
	ClearAnimations(playerid);
	ApplyAnimation(playerid, "ROB_BANK", "CAT_Safe_Rob", 1, 1, 0, 0, 0, 0, 1);
	DestroyDynamicObject(lockerBank);
	lockerBank = CreateDynamicObject(1829, 2326.22119, -6.84190, 22.63459,   0.00000, 0.00000, -90.00000);
        Streamer_Update(playerid);
	return 1;
}
Reply
#5

So in this

Код:
public startRobbery(playerid)
{
	ClearAnimations(playerid);
	ApplyAnimation(playerid, "ROB_BANK", "CAT_Safe_Rob", 1, 1, 0, 0, 0, 0, 1);
	DestroyDynamicObject(lockerBank); // You delete the object before adding it again
	lockerBank = CreateDynamicObject(1829, 2326.22119, -6.84190, 22.63459,   0.00000, 0.00000, -90.00000); // The code to make a locker object
	return 1;
}
try adding this
Код:
DestroyDynamicObject(lockerBank);
When the robbery is over or when it failed
Reply
#6

Quote:
Originally Posted by FOTIS6
Посмотреть сообщение
Код:
Streamer_Update(playerid);
Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)