Jump to content

[HELP] Why not working export function in admin?


Tokio

Recommended Posts

Posted

This is the code:

addEvent ( "aPlayer", true )
addEventHandler ( "aPlayer", _root, function ( player, action, data, additional, additional2, kickedname )
	if checkClient( "command."..action, source, 'aPlayer', action ) then return end
	if not isElement( player ) then
		return	-- Ignore if player is no longer valid
	end
	if ( hasObjectPermissionTo ( source, "command."..action ) ) then
		local admin = source
		local mdata = ""
		local more = ""
		if ( action == "kick" ) then
			local reason = data or ""
			mdata = reason~="" and ( "(" .. reason .. ")" ) or ""
			setTimer ( kickPlayer, 100, 1, player, source, reason )
			exports.ig_kickban:showBoxS (root ,"Kirúgás", player.." kirúgta "..source.." nevű játékost", "kick")

the exports.ig_ki...etc line does not working.. why? i get this error: "Attempt to concatenate global source (a userdata value)"

My servers:

Fun:

n-560x95_FFFFFF_FFFFFF_000000_000000.png

Derby(DD):

n-560x95_FFFFFF_FFFFFF_000000_000000.png

  • Moderators
Posted

It needs to be a string and not a reference to a player. Use getPlayerName on the user data to get his name, which you can merge with the rest of the string.

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   ?

 

  Useful functions  3x 

  Tutorials  4x 

 

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...