sckatchof Posted March 27, 2012 Share Posted March 27, 2012 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
drk Posted March 27, 2012 Share Posted March 27, 2012 Maybe show what's argument playerName, ip, serial and account? Link to comment
sckatchof Posted March 27, 2012 Author Share Posted March 27, 2012 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
drk Posted March 27, 2012 Share Posted March 27, 2012 What you are doing is: Example: getPlayerIP ( getPlayerIP ( playerName ) ) Link to comment
sckatchof Posted March 27, 2012 Author Share Posted March 27, 2012 thank you for help but dont work some problem Link to comment
sckatchof Posted March 27, 2012 Author Share Posted March 27, 2012 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
drk Posted March 27, 2012 Share Posted March 27, 2012 LOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOL I said you that it's wrong. Link to comment
sckatchof Posted March 27, 2012 Author Share Posted March 27, 2012 LOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOLI 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
drk Posted March 27, 2012 Share Posted March 27, 2012 No. I said that it's wrong. You put: getPlayerIP ( getPlayerIP ( player ) ) . I said that you put this and it's wrong. Link to comment
sckatchof Posted March 27, 2012 Author Share Posted March 27, 2012 No. I said that it's wrong. You put: getPlayerIP ( getPlayerIP ( player ) ) . I said that you put this and it's wrong. and can u help me to fix it ? Link to comment
GanJaRuleZ Posted March 27, 2012 Share Posted March 27, 2012 -.- 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
Castillo Posted March 27, 2012 Share Posted March 27, 2012 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
sckatchof Posted March 27, 2012 Author Share Posted March 27, 2012 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
Castillo Posted March 27, 2012 Share Posted March 27, 2012 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. Link to comment
sckatchof Posted March 27, 2012 Author Share Posted March 27, 2012 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
Kenix Posted March 27, 2012 Share Posted March 27, 2012 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
sckatchof Posted March 27, 2012 Author Share Posted March 27, 2012 thanks all for help thaaaannnk yooooooooooooooooooooou keniiix its work Link to comment
Castillo Posted March 27, 2012 Share Posted March 27, 2012 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
drk Posted March 27, 2012 Share Posted March 27, 2012 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
Kenix Posted March 27, 2012 Share Posted March 27, 2012 (edited) thanks all for helpthaaaannnk yooooooooooooooooooooou keniiix its work 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 March 27, 2012 by Guest Link to comment
yMassai Posted March 27, 2012 Share Posted March 27, 2012 sckatchof you are creating a server rpg? I really appreciate a rpg server, maybe I can be useful on the server. Link to comment
sckatchof Posted March 27, 2012 Author Share Posted March 27, 2012 sckatchofyou are creating a server rpg? I really appreciate a rpg server, maybe I can be useful on the server. Yes i create a RPG server and thank you Link to comment
drk Posted March 28, 2012 Share Posted March 28, 2012 Oh, sckatchof, sorry for can't help you yesterday and for being a bit rude. I'm very busy with my gamemode Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now