CMD:vobj(playerid,params[])
{
SendClientMessage(playerid,0xFFF000AA,"Was Set!");
SetPlayerAttachedObject(playerid, 1, 18694, 10, -0.390999, -0.387000, -1.716001, -26.399991, -4.099966, -166.099929);
}
RemovePlayerAttachedObject(playerid, 1);
return 1;
}
static bool:attached[MAX_PLAYERS] = {false, ...};
public OnPlayerDisconnect(playerid)
{
attached[playerid] = false; //reset on disconnect
return 1;
}
CMD:vobj(playerid,params[])
{
if(!attached[playerid]) //if not attached
{
SendClientMessage(playerid,0xFFF000AA,"Was Set!");
SetPlayerAttachedObject(playerid, 1, 18694, 10, -0.390999, -0.387000, -1.716001, -26.399991, -4.099966, -166.099929);
attached[playerid] = true; ///set to true
}
else
{
RemovePlayerAttachedObject(playerid, 1);
attached[playerid] = false; //set to false
}
return 1;
}
PHP код:
|