Inventory Dropping
#5

Actually when you enter the pickup now, it picks up the gun.
I want to make the player press an key/make an command if he wants to pick it up.
The problem is that i don't know how to get modelid into OnPlayerKey.

Current code:
PHP код:
        if(modelid == 346)
        {
        new 
str[128];
        
format(str,sizeof(str),"%s(%i) has dropped a 9mm from their inventory.",PlayerName(playerid),playerid);
        
SendNearbyMessage(playerid,30.0,str,ORANGE);
        
RemoveItem(playerid,modelid);
        
ShowInventoryDrop(playerid);
        new 
Float:XFloat:YFloat:Z;
        
GetPlayerPos(playeridXYZ);
        
Dropped9mm=CreateDynamicPickup(346,19,X-2.1YZ,-1);
        }
if(
pickupid==Dropped9mm)
    {
        new 
str[128];
        
format(str,sizeof(str),"%s(%i) has picked up a 9mm from their surroundings.",PlayerName(playerid),playerid);
        
SendNearbyMessage(playerid,30.0,str,ORANGE);
        
AddItem(playerid,346);
    } 
How do i make this OnPlayerKey work? :
PHP код:
if(newkeys==KEY_CROUCH)
    {
        if(
modelid == 346)
        {
            new 
str[128];
            
format(str,sizeof(str),"%s(%i) has picked up a 9mm from their surroundings",PlayerName(playerid),playerid);
               
SendNearbyMessage(playerid,30.0,str,ORANGE);
            
AddItem(playerid,modelid);
        }

I need to know how to make modelid work in there.
If i get this to work, i can do it without a pickup, and do it with an object.
Reply


Messages In This Thread
Inventory Dropping - by jasperschellekens - 25.03.2017, 10:54
Re: Inventory Dropping - by Mencent - 25.03.2017, 10:55
Re: Inventory Dropping - by jasperschellekens - 25.03.2017, 11:25
Re: Inventory Dropping - by Mencent - 25.03.2017, 11:54
Re: Inventory Dropping - by jasperschellekens - 25.03.2017, 12:04
Re: Inventory Dropping - by Vince - 25.03.2017, 12:20
Re: Inventory Dropping - by jasperschellekens - 25.03.2017, 14:52
Re: Inventory Dropping - by Pottus - 25.03.2017, 15:00
Re: Inventory Dropping - by jasperschellekens - 25.03.2017, 15:17
Re: Inventory Dropping - by Pottus - 25.03.2017, 17:33
Re: Inventory Dropping - by jasperschellekens - 25.03.2017, 22:55
Re: Inventory Dropping - by raydx - 26.03.2017, 09:01
Re: Inventory Dropping - by jasperschellekens - 26.03.2017, 11:51

Forum Jump:


Users browsing this thread: 3 Guest(s)