30.08.2016, 23:46 
	
	
	PHP код:
//TOP OF SCRIPT
new meatbag[MAX_PLAYERS];
//====================
CMD:meatbag(playerid, params[])
{
    new option[15];
    new string[60];
    
    static
     Float:x,
      Float:y,
       Float:z;
    if(sscanf(params, "s[10]", option)) return SendClientMessage(playerid, COLOR_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(playerid, x, y, z);
            meatbag[playerid] = CreateObject(2060,x+3,y,z, 0.0000, 0.0000, 0.0000);
            format(string, sizeof(string), "* %s drops the meat bag on the ground.", ReturnName(playerid, 0));
            SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 30.0, 10000);
            SendClientMessageEx(playerid, COLOR_PURPLE, "* %s drops the meat bag on the ground.", ReturnName(playerid, 0));
            cargopicked[playerid] = 0;
            ClearAnimations(playerid, 1);
            SetPlayerSpecialAction(playerid,SPECIAL_ACTION_NONE);
            RemovePlayerAttachedObject(playerid, 0);
        }
        else
        {
            SCM(playerid, COLOR_GREY, "You are not holding anything.");
        }
    }
    if(!strcmp(option, "pickup", true))
    {
        if(IsPlayerInRangeOfPoint(playerid, 3, x+3, y, z))
        {
            SetPlayerAttachedObject(playerid, 0, 2060, 1, 0.0000, 0.3240, 0.0000, 0.0000, 82.3000, 0.0000, 0.6690, 0.6809, 0.7240, 0xFFFFFFFF, 0xFFFFFFFF);
            SetPlayerSpecialAction(playerid,SPECIAL_ACTION_CARRY);
            cargopicked[playerid] = 1;
            format(string, sizeof(string), "* %s picks the meat bag from the ground.", ReturnName(playerid, 0));
            SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 30.0, 10000);
            SendClientMessageEx(playerid, COLOR_PURPLE, "* %s picks the meat bag from the ground.", ReturnName(playerid, 0));
            DestroyObject(meatbag[playerid]);
        }
        else return SCM(playerid, COLOR_GREY, "You are not near any meat bags.");
    }
    return 1;
} 


