Plate Posted June 24, 2012 Posted June 24, 2012 hola hace poco hize un gui pero no funciona par agregar a las personas pero no funciona addEventHandler("onClientResourceStart",resourceRoot, function() GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Grid = {} Panel = guiCreateWindow(138,146,499,282,"Panel",false) GUIEditor_Grid[1] = guiCreateGridList(363,59,127,195,false,Faction) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) guiGridListAddColumn(GUIEditor_Grid[1],"Players in F",0.5) Players = guiCreateGridList(9,58,127,196,false,Faction) guiGridListSetSelectionMode(Players,2) guiGridListAddColumn(Players,"Players",0.5) Add = guiCreateButton(177,60,135,49,"Add Player",false,Faction) Remove = guiCreateButton(174,132,142,51,"Remove Player",false,Faction) Leader = guiCreateButton(173,203,145,48,"Give Leader",false,Faction) 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 ( "onClientResourceStart", resourceRoot, loadPlayers ) addEventHandler ( "onClientPlayerJoin", root, loadPlayers ) addEventHandler ( "onClientPlayerQuit", root, loadPlayers ) addEventHandler ( "onClientPlayerChangeNick", root, loadPlayers ) server addEvent ( "addST", true ) addEventHandler ( "addST", getRootElement(), function ( accountName ) local usuario = getAccountName ( getPlayerAccount ( source ) ) if isObjectInACLGroup ( "user.".. usuario, aclGetGroup ( "LiderFTFP" ) ) then if ( accountName ) then local pname = getPlayerName ( source ) 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 ) Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
BorderLine Posted June 24, 2012 Posted June 24, 2012 no olvides darle derechos de admin en la acl y porq no funciona? que dice el debugscript? Actual Nick: [XGN]BorderLine Actual Clan: XLatino Actual Status: Staff, Mod Level 1 (BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline
Castillo Posted June 24, 2012 Posted June 24, 2012 "accountName " no esta definido en ninguna parte ( client side ). San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Plate Posted June 24, 2012 Author Posted June 24, 2012 el debugscript dice esto bad argument addEventHandler[Expect element at argument 2 goot nil] Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Castillo Posted June 24, 2012 Posted June 24, 2012 addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Grid = {} Panel = guiCreateWindow(138,146,499,282,"Panel",false) GUIEditor_Grid[1] = guiCreateGridList(363,59,127,195,false,Faction) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) guiGridListAddColumn(GUIEditor_Grid[1],"Players in F",0.5) Players = guiCreateGridList(9,58,127,196,false,Faction) guiGridListSetSelectionMode(Players,2) guiGridListAddColumn(Players,"Players",0.5) Add = guiCreateButton(177,60,135,49,"Add Player",false,Faction) Remove = guiCreateButton(174,132,142,51,"Remove Player",false,Faction) Leader = guiCreateButton(173,203,145,48,"Give Leader",false,Faction) addEventHandler ( "onClientGUIClick", Add, STARS, 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 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 ) Mira el comentario que hice. P.D: Para que esto funcione, vas a tener que enviar el nombre del jugador al server side y ahi obtener el jugador y luego su cuenta. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Plate Posted June 24, 2012 Author Posted June 24, 2012 y como seria para hacer eso solid Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Castillo Posted June 24, 2012 Posted June 24, 2012 -- client side: guiGridListGetSelectedItem guiGridListGetItemText -- server side: getPlayerFromName getPlayerAccount getAccountName San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Plate Posted June 24, 2012 Author Posted June 24, 2012 no entiendo como lo podria hacer u.u Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Plate Posted June 24, 2012 Author Posted June 24, 2012 va bien hay? function NOSE() guiGridListSetItemText ( Players, row, Players, getPlayerName ( playeritem ), false, false ) PDat = guiGridListGetItemText ( Players, Players, Players ) elseif getRandomItem == 2 then PDat = guiGridListGetItemText ( Player, Players, Players ) end Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
NodZen Posted June 24, 2012 Posted June 24, 2012 va bien hay? function NOSE() guiGridListSetItemText ( Players, row, Players, getPlayerName ( playeritem ), false, false ) PDat = guiGridListGetItemText ( Players, Players, Players ) elseif getRandomItem == 2 then PDat = guiGridListGetItemText ( Player, Players, Players ) end Està incompleto eso. ------------------------------------------------------------------------------------------ My scripts http://community.multitheftauto.com/index.php?p=resources&s=details&id=6977 http://community.multitheftauto.com/index.php?p=resources&s=details&id=7740
Plate Posted June 24, 2012 Author Posted June 24, 2012 que le falta? Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Castillo Posted June 24, 2012 Posted June 24, 2012 No te enojes, pero ese codigo no tiene mucho sentido. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Plate Posted June 24, 2012 Author Posted June 24, 2012 es qe no entiendo pero voy a seguir intentando podrian corregir esto que no tengo ni idea de lo que hize function() level = dxDrawText("",686.0,158.0,746.0,166.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) dxDrawText("",682.0,143.0,749.0,153.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) dxDrawText("",633.0,142.0,663.0,167.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) dxDrawRectangle(628.0,136.0,128.0,35.0,tocolor(255,255,255,255),false) end ) function drawLevel() triggerServerEvent ("dvl", getLocalPlayer(), thePlayer) addEventHandler("onResourceStart",getRootElement(),drawLevel) server addEvent("dlv",true) addEventHandler("dlv",getRootElement(), function (thePlayer) exports["exp_system"]:getPlayerLevel(thePlayer) end) Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
iFoReX Posted June 24, 2012 Posted June 24, 2012 cl-side function random() local playerName = guiGridListGetItemText ( GUIEditor_Grid[1], guiGridListGetSelectedItem ( GUIEditor_Grid[1] ), 1 ) triggerServerEvent("enviarVariable",localPlayer,playerName) end 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 ) prueba con algo asi elMota/elFoReX De Vuelta En MTA *---------* Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3 https://www.youtube.com/user/KillersGPs
Plate Posted June 24, 2012 Author Posted June 24, 2012 no me funciono pero gracias Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
iFoReX Posted June 24, 2012 Posted June 24, 2012 obvio que no te funciono es solo un ejemplo tienes que agregar el onClientGUIClick elMota/elFoReX De Vuelta En MTA *---------* Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3 https://www.youtube.com/user/KillersGPs
Plate Posted June 25, 2012 Author Posted June 25, 2012 haci? 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) 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 ) Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Plate Posted June 26, 2012 Author Posted June 26, 2012 pero igual no funciona Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Recommended Posts