• Darkrp Pocket
    10 replies, posted
Can i put item(weapon,entity) when i buy it automaticly in pocket(darkrp system) and how. So when you press button with function that gives you (weapon, entity) it gives you item,entity in your pocket by itself.
[URL="http://wiki.darkrp.com/index.php/Functions/player/server/addpocketitem"]http://wiki.darkrp.com/index.php/Functions/player/server/addpocketitem[/URL] Player:addPocketItem( Entity ent )
Thanks man. :) [editline]31st October 2014[/editline] Help me with this function please. [CODE]util.AddNetworkString("NPCShop_AddBeer") net.Receive('NPCShop_AddBeer', function(length, ply) if ply:canAfford( BeerValue ) then Player:addPocketItem( "durgz_alcohol" ) else return false end end)[/CODE] [editline]31st October 2014[/editline] Just the code you pasted so Player:addPocketItem
Areyou using a custom Derma panel for this?
Derma panel yes. If you mean custum by me , yes by me.
addPocketItem does not take a string argument, it takes an entity
You would probably have to spawn the item on the ground on purchase, then after creating the item use addPocketItem (Never coded for DarkRP before so don't hold me to it)
#Sm63 correct me pls Player:addPocketItem( "durgz_alcohol" ) , durgz_alcohol is a entity.
[QUOTE=HumulusLupulu;46383116]#Sm63 correct me pls Player:addPocketItem( "durgz_alcohol" ) , durgz_alcohol is a entity.[/QUOTE] the argument you are using is a STRING, its not an Entity object itself. Its a name of an entity, but it isnt selecting a physical entity that currently exists.
How do i correct it so it will be as a physical entity.
You spawn the entity within the code, and then use the variable you set the entity to in the argument of the function.
Sorry, you need to Log In to post a reply to this thread.