Another Item Label problem
#5

Hello!

Try this:
PHP код:
public OnPlayerPickupItem(playerid)
{
    new 
string[145],_itemid = -1;
    for(new 
i;i<MAX_ITEMS;i++)
    {
        if(
IsPlayerInRangeOfPoint(playerid,1.5,Item[i][ItemPosX],Item[i][ItemPosY],Item[i][ItemPosZ]))
        {
            if(
GetPlayerInterior(playerid) == Item[i][ItemInterior] && GetPlayerVirtualWorld(playerid) == Item[i][ItemVWorld])
            {
                
_itemid i;
                
Item[i][ItemPosX] = 0.0;
                
Item[i][ItemPosY] = 0.0;
                
Item[i][ItemPosZ] = 0.0;
                
Delete3DTextLabel(ItemLabel[i]);
                
DestroyObject(DropObject[i]);
                
ItemLabel[i] = 0;
                
DropObject[i] = 0;
                
LoadItemVisual();
                if(
Item[i][ItemModel] == 2806 && Item[i][ItemType] == 1)
                {
                    
Player[playerid][BrahminMeat] += Item[i][ItemAmount];
                    
format(string,sizeof string,"You have picked up 'Brahmin Meat'. Amount: %i",Item[i][ItemAmount]);
                    
SendClientMessage(playerid,COLOR_WHITE,string);
                    
format(string,sizeof string,"* %s has picked up something.",GetName(playerid));
                    
SetPlayerChatBubble(playerid,string,COLOR_LIGHTPURPLE,10,7000);
                    
SendClientMessage(playerid,COLOR_LIGHTPURPLE,string);
                    break;
                }
                else if(
Item[i][ItemModel] == 2806 && Item[i][ItemType] == 2)
                {
                    
Player[playerid][BrahminSteak] += Item[i][ItemAmount];
                    
format(stringsizeof(string), "You have picked up 'Brahmin Steak'.  Amount: %i"Item[i][ItemAmount]);
                    
SendClientMessage(playeridCOLOR_WHITEstring);
                    
format(stringsizeof(string), " * %s has picked up something."GetName(playerid));
                    
SetPlayerChatBubble(playeridstringCOLOR_LIGHTPURPLE107000);
                    
SendClientMessage(playeridCOLOR_LIGHTPURPLEstring);
                    break;
                }
                else if(
Item[i][ItemModel] == 2663 && Item[i][ItemType] == 1)
                {
                    
Player[playerid][Cram] += Item[i][ItemAmount];
                    
format(stringsizeof(string), "You have picked up 'Cram'.  Amount: %i"Item[i][ItemAmount]);
                    
SendClientMessage(playeridCOLOR_WHITEstring);
                    
format(stringsizeof(string), " * %s has picked up something."GetName(playerid));
                    
SetPlayerChatBubble(playeridstringCOLOR_LIGHTPURPLE107000);
                    
SendClientMessage(playeridCOLOR_LIGHTPURPLEstring);
                    break;
                }
                else if(
Item[i][ItemModel] == 2663 && Item[i][ItemType] == 2)
                {
                    
Player[playerid][MacCheese] += Item[i][ItemAmount];
                    
format(stringsizeof(string), "You have picked up 'BlamCo Mac & Cheese'.  Amount: %i"Item[i][ItemAmount]);
                    
SendClientMessage(playeridCOLOR_WHITEstring);
                    
format(stringsizeof(string), " * %s has picked up something."GetName(playerid));
                    
SetPlayerChatBubble(playeridstringCOLOR_LIGHTPURPLE107000);
                    
SendClientMessage(playeridCOLOR_LIGHTPURPLEstring);
                    break;
                }
                else if(
Item[i][ItemModel] == 2769 && Item[i][ItemType] == 1)
                {
                    
Player[playerid][IguanaStick] += Item[i][ItemAmount];
                    
format(stringsizeof(string), "You have picked up 'Iguana on a Stick'.  Amount: %i"Item[i][ItemAmount]);
                    
SendClientMessage(playeridCOLOR_WHITEstring);
                    
format(stringsizeof(string), " * %s has picked up something."GetName(playerid));
                    
SetPlayerChatBubble(playeridstringCOLOR_LIGHTPURPLE107000);
                    
SendClientMessage(playeridCOLOR_LIGHTPURPLEstring);
                    break;
                }
                else if(
Item[i][ItemModel] == 2769 && Item[i][ItemType] == 2)
                {
                    
Player[playerid][SquirrelStick] += Item[i][ItemAmount];
                    
format(stringsizeof(string), "You have picked up 'Squirrel on a Stick'.  Amount: %i"Item[i][ItemAmount]);
                    
SendClientMessage(playeridCOLOR_WHITEstring);
                    
format(stringsizeof(string), " * %s has picked up something."GetName(playerid));
                    
SetPlayerChatBubble(playeridstringCOLOR_LIGHTPURPLE107000);
                    
SendClientMessage(playeridCOLOR_LIGHTPURPLEstring);
                    break;
                }
                else if(
Item[i][ItemModel] == 1580 && Item[i][ItemType] == 1)
                {
                    
Player[playerid][Stimpak] += Item[i][ItemAmount];
                    
format(stringsizeof(string), "You have picked up 'Stimpak'.  Amount: %i"Item[i][ItemAmount]);
                    
SendClientMessage(playeridCOLOR_WHITEstring);
                    
format(stringsizeof(string), " * %s has picked up something."GetName(playerid));
                    
SetPlayerChatBubble(playeridstringCOLOR_LIGHTPURPLE107000);
                    
SendClientMessage(playeridCOLOR_LIGHTPURPLEstring);
                    break;
                }
                else if(
Item[i][ItemModel] == 1580 && Item[i][ItemType] == 2)
                {
                    
Player[playerid][DoctorBag] += Item[i][ItemAmount];
                    
format(stringsizeof(string), "You have picked up 'Doctor's Bag'.  Amount: %i"Item[i][ItemAmount]);
                    
SendClientMessage(playeridCOLOR_WHITEstring);
                    
format(stringsizeof(string), " * %s has picked up something."GetName(playerid));
                    
SetPlayerChatBubble(playeridstringCOLOR_LIGHTPURPLE107000);
                    
SendClientMessage(playeridCOLOR_LIGHTPURPLEstring);
                    break;
                }
                else if(
Item[i][ItemModel] == 1575 && Item[i][ItemType] == 1)
                {
                    
Player[playerid][Jet] += Item[i][ItemAmount];
                    
format(stringsizeof(string), "You have picked up 'Jet'.  Amount: %i"Item[i][ItemAmount]);
                    
SendClientMessage(playeridCOLOR_WHITEstring);
                    
format(stringsizeof(string), " * %s has picked up something."GetName(playerid));
                    
SetPlayerChatBubble(playeridstringCOLOR_LIGHTPURPLE107000);
                    
SendClientMessage(playeridCOLOR_LIGHTPURPLEstring);
                    break;
                }
                else if(
Item[i][ItemModel] == 1575 && Item[i][ItemType] == 2)
                {
                    
Player[playerid][Psycho] += Item[i][ItemAmount];
                    
format(stringsizeof(string), "You have picked up 'Psycho'.  Amount: %i"Item[i][ItemAmount]);
                    
SendClientMessage(playeridCOLOR_WHITEstring);
                    
format(stringsizeof(string), " * %s has picked up something."GetName(playerid));
                    
SetPlayerChatBubble(playeridstringCOLOR_LIGHTPURPLE107000);
                    
SendClientMessage(playeridCOLOR_LIGHTPURPLEstring);
                    break;
                }
                else if(
Item[i][ItemModel] == 1575 && Item[i][ItemType] == 3)
                {
                    
Player[playerid][Mentats] += Item[i][ItemAmount];
                    
format(stringsizeof(string), "You have picked up 'Mentats'.  Amount: %i"Item[i][ItemAmount]);
                    
SendClientMessage(playeridCOLOR_WHITEstring);
                    
format(stringsizeof(string), " * %s has picked up something."GetName(playerid));
                    
SetPlayerChatBubble(playeridstringCOLOR_LIGHTPURPLE107000);
                    
SendClientMessage(playeridCOLOR_LIGHTPURPLEstring);
                    break;
                }
                else if(
Item[i][ItemModel] == 1575 && Item[i][ItemType] == 4)
                {
                    
Player[playerid][Buffout] += Item[i][ItemAmount];
                    
format(stringsizeof(string), "You have picked up 'Buffout'.  Amount: %i"Item[i][ItemAmount]);
                    
SendClientMessage(playeridCOLOR_WHITEstring);
                    
format(stringsizeof(string), " * %s has picked up something."GetName(playerid));
                    
SetPlayerChatBubble(playeridstringCOLOR_LIGHTPURPLE107000);
                    
SendClientMessage(playeridCOLOR_LIGHTPURPLEstring);
                    break;
                }
                else if(
Item[i][ItemModel] == 2647 && Item[i][ItemType] == 1)
                {
                    
Player[playerid][DirtyWater] += Item[i][ItemAmount];
                    
format(stringsizeof(string), "You have picked up 'Dirty Water'.  Amount: %i"Item[i][ItemAmount]);
                    
SendClientMessage(playeridCOLOR_WHITEstring);
                    
format(stringsizeof(string), " * %s has picked up something."GetName(playerid));
                    
SetPlayerChatBubble(playeridstringCOLOR_LIGHTPURPLE107000);
                    
SendClientMessage(playeridCOLOR_LIGHTPURPLEstring);
                    break;
                }
                else if(
Item[i][ItemModel] == 2647 && Item[i][ItemType] == 2)
                {
                    
Player[playerid][PurifiedWater] += Item[i][ItemAmount];
                    
format(stringsizeof(string), "You have picked up 'Purified Water'.  Amount: %i"Item[i][ItemAmount]);
                    
SendClientMessage(playeridCOLOR_WHITEstring);
                    
format(stringsizeof(string), " * %s has picked up something."GetName(playerid));
                    
SetPlayerChatBubble(playeridstringCOLOR_LIGHTPURPLE107000);
                    
SendClientMessage(playeridCOLOR_LIGHTPURPLEstring);
                    break;
                }
                else if(
Item[i][ItemModel] == 1484 && Item[i][ItemType] == 1)
                {
                    
Player[playerid][NukaCola] += Item[i][ItemAmount];
                    
format(stringsizeof(string), "You have picked up 'Nuka Cola'.  Amount: %i"Item[i][ItemAmount]);
                    
SendClientMessage(playeridCOLOR_WHITEstring);
                    
format(stringsizeof(string), " * %s has picked up something."GetName(playerid));
                    
SetPlayerChatBubble(playeridstringCOLOR_LIGHTPURPLE107000);
                    
SendClientMessage(playeridCOLOR_LIGHTPURPLEstring);
                    break;
                }
                else if(
Item[i][ItemModel] == 1577 && Item[i][ItemType] == 1)
                {
                    
Player[playerid][RadAway] += Item[i][ItemAmount];
                    
format(stringsizeof(string), "You have picked up 'RadAway'.  Amount: %i"Item[i][ItemAmount]);
                    
SendClientMessage(playeridCOLOR_WHITEstring);
                    
format(stringsizeof(string), " * %s has picked up something."GetName(playerid));
                    
SetPlayerChatBubble(playeridstringCOLOR_LIGHTPURPLE107000);
                    
SendClientMessage(playeridCOLOR_LIGHTPURPLEstring);
                    break;
                }
            }
        }
    }
    
Item[_itemid][ItemModel] = 0;
     
Item[_itemid][ItemType] = 0;
     
Item[_itemid][ItemAmount] = 0;
     
_itemid = -1;
    return 
1;

Reply


Messages In This Thread
Another Item Label problem - by DTV - 02.05.2015, 22:34
Re: Another Item Label problem - by DTV - 03.05.2015, 20:12
Re: Another Item Label problem - by DTV - 05.05.2015, 02:18
Re: Another Item Label problem - by DTV - 09.05.2015, 19:43
AW: Another Item Label problem - by Mencent - 09.05.2015, 19:58

Forum Jump:


Users browsing this thread: 1 Guest(s)