-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
1: No hagas dos post seguidos, edita el anterior. 2: getPlayerMoney client side solo obtiene el dinero del cliente, no sirve para jugadores remotos. 3: Podes enviar a los jugadores desde el server side al client side.
-
Try this: local skin = 0 function onSkinbackBtun ( button ) if ( button == "left" ) then if ( source == backSkinButton ) then local allSkins = getValidPedModels ( ) skin = skin - 1 if ( allSkins [ skin ] ) then setElementModel ( localPlayer, allSkins [ skin ] ) guiSetText ( skinIDLabel,"ID: ".. getElementModel ( localPlayer ) ) else outputChatBox("You can't go back any more!", 255,255,0) end playSoundFrontEnd ( 32 ) end end end
-
getValidPedModels returns a table, so you can do this: getValidPedModels ( ) [ 1 ] -- Returns 0 getValidPedModels ( ) [ 2 ] -- Returns 1 getValidPedModels ( ) [ 3 ] -- Returns 2 If you get what I mean.
-
There's a function that returns a table with all valid skins: https://wiki.multitheftauto.com/wiki/GetValidPedModels
-
Fijate como hice el comando yo. P.D: "thePlayer" no esta definido en "onPlayerWasted", tenes que usar "source".
-
GUIEditor_Window = {} GUIEditor_TabPanel = {} GUIEditor_Tab = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Grid = {} GUIEditor_Window[1] = guiCreateWindow(227,186,309,254,"test",false) guiSetVisible ( GUIEditor_Window[1], false ) GUIEditor_TabPanel[1] = guiCreateTabPanel(0.0291,0.1063,0.9385,0.8583,true,GUIEditor_Window[1]) GUIEditor_Tab[1] = guiCreateTab("Information",GUIEditor_TabPanel[1]) GUIEditor_Label[1] = guiCreateLabel(0.0724,0.1031,0.5138,0.1443,"stats:",true,GUIEditor_Tab[1]) GUIEditor_Label[2] = guiCreateLabel(0.069,0.3299,0.4448,0.2268,"skill:",true,GUIEditor_Tab[1]) GUIEditor_Label[3] = guiCreateLabel(0.0724,0.5361,0.331,0.2216,"rank:",true,GUIEditor_Tab[1]) GUIEditor_Tab[2] = guiCreateTab("vehicles",GUIEditor_TabPanel[1]) GUIEditor_Grid[1] = guiCreateGridList(0.0138,0.0309,0.4655,0.9381,true,GUIEditor_Tab[2]) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) GUIEditor_Button[1] = guiCreateButton(0.5241,0.1082,0.4241,0.1959,"spawn",true,GUIEditor_Tab[2]) GUIEditor_Button[2] = guiCreateButton(0.5207,0.3557,0.431,0.1907,"buy",true,GUIEditor_Tab[2]) GUIEditor_Button[3] = guiCreateButton(0.5241,0.6237,0.431,0.1856,"sell",true,GUIEditor_Tab[2]) bindKey ( "o", "down", function ( ) guiSetVisible ( GUIEditor_Window[1], not guiGetVisible ( GUIEditor_Window[1] ) ) guiSetVisible ( GUIEditor_Window[2], not guiGetVisible ( GUIEditor_Window[2] ) ) showCursor ( guiGetVisible ( GUIEditor_Window[1] ) ) end )
-
bindKey ( "o", "down", function ( ) guiSetVisible ( GUIEditor_Window[1], not guiGetVisible ( GUIEditor_Window[1] ) ) guiSetVisible ( GUIEditor_Window[2], not guiGetVisible ( GUIEditor_Window[2] ) ) showCursor ( guiGetVisible ( GUIEditor_Window[1] ) ) end ) I don't see anything wrong with it, can you post your entire script?
-
First: Remove: guiSetText ( GUIEditor_Label[7], "IP : ".. ip ) Second: Use triggerClientEvent to trigger the IP to the client side. Third: Add the events client side and then use: guiSetText ( GUIEditor_Label[7], "IP : ".. ip ) with the value sent from server side.
-
Post your script ( client and server ) side.
-
When you click on "Infor" it'll set the text of "memo1" with the text of "memo2", both text's are the same, so you won't notice it changed.
-
You must add the resource to the ACL group "Admin".
-
infoWindow = guiCreateWindow(350,250,450,320,"Painel Info",false) guiCreateButton(15,40,105,35,"Regras",false,infoWindow) memo1 = guiCreateMemo(135,40,300,260,"Test text",false,infoWindow) guiMemoSetReadOnly( memo1, true ) guiWindowSetSizable(infoWindow,false) guiSetVisible( infoWindow, false ) -------------------------------------------------------- button = guiCreateButton(15,80,105,35,"Infor",false,infoWindow) memo2 = guiCreateMemo(135,40,300,260,"Test text",false,infoWindow) guiMemoSetReadOnly( memo2, true ) function infoShow ( ) guiSetVisible ( infoWindow, not guiGetVisible ( infoWindow ) ) showCursor ( not isCursorShowing( ) ) end bindKey ( "F1", "down", infoShow ) addEventHandler ( "onClientGUIClick", root, function ( ) if ( source == button ) then guiSetText ( memo1, guiGetText( memo2 ) ) end end )
-
triggerServerEvent( "getIP", getLocalPlayer() ) After getLocalPlayer ( ) add thePlayer. triggerClientEvent works the same as triggerServerEvent.
-
onPlayerWasted spawnPlayer addCommandHandler.
-
You must trigger "thePlayer" argument too, and then trigger back using triggerClientEvent.
-
You must use the function: getPlayerFromName to get the player element from it's name. function setStats ( ) if ( source == GUIEditor_Grid[1] ) then local row, col = guiGridListGetSelectedItem ( source ) if ( row and col and row ~= -1 and col ~= -1 ) then local playername = guiGridListGetItemText ( source, row, col ) local thePlayer = getPlayerFromName ( playername ) if ( thePlayer ) then local x, y, z = getElementPosition ( thePlayer ) local location = getZoneName ( x, y, z ) guiSetText ( GUIEditor_Label[1], "Nickname : ".. playername ) guiSetText ( GUIEditor_Label[2], "Location : ".. location ) end end end end addEventHandler ( "onClientGUIDoubleClick", root, setStats )
-
You want to set the memo read-only? if so, use the function: guiMemoSetReadOnly.
-
Copy my code again, I've fixed a problem.
-
local posiciones = { { 2386.4592, 1032.8708, 10.5474 }, { 0, 0, 5 }, } function consoleSetPlayerPosition ( thePlayer ) local azar = math.random ( #posiciones ) setElementPosition ( thePlayer, unpack ( posiciones [ azar ] ) ) end addCommandHandler ( "setpos", consoleSetPlayerPosition )
-
GUIEditor_Window = {} GUIEditor_Label = {} GUIEditor_Grid = {} GUIEditor_Window[1] = guiCreateWindow(0.2275,0.2367,0.5362,0.5533,"GUI Stats",true) GUIEditor_Grid[1] = guiCreateGridList(261,36,158,280,false,GUIEditor_Window[1]) column = guiGridListAddColumn(GUIEditor_Grid[1],"Jugadores",0.80) GUIEditor_Label[1] = guiCreateLabel(10,58,233,23,"Nickname : \"\"",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[1],"clear-normal") GUIEditor_Label[2] = guiCreateLabel(10,91,233,23,"Location : \"\"",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[2],"clear-normal") GUIEditor_Label[3] = guiCreateLabel(10,125,233,23,"Money : \"\"",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[3],"clear-normal") GUIEditor_Label[4] = guiCreateLabel(10,157,233,23,"Skin : \"\"",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[4],"clear-normal") GUIEditor_Label[5] = guiCreateLabel(10,190,233,23,"Ping : \"\"",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[5],"clear-normal") GUIEditor_Label[6] = guiCreateLabel(10,223,233,23,"Dimension : \"\"",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[6],"clear-normal") GUIEditor_Label[7] = guiCreateLabel(10,255,233,23,"IP : \"\"",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[7],"clear-normal") guiSetVisible( GUIEditor_Window[1], false ) showCursor ( false ) function showGUI ( ) guiSetVisible ( GUIEditor_Window[1], not guiGetVisible ( GUIEditor_Window[1] ) ) showCursor ( guiGetVisible ( GUIEditor_Window[1] ) ) end bindKey ( "F2","down", showGUI ) function losLabels ( ) if ( column ) then for id, playeritem in ipairs ( getElementsByType "player" ) do local row = guiGridListAddRow ( GUIEditor_Grid[1] ) guiGridListSetItemText ( GUIEditor_Grid[1], row, column, getPlayerName ( playeritem ), false, false ) end end end addEventHandler ( "onClientResourceStart", resourceRoot, losLabels ) function setStats ( ) if ( source == GUIEditor_Grid[1] ) then local row, col = guiGridListGetSelectedItem ( source ) if ( row and col and row ~= -1 and col ~= -1 ) then local playername = guiGridListGetItemText ( source, row, col ) guiSetText ( GUIEditor_Label[1], "Nickname : ".. playername ) end end end addEventHandler ( "onClientGUIDoubleClick", root, setStats )
-
You must use the event: onPlayerJoin.
-
Use setCameraMatrix server side?
-
There are many topics related to online time on scoreboard, search for them.