attachedobject wont remove from player
#1

Код:
bagmoney = SetPlayerAttachedObject( i, 1, 1550, 1, 0.117696, -0.298594, -0.012395, 353.867675, 112.472045, 156.506286, 1.000000, 1.000000, 1.000000 ); // CJ_MONEY_BAG -
new bagmoney;
Код:
public OnPlayerSpawn(playerid)
{

if(IsPlayerAttachedObjectSlotUsed(playerid, 1)) RemovePlayerAttachedObject(playerid, bagmoney);
the problem is when i relog using sobit it wont remove object
i also puted in onplayerconnect and or player requestclass and even a command /remove but it the command remove randomly sometimes works and not
Код:
dcmd_remove(playerid,params[])
{
	#pragma unused params
	RemovePlayerAttachedObject(bagmoney,playerid);
when i put this code in on spawn player or connect or request it wont wrok too
Код:
RemovePlayerAttachedObject(bagmoney,playerid)
what is the problem ?
Reply
#2

You should remove it OnPlayerDisconnect(playerid) and also change the attach for

pawn Код:
bagmoney[playerid] = SetPlayerAttachedObject( i, 1, 1550, 1, 0.117696, -0.298594, -0.012395, 353.867675, 112.472045, 156.506286, 1.000000, 1.000000, 1.000000 ); // CJ_MONEY_BAG -
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)