Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. That's a table, but still is better than variables, but incorrect though. local originalPosition = { } function botton() if source == GUIEditor_Button[2] then originalPosition = { getElementPosition ( localPlayer ) } guiSetVisible( GUIEditor_Window[1], false) showCursor ( false ) setCameraTarget ( localPlayer ) setElementDimension ( localPlayer, 0 ) setElementFrozen ( localPlayer, false ) setElementPosition ( localPlayer, 1654.16162, -1661.63123, 21.9 ) end end addEventHandler ( "onClientGUIClick", root, botton ) To set the position again you can do: setElementPosition ( localPlayer, unpack ( originalPosition ) )
  2. Save the original position on variables.
  3. function markerHit ( hitPlayer ) if ( hitPlayer == localPlayer and source == marker ) then guiSetVisible ( GUIEditor_Window[1], true ) showCursor ( true ) triggerServerEvent ( "cm", getLocalPlayer() ) setElementDimension( localPlayer, 2 ) ped = createPed ( tonumber ( guiGetText ( GUIEditor_Edit[1] ) ) or 0, 1654.16162, -1661.63123, 21.9 ) -- If no skin was given, it'll create it with CJ skin. if ( ped ) then setElementFrozen ( ped, true ) setElementDimension( ped, 2 ) end end end addEventHandler ( "onClientMarkerHit", root, markerHit )
  4. function markerHit ( hitPlayer ) if ( hitPlayer == localPlayer and source == marker ) then guiSetVisible( GUIEditor_Window[1], true ) showCursor(true) triggerServerEvent ( "cm", getLocalPlayer() ) ped = createPed( 0, 1654.16162, -1661.63123, 21.9 ) -- Change '0' to your skin ID. setElementFrozen ( ped, true ) setElementDimension( ped, 2 ) end end addEventHandler ( "onClientMarkerHit", root, markerHit )
  5. -- script.lua: local ID = 287 addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) setTimer ( function ( ) engineImportTXD ( engineLoadTXD ( "skin.txd", ID ), ID ) engineReplaceModel ( engineLoadDFF ( "skin.dff", ID ), ID ) end ,1000, 1 ) end ) -- meta.xml: "Castillo" type="script" version="1.0" name="Skin replacement" /> https://wiki.multitheftauto.com/wiki/Resources
  6. Change it to "root" and remove "source" from function name.
  7. Castillo

    Need help

    Topic moved to "Support for MTASA 1.x > Server".
  8. getLocalPlayer is client side only, you're using it server side.
  9. Server side. @seb: Your script would output the message to everyone, since you're using "client" as player element instead of "thePlayer".
  10. That'll never work GanJaRulez. function getPos ( thePlayer ) local x, y, z = getElementPosition ( thePlayer ) outputChatBox( "ur pos is ( ".. x ..", ".. y ..", ".. z .." ) ", thePlayer ) end addCommandHandler ( "getpos", getPos )
  11. Stop the resource "play", that includes "Freeroam ( F1 )" and the vehicles.
  12. Castillo

    Find edit

    pList = guiCreateGridList ( 17, 59, 166, 327, false, WinSend ) column = guiGridListAddColumn ( pList, 'Player', 0.85 ) onUpdateMoneyPlayerList = function ( ) if ( column ) then for _, player in ipairs ( getElementsByType 'player' ) do local row = guiGridListAddRow ( pList ) guiGridListSetItemText ( pList, row, column, getPlayerName ( player ), false, false ) end elseif ( source == bhsh ) then guiGridListClear ( pList ) local sName = guiGetText ( source ) if ( sName ~= '' ) then for _, player in ipairs ( getElementsByType 'player' ) do if string.find ( getPlayerName ( player ):lower ( ), sName:lower ( ), 1, true ) then local row = guiGridListAddRow ( pList ) guiGridListSetItemText ( pList, row, column, getPlayerName ( player ), false, false ) end end end end end addEventHandler ( 'onClientPlayerChangeNick', root, onUpdateMoneyPlayerList ) addEventHandler ( 'onClientPlayerQuit', root, onUpdateMoneyPlayerList ) addEventHandler ( 'onClientPlayerJoin', root, onUpdateMoneyPlayerList ) addEventHandler ( 'onClientResourceStart', resourceRoot, onUpdateMoneyPlayerList ) function click ( ) local row, col = guiGridListGetSelectedItem ( pList ) if ( row and col and row ~= -1 and col ~= -1 ) then local playerName = guiGridListGetItemText ( pList, row, col ) guiSetText ( plnmedit, playerName ) end end addEventHandler ( 'onClientGUIClick', pList, click )
  13. La verdad es que vos nomas hiciste el GUI y para crear el marker, pero asi no funciona esto. Te sugiero que uses un script de la comunidad y luego cuando tengas mas experiencia creas el tuyo.
  14. Ah, ahora que veo todo tu script me doy cuenta de que estas agregando el evento antes de crear el marker. GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Edit = {} GUIEditor_Window[1] = guiCreateWindow(0.3535,0.2417,0.5498,0.605,"GUI Editor De Casas",true) guiWindowSetMovable(GUIEditor_Window[1],false) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_Label[1] = guiCreateLabel(18,47,169,18,"Coordinadas donde se entrara",false,GUIEditor_Window[1]) GUIEditor_Edit[1] = guiCreateEdit(17,68,166,26,"",false,GUIEditor_Window[1]) guiEditSetReadOnly(GUIEditor_Edit[1],true) GUIEditor_Edit[2] = guiCreateEdit(17,94,166,26,"",false,GUIEditor_Window[1]) guiEditSetReadOnly(GUIEditor_Edit[2],true) GUIEditor_Edit[3] = guiCreateEdit(17,120,166,26,"",false,GUIEditor_Window[1]) guiEditSetReadOnly(GUIEditor_Edit[3],true) GUIEditor_Label[2] = guiCreateLabel(18,179,228,18,"Coordinadas donde se teletrans. a la casa",false,GUIEditor_Window[1]) GUIEditor_Edit[4] = guiCreateEdit(17,196,166,26,"",false,GUIEditor_Window[1]) guiEditSetReadOnly(GUIEditor_Edit[4],true) GUIEditor_Edit[5] = guiCreateEdit(17,222,166,26,"",false,GUIEditor_Window[1]) guiEditSetReadOnly(GUIEditor_Edit[5],true) GUIEditor_Edit[6] = guiCreateEdit(17,248,166,26,"",false,GUIEditor_Window[1]) guiEditSetReadOnly(GUIEditor_Edit[6],true) GUIEditor_Label[3] = guiCreateLabel(349,47,169,18,"Coordinadas donde se saldra",false,GUIEditor_Window[1]) GUIEditor_Edit[7] = guiCreateEdit(347,68,166,26,"",false,GUIEditor_Window[1]) guiEditSetReadOnly(GUIEditor_Edit[7],true) GUIEditor_Edit[8] = guiCreateEdit(348,94,166,26,"",false,GUIEditor_Window[1]) guiEditSetReadOnly(GUIEditor_Edit[8],true) GUIEditor_Edit[9] = guiCreateEdit(349,120,166,26,"",false,GUIEditor_Window[1]) guiEditSetReadOnly(GUIEditor_Edit[9],true) GUIEditor_Label[4] = guiCreateLabel(308,179,216,19,"Coordinadas donde se saldra al exterior",false,GUIEditor_Window[1]) GUIEditor_Edit[10] = guiCreateEdit(347,197,166,26,"",false,GUIEditor_Window[1]) guiEditSetReadOnly(GUIEditor_Edit[10],true) GUIEditor_Edit[11] = guiCreateEdit(348,223,166,26,"",false,GUIEditor_Window[1]) guiEditSetReadOnly(GUIEditor_Edit[11],true) GUIEditor_Edit[12] = guiCreateEdit(349,248,166,26,"",false,GUIEditor_Window[1]) guiEditSetReadOnly(GUIEditor_Edit[12],true) GUIEditor_Label[5] = guiCreateLabel(203,35,125,16,"GUI Creada By ElMota",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[5],255,255,0) guiSetFont(GUIEditor_Label[5],"default-bold-small") GUIEditor_Button[1] = guiCreateButton(18,148,163,27,"Obtener Posicion",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(351,148,163,27,"Obtener Posicion",false,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(17,274,163,27,"Obtener Posicion",false,GUIEditor_Window[1]) GUIEditor_Button[4] = guiCreateButton(351,274,163,27,"Obtener Posicion",false,GUIEditor_Window[1]) GUIEditor_Button[5] = guiCreateButton(207,324,110,30,"Crear Casa",false,GUIEditor_Window[1]) GUIEditor_Window[2] = guiCreateWindow(0.1523,0.245,0.2021,0.3283,"GUI Extras",true) guiWindowSetMovable(GUIEditor_Window[2],false) guiWindowSetSizable(GUIEditor_Window[2],false) GUIEditor_Label[6] = guiCreateLabel(9,41,71,20,"Dimension",false,GUIEditor_Window[2]) GUIEditor_Edit[13] = guiCreateEdit(77,38,119,25,"",false,GUIEditor_Window[2]) GUIEditor_Label[7] = guiCreateLabel(9,76,71,20,"World",false,GUIEditor_Window[2]) GUIEditor_Edit[14] = guiCreateEdit(77,73,119,25,"",false,GUIEditor_Window[2]) GUIEditor_Label[8] = guiCreateLabel(9,112,71,20,"Costo",false,GUIEditor_Window[2]) GUIEditor_Edit[15] = guiCreateEdit(77,106,119,25,"",false,GUIEditor_Window[2]) guiSetVisible(GUIEditor_Window[1], false) guiSetVisible(GUIEditor_Window[2], false) showCursor(false) local me = getLocalPlayer(); addEventHandler( 'onClientGUIClick', root, function( btn ) if btn ~= 'left' then return false; end; if source == GUIEditor_Button[1] then local x, y, z = getElementPosition( me ); guiSetText( GUIEditor_Edit[1], x ); guiSetText( GUIEditor_Edit[2], y ); guiSetText( GUIEditor_Edit[3], z ); elseif source == GUIEditor_Button[3] then local x, y, z = getElementPosition( me ); guiSetText( GUIEditor_Edit[4], x ); guiSetText( GUIEditor_Edit[5], y ); guiSetText( GUIEditor_Edit[6], z ); elseif source == GUIEditor_Button[2] then local x, y, z = getElementPosition( me ); guiSetText( GUIEditor_Edit[7], x ); guiSetText( GUIEditor_Edit[8], y ); guiSetText( GUIEditor_Edit[9], z ); elseif source == GUIEditor_Button[4] then local x, y, z = getElementPosition( me ); guiSetText( GUIEditor_Edit[10], x ); guiSetText( GUIEditor_Edit[11], y ); guiSetText( GUIEditor_Edit[12], z ); elseif source == GUIEditor_Button[5] then marker = createMarker( tonumber(guiGetText( GUIEditor_Edit[1] )),tonumber(guiGetText( GUIEditor_Edit[2] )),tonumber(guiGetText( GUIEditor_Edit[3] ) - 1 ) , "cylinder", 1.7, 0, 170, 0, 90 ) -----Como vez aqui ta el "marker" marker2 = createMarker( tonumber(guiGetText( GUIEditor_Edit[7] )),tonumber(guiGetText( GUIEditor_Edit[8] )),tonumber(guiGetText( GUIEditor_Edit[9] ) - 1 ) , "cylinder", 1.7, 255, 255, 255, 60 ) guiGetText( GUIEditor_Edit[11] ); guiGetText( GUIEditor_Edit[12] ); end; end ); function ver ( ) guiSetVisible ( GUIEditor_Window[1], not guiGetVisible ( GUIEditor_Window[1] ) ) showCursor ( guiGetVisible ( GUIEditor_Window[1] ) ) guiSetVisible ( GUIEditor_Window[2], not guiGetVisible ( GUIEditor_Window[2] ) ) showCursor ( guiGetVisible ( GUIEditor_Window[2] ) ) end bindKey ( "n","down", ver ) function markerHit ( hitPlayer ) if ( hitPlayer == localPlayer and source == marker ) then GUIEditor_Window[1] = guiCreateWindow(0.6006,0.4867,0.1992,0.45,"GUI Casas",true) GUIEditor_Label[1] = guiCreateLabel(25,36,262,20,"Dueño de la casa : \"\"",false,GUIEditor_Window[1]) GUIEditor_Label[2] = guiCreateLabel(25,58,231,19,"Precio : \"\"",false,GUIEditor_Window[1]) GUIEditor_Button[1] = guiCreateButton(9,107,179,30,"Comprar Casa",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(9,107,179,30,"Comprar Casa",false,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(9,141,179,30,"Vender Casa",false,GUIEditor_Window[1]) GUIEditor_Button[4] = guiCreateButton(9,175,179,30,"Bloquear Casa",false,GUIEditor_Window[1]) GUIEditor_Button[5] = guiCreateButton(10,208,179,32,"Entrar a la Casa",false,GUIEditor_Window[1]) end end addEventHandler ( "onClientMarkerHit", root, markerHit )
  15. I've tested your code with a object moving by moveObject and it didn't output anything, maybe is bugged?
  16. Wrong, you can remove gangs via your gang panel or via the exported functions of the resource. exports [ "gang_system" ]:removeGang ( gangName )
  17. This is not CIT server forums, you may go to: http://cit2.net.
  18. Pero mira que ahi dice "maker", no "marker".
  19. Castillo

    Logout

    Acordate de darle al recurso acceso a la funcion "kickPlayer" en el "acl.xml".
  20. function createLoginWindow() Fenster = guiCreateWindow(421,138,675,486,"Login",false) LoginButton = guiCreateButton(72,404,159,58,"Login",false,Fenster) RegButton = guiCreateButton(285,404,159,58,"Registrieren",false,Fenster) Box1 = guiCreateEdit(33,90,208,31,"",false,Fenster) Box2 = guiCreateEdit(34,147,208,31,"",false,Fenster) Label1 = guiCreateLabel(42,72,111,15,"Benutzername:",false,Fenster) Label2 = guiCreateLabel(39,128,111,15,"Passwort:",false,Fenster) guiSetVisible(Fenster, false) end function createRegWindow() Reg_window = guiCreateWindow(364,178,689,440,"Registrieren!",false) Send_Button = guiCreateButton(34,371,161,52,"Abschicken!",false,Reg_window) Name_Feld = guiCreateEdit(27,60,168,28,"",false,Reg_window) Passwort_Feld = guiCreateEdit(26,113,168,28,"",false,Reg_window) Passwort2_Feld = guiCreateEdit(28,166,168,28,"",false,Reg_window) guiCreateLabel(38,44,97,13,"Name:",false,Reg_window) guiCreateLabel(35,149,124,16,"Passwort bestätigen",false,Reg_window) guiCreateLabel(33,96,97,13,"Passwort:",false,Reg_window) guiCreateStaticImage(337,80,341,280,"images/mtalogo.png",false,Reg_window) guiSetVisible(Reg_window, false) end function thisResourceStarts() createLoginWindow() createRegWindow() outputChatBox("Willkommen!!!") if (Fenster ~= nil) then guiSetVisible(Fenster, true) showCursor(true) guiSetInputEnabled(true) else outputChatBox("An unexpected error has occurred and the log in GUI has not been created.") end end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), thisResourceStarts) function onButtonClick ( button, state ) if ( button == "left" and state == "up" ) then if ( source == LoginButton ) then local username = guiGetText ( Box1 ) local password = guiGetText ( Box2 ) if ( username ~= "" and password ~= "" ) then triggerServerEvent ( "submitLogin", getRootElement(), username, password ) guiSetInputEnabled ( false ) guiSetVisible ( Fenster, false ) showCursor ( false ) else outputChatBox("Bitte fülle die Felder aus!") end elseif ( source == RegButton ) then guiSetVisible ( Reg_window, true ) elseif ( source == Send_Button ) then local username = guiGetText ( Name_Feld ) local password = guiGetText ( Passwort_Feld ) local passwordConfirm = guiGetText ( Passwort2_Feld ) if ( username ~= "" and password ~= "" and passwordConfirm ~= "" ) then triggerServerEvent ( "submitRegister", getRootElement(), username, password, passwordConfirm ) else outputChatBox("Bitte fülle die Felder aus!") end end end end addEventHandler ( "onClientGUIClick", root, onButtonClick )
  21. Well, you only have to create a second function to register the player instead of login.
×
×
  • Create New...