Attach object
#1

So i want to make this. When player type /cmd object will be placed on him. After 10sec it will blow and object will dissapear. I have explosion and timer. I just don't know how to make this with object. Can someone help me
Reply
#2

Код:
new PlayerObjectTimer[MAX_PLAYERS];

OnPlayerDisconnect/OnPlayerConnect:
KillTimer(PlayerObjectTimer[playerid]);

to the end:
CMD:yourcmd(playerid,params[])
{
SetPlayerAttached(playerid, 0, modelid, bone, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fScaleX, Float:fScaleY, Float:fScaleZ);
PlayerObjectTimer[playerid] = SetTimerEx("ObjectDelete",10000,false,"i",playerid);
return 1;
}

forward ObjectDelete(playerid);
public ObjectDelete(playerid)
{
RemovePlayerAttachedObject(playerid, 0);
return KillTimer(PlayerObjectTimer[playerid]);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)