Jump to content

Need help


sckatchof

Recommended Posts

hi guys i have a probel when i select a player from gridList it show like this

Name : Sckatchof

Ip : nil

Serial : false (sometimes it show)

account Name : sckatchof (sometimes it show)

bad argument @ line 7 , 8 , 9

part of server side :

addEvent ( "ListInfo", true ); 
addEventHandler ( "ListInfo", root, 
    function ( playerName, ip, serial, account ) 
        local plsayer = getPlayerFromName ( playerName ) 
        local playerip = getPlayerIP ( ip ) 
        local playerSerial = getPlayerSerial ( serial ) 
        local accountname = getAccountName ( getPlayerAccount ( account ) ) 
    end 
) 

Link to comment
Maybe show what's argument playerName, ip, serial and account?

this all my script :

Client side :

addEventHandler ( 'onClientGUIClick', root, 
    function ( ) 
        if ( source == GridListePlayer ) then 
            local col = guiGridListGetSelectedItem ( GridListePlayer ); 
            if ( col and col ~= -1 ) then 
                local playername = guiGridListGetItemText ( GridListePlayer, col, 1 ); 
                triggerServerEvent ( 'triggerData', localPlayer, playername ); 
            end 
        end 
    end 
) 
  
addEvent ( 'setText', true ); 
  
addEventHandler ( 'setText', root, 
    function ( player, ip, serial, account ) 
        guiSetText ( LabelName, "Name : " .. tostring ( player ) .. " " ); 
        guiSetText ( LabelIp, "IP : " ..tostring ( ip ) .." " ); 
        guiSetText ( LabelSerial, "Serial : " ..tostring ( serial ) .." " ); 
        guiSetText ( LabelAccountName, "Account Name : " ..tostring ( account ) .." " ); 
        triggerServerEvent ( 'ListInfo', localPlayer, player, ip, serial, account ); 
    end 
) 

server side :

addEvent ( "ListInfo", true ); 
addEventHandler ( "ListInfo", root, 
    function ( playerName, ip, serial, account ) 
        local plsayer = getPlayerFromName ( playerName ) 
        local playerip = getPlayerIP ( ip ) 
        local playerSerial = getPlayerSerial ( serial ) 
        local accountname = getAccountName ( getPlayerAccount ( account ) ) 
    end 
) 
  
addEvent ( 'triggerData', true ); 
addEventHandler ( 'triggerData', root, 
    function ( playerName ) 
        local plsayer = getPlayerFromName ( playerName ) 
        local playerip = getPlayerIP ( player ); 
        local playerSerial = getPlayerSerial ( player ); 
        local accountname = getAccountName ( getPlayerAccount ( player ) ); 
        triggerClientEvent ( source, 'setText', source, playerName, ip, playerSerial, accountname ); 
    end 
) 
  

Link to comment
What don't work? What you put?

change this

.. 
.. 
    function ( playerName, ip, serial, account ) 
        local plsayer = getPlayerFromName ( playerName ) 
        local playerip = getPlayerIP ( ip ) 
        local playerSerial = getPlayerSerial ( serial ) 
        local accountname = getAccountName ( getPlayerAccount ( account ) ) 
    end 
) 

with this

    function ( playerName, ip, serial, account ) 
        local plsayer = getPlayerFromName ( playerName ) 
      getPlayerIP ( getPlayerIP ( playerName ) ) 
getPlayerIP ( getPlayerIP ( IP ) ) 
getPlayerSerial  ( getPlayerSerial  ( serial ) ) 
getAccountName ( getPlayerAccount ( account ) ) 
    end 

Link to comment
LOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOL

I said you that it's wrong.

you said what you put !! and my problem i have bad argument lien 7 8 and 9 this lien

addEvent ( "ListInfo", true ); 
addEventHandler ( "ListInfo", root, 
    function ( playerName, ip, serial, account ) 
        local plsayer = getPlayerFromName ( playerName ) 
        local ip = getPlayerIP ( ip ) 
        local playerSerial = getPlayerSerial ( serial ) 
        local accountname = getAccountName ( getPlayerAccount ( account ) )  
    end 
) 

Link to comment

-.-

Leave it , you don't see he is just to ... to make it ?

I know it won't help , but i will help him JUST with the code he asked for

  
addEvent ( "ListInfo", true ); 
addEventHandler ( "ListInfo", root, 
    function () 
        local name = getPlayerName(source) 
        local plsayer = getPlayerFromName (name) 
        local playerip = getPlayerIP ( source ) 
        local playerSerial = getPlayerSerial ( source ) 
        local accountname = getAccountName ( getPlayerAccount ( source ) ) 
    end 
) 

I know it's the source it's the player from this :

triggerServerEvent ( 'ListInfo', localPlayer )-- i removed "player,ip,serial,account" 

Link to comment
No. I said that it's wrong. You put:
getPlayerIP ( getPlayerIP ( player ) ) 

. I said that you put this and it's wrong.

He didn't put that, you are giving him wrong information.

@sckatchof: You must add the resource to the "acl.xml", "Admin" group.

Link to comment
No. I said that it's wrong. You put:
getPlayerIP ( getPlayerIP ( player ) ) 

. I said that you put this and it's wrong.

He didn't put that, you are giving him wrong information.

@sckatchof: You must add the resource to the "acl.xml", "Admin" group.

thank you snake for help it still dont work

Link to comment
I've read your script many times and I still don't understand why do you need to trigger again to the server side? also, you aren't even using it these values.

i have make a panel with gridlist players and i want when i click from grid list to any player it show his informations like

his name :

his Ip :

accountName:

his serial .... like admin panel

Link to comment

Client

  
addEventHandler ( 'onClientGUIClick', root, 
    function ( ) 
        if ( source == GridListePlayer ) then 
            local nColumn = guiGridListGetSelectedItem ( GridListePlayer ); 
            if ( nColumn and nColumn ~= -1 ) then 
                local sPlayerName = guiGridListGetItemText ( GridListePlayer, nColumn, 1 ); 
                if sPlayerName then 
                    triggerServerEvent ( 'triggerData', localPlayer, sPlayerName ); 
                end 
            end 
        end 
    end 
) 
  
addEvent ( 'setText', true ); 
  
addEventHandler ( 'setText', root, 
    function ( sPlayerName, nPlayerIp, nPlayerSerial, uAccount ) 
        guiSetText ( LabelName, "Name : " .. tostring ( sPlayerName ) .. " " ); 
        guiSetText ( LabelIp, "IP : " ..tostring ( nPlayerIp ) .." " ); 
        guiSetText ( LabelSerial, "Serial : " ..tostring ( nPlayerSerial ) .." " ); 
        guiSetText ( LabelAccountName, "Account Name : " ..tostring ( uAccount or ''  ) .." " ); 
        --triggerServerEvent ( 'ListInfo', localPlayer, player, ip, nPlayerSerial, account ); 
    end 
) 
  

Server

  
--[[ 
addEvent ( "ListInfo", true ); 
addEventHandler ( "ListInfo", root, 
    function ( playerName, ip, serial, account ) 
        local plsayer = getPlayerFromName ( playerName ) 
        local playerip = getPlayerIP ( ip ) 
        local playerSerial = getPlayerSerial ( serial ) 
        local accountname = getAccountName ( getPlayerAccount ( account ) ) 
    end 
) 
]] 
  
addEvent ( 'triggerData', true ); 
addEventHandler ( 'triggerData', root, 
    function ( sPlayerName ) 
        local uPlayer = getPlayerFromName ( sPlayerName ) 
        local nPlayerIp = getPlayerIP ( uPlayer ); 
        local nPlayerSerial = getPlayerSerial ( uPlayer ); 
        local uAccount = getPlayerAccount ( uPlayer )  
        if uAccount then 
            uAccount = getAccountName ( uAccount ); 
        else 
            uAccount = false 
        end 
        triggerClientEvent ( source, 'setText', source, sPlayerName, nPlayerIp, nPlayerSerial, uAccount ); 
    end 
) 

Try

I've read your script many times and I still don't understand why do you need to trigger again to the server side? also, you aren't even using it these values.

i have make a panel with gridlist players and i want when i click from grid list to any player it show his informations like

his name :

his Ip :

accountName:

his serial .... like admin panel

You not need again trigger to server.

Link to comment

Then, you don't need the other trigger.

-- client side:

addEventHandler ( 'onClientGUIClick', root, 
    function ( ) 
        if ( source == GridListePlayer ) then 
            local col = guiGridListGetSelectedItem ( GridListePlayer ); 
            if ( col and col ~= -1 ) then 
                local playername = guiGridListGetItemText ( GridListePlayer, col, 1 ); 
                triggerServerEvent ( 'triggerData', localPlayer, playername ); 
            end 
        end 
    end 
) 
  
addEvent ( 'setText', true ); 
addEventHandler ( 'setText', root, 
    function ( player, ip, serial, account ) 
        guiSetText ( LabelName, "Name : " .. tostring ( player ) .. " " ); 
        guiSetText ( LabelIp, "IP : " ..tostring ( ip ) .." " ); 
        guiSetText ( LabelSerial, "Serial : " ..tostring ( serial ) .." " ); 
        guiSetText ( LabelAccountName, "Account Name : " ..tostring ( account ) .." " ); 
    end 
) 

-- server side:

addEvent ( 'triggerData', true ); 
addEventHandler ( 'triggerData', root, 
    function ( playerName ) 
        local player = getPlayerFromName ( playerName ) 
        if ( player ) then 
            local playerip = getPlayerIP ( player ); 
            local playerSerial = getPlayerSerial ( player ); 
            local accountname = getAccountName ( getPlayerAccount ( player ) ); 
            triggerClientEvent ( source, 'setText', source, playerName, playerip, playerSerial, accountname ); 
        end 
    end 
) 

Link to comment
No. I said that it's wrong. You put:
getPlayerIP ( getPlayerIP ( player ) ) 

. I said that you put this and it's wrong.

He didn't put that, you are giving him wrong information.

@sckatchof: You must add the resource to the "acl.xml", "Admin" group.

No?

addEvent ( 'triggerData', true ); 
addEventHandler ( 'triggerData', root, 
    function ( playerName ) 
        local plsayer = getPlayerFromName ( playerName ) 
        local playerip = getPlayerIP ( player ); 
        local playerSerial = getPlayerSerial ( player ); 
        local accountname = getAccountName ( getPlayerAccount ( player ) ); 
        triggerClientEvent ( source, 'setText', source, playerName, ip, playerSerial, accountname ); --> trigger setText 
    end 
) 
  
  
  
  
addEvent ( 'setText', true ); 
  
addEventHandler ( 'setText', root, 
    function ( player, ip, serial, account ) 
        guiSetText ( LabelName, "Name : " .. tostring ( player ) .. " " ); 
        guiSetText ( LabelIp, "IP : " ..tostring ( ip ) .." " ); 
        guiSetText ( LabelSerial, "Serial : " ..tostring ( serial ) .." " ); 
        guiSetText ( LabelAccountName, "Account Name : " ..tostring ( account ) .." " ); 
        triggerServerEvent ( 'ListInfo', localPlayer, player, ip, serial, account ); --> Trigger ListInfo 
    end 
) 
  
  
  
addEvent ( "ListInfo", true ); 
addEventHandler ( "ListInfo", root, 
    function ( playerName, ip, serial, account ) 
        local plsayer = getPlayerFromName ( playerName ) 
        local playerip = getPlayerIP ( ip ) 
        local playerSerial = getPlayerSerial ( serial ) --> getPlayerSerial ( getPlayerSerial ( player ) ) 
        local accountname = getAccountName ( getPlayerAccount ( account ) ) --> getAccountName ( getPlayerAccount ( getAccountName ( getPlayerAccount ( account ) ) ) ) 
    end 
) 

Link to comment
thanks all for help

thaaaannnk yooooooooooooooooooooou keniiix its work :D:D

No problem. :)

addEvent ( 'triggerData', true ); 
addEventHandler ( 'triggerData', root, 
    function ( playerName ) 
        local plsayer = getPlayerFromName ( playerName ) 
        local playerip = getPlayerIP ( player ); -- Your problem here. Variable 'player' not defined. Also use in next time /debugscript 3. 
        local playerSerial = getPlayerSerial ( player ); 
        local accountname = getAccountName ( getPlayerAccount ( player ) ); 
        triggerClientEvent ( source, 'setText', source, playerName, ip, playerSerial, accountname ); 
    end 
) 
  

Read comments

Edited by Guest
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...