Object not removing
#3

PHP код:
//TOP OF SCRIPT
new meatbag[MAX_PLAYERS];
//====================
CMD:meatbag(playeridparams[])
{
    new 
option[15];
    new 
string[60];
    
    static
     
Float:x,
      
Float:y,
       
Float:z;
    if(
sscanf(params"s[10]"option)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /(m)eat(b)ag [drop | pickup]");
    if(!
strcmp(option"drop"true))
    {
        if(
cargopicked[playerid] == 1)
        {
            
/*static
            Float:x,
            Float:y,
            Float:z;*/
            
GetPlayerPos(playeridxyz);
            
meatbag[playerid] = CreateObject(2060,x+3,y,z0.00000.00000.0000);
            
format(stringsizeof(string), "* %s drops the meat bag on the ground."ReturnName(playerid0));
            
SetPlayerChatBubble(playeridstringCOLOR_PURPLE30.010000);
            
SendClientMessageEx(playeridCOLOR_PURPLE"* %s drops the meat bag on the ground."ReturnName(playerid0));
            
cargopicked[playerid] = 0;
            
ClearAnimations(playerid1);
            
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_NONE);
            
RemovePlayerAttachedObject(playerid0);
        }
        else
        {
            
SCM(playeridCOLOR_GREY"You are not holding anything.");
        }
    }
    if(!
strcmp(option"pickup"true))
    {
        if(
IsPlayerInRangeOfPoint(playerid3x+3yz))
        {
            
SetPlayerAttachedObject(playerid0206010.00000.32400.00000.000082.30000.00000.66900.68090.72400xFFFFFFFF0xFFFFFFFF);
            
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_CARRY);
            
cargopicked[playerid] = 1;
            
format(stringsizeof(string), "* %s picks the meat bag from the ground."ReturnName(playerid0));
            
SetPlayerChatBubble(playeridstringCOLOR_PURPLE30.010000);
            
SendClientMessageEx(playeridCOLOR_PURPLE"* %s picks the meat bag from the ground."ReturnName(playerid0));
            
DestroyObject(meatbag[playerid]);
        }
        else return 
SCM(playeridCOLOR_GREY"You are not near any meat bags.");
    }
    return 
1;

Reply


Messages In This Thread
Object not removing - by AndreiWow - 30.08.2016, 21:12
Re: Object not removing - by AndreiWow - 30.08.2016, 22:18
Re: Object not removing - by Shinja - 30.08.2016, 23:46

Forum Jump:


Users browsing this thread: 1 Guest(s)