Help Me.
#1

I want to set object attach to player with a command and delete it with the same
What should I do?

PHP код:
CMD:vobj(playerid,params[])
{
    
SendClientMessage(playerid,0xFFF000AA,"Was Set!");
    
SetPlayerAttachedObject(playerid11869410, -0.390999, -0.387000, -1.716001, -26.399991, -4.099966, -166.099929);
    }
    
RemovePlayerAttachedObject(playerid1);
    return 
1;

Reply
#2

PHP код:
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(playerid11869410, -0.390999, -0.387000, -1.716001, -26.399991, -4.099966, -166.099929);
        
attached[playerid] = true///set to true
    
}
    else
    {
        
RemovePlayerAttachedObject(playerid1);
        
attached[playerid] = false//set to false
    
}
    return 
1;

Reply
#3

Quote:
Originally Posted by Lokii
Посмотреть сообщение
PHP код:
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(playerid11869410, -0.390999, -0.387000, -1.716001, -26.399991, -4.099966, -166.099929);
        
attached[playerid] = true///set to true
    
}
    else
    {
        
RemovePlayerAttachedObject(playerid1);
        
attached[playerid] = false//set to false
    
}
    return 
1;


Thank you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)