Jump to content

Need help


sckatchof

Recommended Posts

Posted

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) 

Posted
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 

Posted

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?

My in-game name: Jaysds1

Retired CMG Scripter

World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode

Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/

 

sE5Qm.png

TiV3C.png

img.php?id=0&text=Lua%20Scripter

Posted

-- 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'?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

You're welcome.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

I wasn't born with my knowledge, you can learn all I'd if you give it time and patience.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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