Plate Posted July 4, 2012 Share Posted July 4, 2012 cuando lo empieso me dice Bad Argument : " getPlayerAccount" Bad Argument : "getAccountName" attempt to concatenate local "usuario" addEvent("enviarVariable",true) addEventHandler("enviarVariable",root,function (playerName) local elPlayer = getPlayerFromName(playerName) local usuario = getAccountName ( getPlayerAccount ( elPlayer ) ) if isObjectInACLGroup ( "user.".. usuario, aclGetGroup ( "LiderFTFP" ) ) then if ( accountName ) then local pname = getPlayerName ( elPlayer ) aclGroupAddObject ( aclGetGroup ( "FTFP" ), "user.".. accountName ) outputChatBox ( tostring ( pname ) .." agrego a '".. accountName .."' a S.T.A.R.S", getRootElement(), 0, 255, 255, true ) end end end ) Link to comment
Castillo Posted July 4, 2012 Share Posted July 4, 2012 'elPlayer' no debe ser un jugador, debe ser 'nil'. Link to comment
Plate Posted July 4, 2012 Author Share Posted July 4, 2012 me sigue diciendo lo mismo Link to comment
Castillo Posted July 4, 2012 Share Posted July 4, 2012 Me parece que no me entendiste, local elPlayer = getPlayerFromName(playerName) El jugador no existe. Link to comment
Plate Posted July 4, 2012 Author Share Posted July 4, 2012 ahh gracias pero como lo soluciono ^^ en lugar de eso que tengo que poner Link to comment
Castillo Posted July 4, 2012 Share Posted July 4, 2012 Postea como usas el evento: "enviarVariable". Link to comment
Plate Posted July 4, 2012 Author Share Posted July 4, 2012 addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Grid = {} Panel = guiCreateWindow(138,146,499,282,"",false) GUIEditor_Grid[1] = guiCreateGridList(363,59,127,195,false,Panel) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) guiGridListAddColumn(GUIEditor_Grid[1],"Players in F",0.-- s8) --> Players = guiCreateGridList(9,58,127,196,false,Panel) guiGridListSetSelectionMode(Players,2) guiGridListAddColumn(Players,"Players",0.-- s8) --> Add = guiCreateButton(177,60,135,49,"Add Player",false,Panel) Remove = guiCreateButton(174,132,142,51,"Remove Player",false,Panel) Leader = guiCreateButton(173,203,145,48,"Give Leader",false,Panel) addEventHandler ( "onClientGUIClick", Add,random, false ) -- El evento tiene que ir dentro de esta funcion. loadPlayers ( ) end ) function addP ( ) guiSetVisible ( Panel, true ) showCursor ( true ) end addCommandHandler("AFP",addP) function closePanel ( ) if guiGetVisible ( Panel ) then guiSetVisible ( Panel, false ) showCursor ( false ) end end addCommandHandler ( "CFP", closePanel ) function STARS ( ) triggerServerEvent ( "addST", localPlayer, accountName ) end addEventHandler("onClientGUIClick",Add,STARS, false) function loadPlayers ( ) guiGridListClear ( Players ) for index, player in ipairs ( getElementsByType ( "player" ) ) do guiGridListSetItemText ( Players, guiGridListAddRow ( Players ), 1, tostring ( getPlayerName ( player ) ), false, false ) end end addEventHandler ( "onClientPlayerJoin", root, loadPlayers ) addEventHandler ( "onClientPlayerQuit", root, loadPlayers ) addEventHandler ( "onClientPlayerChangeNick", root, loadPlayers ) function random() local playerName = guiGridListGetItemText ( GUIEditor_Grid[1], guiGridListGetSelectedItem ( GUIEditor_Grid[1] ), 1 ) triggerServerEvent("enviarVariable",localPlayer,playerName) end addEventHandler("onClientGUIClick",Add,random, false) addEvent("enviarVariable",true) addEventHandler("enviarVariable",root,function (playerName, accountName) local elPlayer = getPlayerFromName(playerName) local usuario = getAccountName ( getPlayerAccount ( nil ) ) if isObjectInACLGroup ( "user.".. usuario, aclGetGroup ( "LiderFTFP" ) ) then if ( accountName ) then local pname = getPlayerName ( nil ) aclGroupAddObject ( aclGetGroup ( "FTFP" ), "user.".. accountName ) outputChatBox ( tostring ( pname ) .." agrego a '".. accountName .."' a S.T.A.R.S", getRootElement(), 0, 255, 255, true ) end end end ) Link to comment
Castillo Posted July 4, 2012 Share Posted July 4, 2012 Antes de: triggerServerEvent("enviarVariable",localPlayer,playerName) Agrega: outputChatBox ( tostring ( playerName ) ) Link to comment
Plate Posted July 5, 2012 Author Share Posted July 5, 2012 sigue sin funcionar solid u.u Link to comment
Castillo Posted July 5, 2012 Share Posted July 5, 2012 Eso era nomas para que te dijiera que decia en el chat. Que dijo? Link to comment
Plate Posted July 5, 2012 Author Share Posted July 5, 2012 me dice Bad Argument: "getPlayerAccount" Bad Argument :" getAccountName" attempt to concatenate local "usuario" Link to comment
Castillo Posted July 5, 2012 Share Posted July 5, 2012 No estoy hablando de eso, que dijo en el chat despues de poner la linea que te dije? Link to comment
Plate Posted July 5, 2012 Author Share Posted July 5, 2012 no aparece nada en el chat es como si dejeara un espacio basio Link to comment
Castillo Posted July 5, 2012 Share Posted July 5, 2012 Osea que no estas enviando nada al server side. Link to comment
Plate Posted July 5, 2012 Author Share Posted July 5, 2012 puede ser eso creo pero si en el script se ve que lo envia u.u Link to comment
Recommended Posts