Jump to content

Need help


sckatchof

Recommended Posts

hi guys i have a small problem WARNIG .... Bad arugement @' getPlayerFromName

server side :

function listinfo (theAdmin, command, targetsource) 
local thePlayer = getPlayerFromName(targetsource) 
end 
addEvent("informations", true) 
addEventHandler("informations", getRootElement(), listinfo) 

Link to comment
Can you post the rest,because this doesn't make sense.

you mean client side :

function informations() 
local rowindex, columnindex = guiGridListGetSelectedItem ( GridListePlayer ) 
playername = guiGridListGetItemText ( GridListePlayer, rowindex, 1) 
    guiSetText ( LabelName, "Name : " .. playername .. " " ) 
   triggerServerEvent("informations", localPlayer, targetsource, playername) 
end 

Link to comment

Try this:

function info() 
    local rowindex, columnindex = guiGridListGetSelectedItem ( GridListePlayer ) 
    playername = guiGridListGetItemText ( GridListePlayer, rowindex, 1) 
    guiSetText ( LabelName, "Name : " .. playername .. " " ) 
    triggerServerEvent("informations",localPlayer,targetsource, playername) 
end 
  
addEvent("informations", true) 
addEventHandler("informations",root,function(targetsource) 
    local thePlayer = getPlayerFromName(targetsource) 
end) 

and may I ask? What is this script for?

Link to comment

-- client side:

function info ( ) 
    local rowindex, columnindex = guiGridListGetSelectedItem ( GridListePlayer ) 
    playername = guiGridListGetItemText ( GridListePlayer, rowindex, 1) 
    guiSetText ( LabelName, "Name : " .. playername .. " " ) 
    triggerServerEvent ( "informations", localPlayer, playername ) 
end 

-- server side:

addEvent ( "informations", true ) 
addEventHandler ( "informations", root, 
    function ( playerName ) 
        local thePlayer = getPlayerFromName ( playerName ) 
    end 
) 

What was 'targetsource'?

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