Jump to content

onPickupHit?


x86

Recommended Posts

Hi,

This is my script for a house system (SQL)

  
onResourceStart()..... 
while ... do 
   createPickup(house["x"], house["y"], house["z"], 3, 1272, 2000) 
end 
--------------------------------------- 
  
function HuisjesPickup() 
    outputChatBox(source) 
    cancelEvent() 
end 
addEventHandler("onPlayerPickupUse", root, HuisjesPickup) 
  

And the error:

ERROR: ...A/mods/deathmatch/resourcecache/greenhood/server.lua:370: attempt to concatenate global 'source' (a userdata value)

Can you help me? :)

Thank you.

Link to comment
Hi,

This is my script for a house system (SQL)

  
onResourceStart()..... 
while ... do 
   createPickup(house["x"], house["y"], house["z"], 3, 1272, 2000) 
end 
--------------------------------------- 
  
function HuisjesPickup() 
    outputChatBox(source) 
    cancelEvent() 
end 
addEventHandler("onPlayerPickupUse", root, HuisjesPickup) 
  

And the error:

ERROR: ...A/mods/deathmatch/resourcecache/greenhood/server.lua:370: attempt to concatenate global 'source' (a userdata value)

Can you help me? :)

Thank you.

outputChatBox(getClientName(source))

Link to comment
You can't output a player element to a chat box.

But why isn't this possible? All elements have their numerical IDs, right?

Possibly because the function is expecting a string object and not an element object structure. And an element does not have a numeric id by default as far as I know.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...