Edit Object BUG[DON'T UPDATE POS]
#1

Hello...when i edit a Attached Object an other player don't see the edited object..Other player see object at spawn position but me i see edited object..

Код:
public OnPlayerEditAttachedObject(playerid, response, index, modelid, boneid, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fScaleX, Float:fScaleY, Float:fScaleZ)
{
	if(GetIntVar(playerid, "EditingPolice") == 1)
	{
		if(response)
		{
			RemoveVar(playerid, "EditingPolice");
			RemovePlayerAttachedObject(playerid, index);
			SetPlayerAttachedObject(playerid, index, modelid, boneid, fOffsetX, fOffsetY, fOffsetZ, fRotX, fRotY, fRotZ, fScaleX, fScaleY, fScaleZ);
		}
		else
		{
			SetIntVar(playerid, "EditingPolice", 1);
			SCM(playerid, COLOR_WHITE, "Please press on the SAVE button to continue.");
			EditAttachedObject(playerid, index);
		}
	}
	if(GetIntVar(playerid, "EditingOwnedToy") == 1)
	{
		new i = GetIntVar(playerid, "ToySlotEditing");
		if(response)
		{
			PlayerToys[playerid][i][ptOffsetX] = fOffsetX;
			PlayerToys[playerid][i][ptOffsetY] = fOffsetY;
			PlayerToys[playerid][i][ptOffsetZ] = fOffsetZ;
			PlayerToys[playerid][i][ptRotX] = fRotX;
			PlayerToys[playerid][i][ptRotY] = fRotY;
			PlayerToys[playerid][i][ptRotZ] = fRotZ;
			PlayerToys[playerid][i][ptScaleX] = fScaleX;
			PlayerToys[playerid][i][ptScaleY] = fScaleY;
			PlayerToys[playerid][i][ptScaleZ] = fScaleZ;
			UpdatePlayerToy(playerid, i, fOffsetX, fOffsetY, fOffsetZ, fRotX, fRotY, fRotZ, fScaleX, fScaleY, fScaleZ);
			RemoveVar(playerid, "ToySlotEditing");
			RemoveVar(playerid, "EditingOwnedToy");
			RemovePlayerAttachedObject(playerid, i);
			SetPlayerAttachedObject(playerid, i, modelid, boneid, PlayerToys[playerid][i][ptOffsetX], PlayerToys[playerid][i][ptOffsetY], PlayerToys[playerid][i][ptOffsetZ], PlayerToys[playerid][i][ptRotX], PlayerToys[playerid][i][ptRotY], PlayerToys[playerid][i][ptRotZ], PlayerToys[playerid][i][ptScaleX], PlayerToys[playerid][i][ptScaleY], PlayerToys[playerid][i][ptScaleZ]);
		}
		else
		{
			RemovePlayerAttachedObject(playerid, i);
			SetPlayerAttachedObject(playerid, i, modelid, boneid, PlayerToys[playerid][i][ptOffsetX], PlayerToys[playerid][i][ptOffsetY], PlayerToys[playerid][i][ptOffsetZ], PlayerToys[playerid][i][ptRotX], PlayerToys[playerid][i][ptRotY], PlayerToys[playerid][i][ptRotZ], PlayerToys[playerid][i][ptScaleX], PlayerToys[playerid][i][ptScaleY], PlayerToys[playerid][i][ptScaleZ]);
			RemoveVar(playerid, "ToySlotEditing");
			RemoveVar(playerid, "EditingOwnedToy");
		}
	}
	if(GetIntVar(playerid, "JustBoughtToy") == 1)
	{
		new i = GetIntVar(playerid, "ToySlotEditing");
		if(response)
		{
			RemovePlayerAttachedObject(playerid, i);
			PlayerToys[playerid][i][ptOffsetX] = fOffsetX;
			PlayerToys[playerid][i][ptOffsetY] = fOffsetY;
			PlayerToys[playerid][i][ptOffsetZ] = fOffsetZ;
			PlayerToys[playerid][i][ptRotX] = fRotX;
			PlayerToys[playerid][i][ptRotY] = fRotY;
			PlayerToys[playerid][i][ptRotZ] = fRotZ;
			PlayerToys[playerid][i][ptScaleX] = fScaleX;
			PlayerToys[playerid][i][ptScaleY] = fScaleY;
			PlayerToys[playerid][i][ptScaleZ] = fScaleZ;
			UpdatePlayerToy(playerid, i, fOffsetX, fOffsetY, fOffsetZ, fRotX, fRotY, fRotZ, fScaleX, fScaleY, fScaleZ);
			SetPlayerAttachedObject(playerid, i, modelid, boneid, PlayerToys[playerid][i][ptOffsetX], PlayerToys[playerid][i][ptOffsetY], PlayerToys[playerid][i][ptOffsetZ], PlayerToys[playerid][i][ptRotX], PlayerToys[playerid][i][ptRotY], PlayerToys[playerid][i][ptRotZ], PlayerToys[playerid][i][ptScaleX], PlayerToys[playerid][i][ptScaleY], PlayerToys[playerid][i][ptScaleZ]);
			RemoveVar(playerid, "ToyModelBuying");
			RemoveVar(playerid, "ToyBoneBuying");
			RemoveVar(playerid, "ToyPriceBuying");
			RemoveVar(playerid, "ToyNameBuying");
			RemoveVar(playerid, "ToySlotEditing");
			RemoveVar(playerid, "JustBoughtToy");
		}
		else
		{
			RemovePlayerToyFromSlot(playerid, i);
			format(msg, sizeof(msg), "You have canceled the item buying, and got your ${00FF40}%d {FFFFFF}back.", GetIntVar(playerid, "ToyPriceBuying"));
			SCM(playerid, -1, msg);
			GiveCash(playerid, GetIntVar(playerid, "ToyPriceBuying"));
			RemovePlayerAttachedObject(playerid, i);
			RemoveVar(playerid, "ToyModelBuying");
			RemoveVar(playerid, "ToyBoneBuying");
			RemoveVar(playerid, "ToyPriceBuying");
			RemoveVar(playerid, "ToyNameBuying");
			RemoveVar(playerid, "ToySlotEditing");
			RemoveVar(playerid, "JustBoughtToy");
		}
	}
    return 1;
}
Reply
#2

Anyone ?
Reply
#3

UP !!!!
Reply
#4

show me your attach lines
Reply
#5

Код:
Dialog:LSPDClothes(playerid, response, listitem, inputtext[])
{
	if(response)
	{
		switch(listitem)
		{
			case 0:
			{
				if(HasAttachedObject(playerid, 18636)) return SCM(playerid, COLOR_GREY, "Deja ai aceasta palarie.");
				for(new i = 0; i < MAX_PLAYER_ATTACHED_OBJECTS; i++)
				{
					if(!IsPlayerAttachedObjectSlotUsed(playerid, i))
					{
						SetPlayerAttachedObject(playerid, i, 18636, 2, 0.152, 0.0, -0.01, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0,  0xFFFFFFFF);
						EditAttachedObject(playerid, i);
						PoliceObjects[playerid][i] = 18636;
						SetIntVar(playerid, "EditingPolice", 1);
						return 1;
					}
				}
			}
			case 1:
			{
				if(HasAttachedObject(playerid, 19099)) return SCM(playerid, COLOR_GREY, "Deja ai aceasta palarie.");
				for(new i = 0; i < MAX_PLAYER_ATTACHED_OBJECTS; i++)
				{
					if(!IsPlayerAttachedObjectSlotUsed(playerid, i))
					{
						SetPlayerAttachedObject(playerid, i, 19099, 2, 0.152, 0.0, -0.01, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0,  0xFFFFFFFF);
						EditAttachedObject(playerid, i);
						PoliceObjects[playerid][i] = 19099;
						SetIntVar(playerid, "EditingPolice", 1);
						return 1;
					}
				}
			}
			case 2:
			{
				if(HasAttachedObject(playerid, 19100)) return SCM(playerid, COLOR_GREY, "Deja ai aceasta palarie.");
				for(new i = 0; i < MAX_PLAYER_ATTACHED_OBJECTS; i++)
				{
					if(!IsPlayerAttachedObjectSlotUsed(playerid, i))
					{
						SetPlayerAttachedObject(playerid, i, 19100, 2, 0.152, 0.0, -0.01, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0,  0xFFFFFFFF);
						EditAttachedObject(playerid, i);
						PoliceObjects[playerid][i] = 19100;
						SetIntVar(playerid, "EditingPolice", 1);
						return 1;
					}
				}
			}
			case 3:
			{
				if(HasAttachedObject(playerid, 19161)) return SCM(playerid, COLOR_GREY, "Deja ai aceasta palarie.");
				for(new i = 0; i < MAX_PLAYER_ATTACHED_OBJECTS; i++)
				{
					if(!IsPlayerAttachedObjectSlotUsed(playerid, i))
					{
						SetPlayerAttachedObject(playerid, i, 19161, 2, 0.152, 0.0, -0.01, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0,  0xFFFFFFFF);
						EditAttachedObject(playerid, i);
						PoliceObjects[playerid][i] = 19161;
						SetIntVar(playerid, "EditingPolice", 1);
						return 1;
					}
				}
			}
			case 4:
			{
				if(HasAttachedObject(playerid, 19162)) return SCM(playerid, COLOR_GREY, "Deja ai aceasta palarie.");
				for(new i = 0; i < MAX_PLAYER_ATTACHED_OBJECTS; i++)
				{
					if(!IsPlayerAttachedObjectSlotUsed(playerid, i))
					{
						SetPlayerAttachedObject(playerid, i, 19162, 2, 0.152, 0.0, -0.01, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0,  0xFFFFFFFF);
						EditAttachedObject(playerid, i);
						PoliceObjects[playerid][i] = 19162;
						SetIntVar(playerid, "EditingPolice", 1);
						return 1;
					}
				}
			}
			case 5:
			{
				if(HasAttachedObject(playerid, 19521)) return SCM(playerid, COLOR_GREY, "Deja ai aceasta palarie.");
				for(new i = 0; i < MAX_PLAYER_ATTACHED_OBJECTS; i++)
				{
					if(!IsPlayerAttachedObjectSlotUsed(playerid, i))
					{
						SetPlayerAttachedObject(playerid, i, 19521, 2, 0.152, 0.0, -0.01, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0,  0xFFFFFFFF);
						EditAttachedObject(playerid, i);
						PoliceObjects[playerid][i] = 19521;
						SetIntVar(playerid, "EditingPolice", 1);
						return 1;
					}
				}
			}
			case 6:
			{
				if(HasAttachedObject(playerid, 19200)) return SCM(playerid, COLOR_GREY, "Deja ai aceasta palarie.");
				for(new i = 0; i < MAX_PLAYER_ATTACHED_OBJECTS; i++)
				{
					if(!IsPlayerAttachedObjectSlotUsed(playerid, i))
					{
						SetPlayerAttachedObject(playerid, i, 19200, 2, 0.152, 0.0, -0.01, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0,  0xFFFFFFFF);
						EditAttachedObject(playerid, i);
						PoliceObjects[playerid][i] = 19200;
						SetIntVar(playerid, "EditingPolice", 1);
						return 1;
					}
				}
			}
			case 7:
			{
				if(HasAttachedObject(playerid, 18637)) return SCM(playerid, COLOR_GREY, "Deja ai aceasta palarie.");
				for(new i = 0; i < MAX_PLAYER_ATTACHED_OBJECTS; i++)
				{
					if(!IsPlayerAttachedObjectSlotUsed(playerid, i))
					{
						SetPlayerAttachedObject(playerid, i, 18637, 6, 0.071999, 0.02, 0.0, 0.0, 0.0, 0.0, 0.881, 1.0, 0.719999);
						EditAttachedObject(playerid, i);
						PoliceObjects[playerid][i] = 18637;
						SetIntVar(playerid, "EditingPolice", 1);
						return 1;
					}
				}
			}
			case 8:
			{
				for(new i = 0; i < MAX_PLAYER_ATTACHED_OBJECTS; i++)
				{
					if(IsPlayerAttachedObjectSlotUsed(playerid, i) && PlayerToys[playerid][i][ptToyOn] == 0)
					{
						RemovePlayerAttachedObject(playerid, i);
						PoliceObjects[playerid][i] = INVALID_OBJECT_ID;
					}
				}
			}
		}
	}
	return 1;
}
Reply
#6

PHP код:
                 if(!IsPlayerAttachedObjectSlotUsed(playeridi))
                    {
                        
PoliceObjects[playerid][i] = 18636;
                        
SetPlayerAttachedObject(playeridiPoliceObjects[playerid][i], 20.1520.0, -0.010.00.00.01.01.01.0,  0xFFFFFFFF);
                        
EditAttachedObject(playeridi);
                        
SetIntVar(playerid"EditingPolice"1);
                        return 
1;
                    } 
i haven't any idea how to fix that but try this you must edit the others
Reply
#7

Don't work..

Me, i see the edited object but other don't see object..They see spawned object position not edited object position..
EditObject work only for me..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)