Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Here: function createLoginWindow You have missing parentheses. Should be: function createLoginWindow ( )
  2. Vehicle mod: https://community.multitheftauto.com/ind ... ls&id=5776 DONE
  3. I'm not sure, but if I'm right, you don't have to import anything when using MTA paradise gamemode by Mabako, you only have to setup the MySQL server and configure the connection details.
  4. hospitals = { { 1173.2894287109, -1323.6711425781, 15.39380645752, -0 }, { 2038.0920410156, -1411.5549316406, 17.1640625, -0 } } addEventHandler ( "onResourceStart", resourceRoot, function ( ) for i, player in ipairs ( getElementsByType ( "player" ) ) do spawn ( player ) end end ) function spawn ( player, takeMoney ) local x, y, z, rot = unpack ( hospitals [ math.random ( #hospitals ) ] ) spawnPlayer ( player, x, y, z, rot, math.random ( 19, 25 ) ) fadeCamera ( player, true ) setCameraTarget ( player, player ) setPlayerTeam ( player, nil ) if ( takeMoney ) then takePlayerMoney ( player, 150 ) end end addEventHandler ( "onPlayerLogin", root, function ( ) spawn ( source ) end ) addEventHandler ( "onPlayerWasted", root, function ( ) setTimer ( spawnWasted, 1800, 1, source, true ) end )
  5. You may search here: https://community.multitheftauto.com/ There are some of them.
  6. I don't think there's such thing in the MTA community. You can search anyway: https://community.multitheftauto.com/
  7. Sera porque no tiene sentido?
  8. local towary = { { "Odpady", "Trociny", 0, 100, 250 }, { "Odpady", "Puszki", 1, 200, 400 }, { "Odpady", "Butelki", 2, 400, 550 } } local towar = { } local kupuj = { } local x,y = guiGetScreenSize ( ) local playerPoints = 1 function closegui ( ) guiSetVisible ( oknotow, false ) showCursor ( false ) end function zakup ( ) for k, v in ipairs ( towary ) do if ( source == kupuj [ k ] ) then outputChatBox ( "Zaladowales towar o id ".. k ) end end end oknotow = guiCreateWindow((x-500)/2,(y-350)/2,500,350,"System towarów",false) guiSetVisible ( oknotow, false ) info1 = guiCreateLabel (0.06,0.08,0.7,0.3,"Towar", true, oknotow) info2 = guiCreateLabel (0.22,0.08,0.7,0.3,"Ilosc score", true, oknotow) info3 = guiCreateLabel (0.45,0.08,0.7,0.3,"Min. suma", true, oknotow) info4 = guiCreateLabel (0.67,0.08,0.7,0.3,"Max. suma", true, oknotow) guiSetFont ( info1, "default-bold-small" ) guiSetFont ( info2, "default-bold-small" ) guiSetFont ( info3, "default-bold-small" ) guiSetFont ( info4, "default-bold-small" ) for k, v in ipairs ( towary ) do towar[1] = guiCreateLabel (0.03,0.1+0.08*k,0.2,0.1,v[2],true,oknotow) towar[2] = guiCreateLabel (0.27,0.1+0.08*k,0.2,0.1,v[3],true,oknotow) towar[3] = guiCreateLabel (0.46,0.1+0.08*k,0.2,0.1,v[4].."$",true,oknotow) towar[4] = guiCreateLabel (0.68,0.1+0.08*k,0.2,0.1,v[5].."$",true,oknotow) kupuj[k] = guiCreateButton (0.83,0.095+0.08*k,0.13,0.06,"Zaladuj",true,oknotow) addEventHandler ( "onClientGUIClick", kupuj [ k ], zakup, false ) end zamknij = guiCreateButton (0.45,0.9,0.15,0.07,"Zamknij",true,oknotow) addEventHandler ( "onClientGUIClick", zamknij, closegui ) for k, v in ipairs ( towary ) do guiSetEnabled ( kupuj [ k ], ( playerPoints >= v [ 3 ] ) ) end for k, v in ipairs ( towary ) do guiSetEnabled ( kupuj [ k ], ( playerPoints >= v [ 3 ] ) ) end You must use that when you open the GUI.
  9. You're welcome. And, I don't plan on updating my gang system, it was meant to be a basic gang system.
  10. JobGUI = guiCreateWindow(249,240,307,176,"Job GUI",false) guiWindowSetSizable(JobGUI,false) guiWindowSetMovable(JobGUI,false) guiSetAlpha(JobGUI,0.89999997615814) guiSetVisible(JobGUI, false) EndStartJ = guiCreateButton(26,37,254,58,"End/start shift",false,JobGUI) QuitJ = guiCreateButton(26,98,254,58,"Quit job",false,JobGUI) function ShowGUI ( ) guiSetVisible ( JobGUI, not guiGetVisible ( JobGUI ) ) showCursor ( guiGetVisible ( JobGUI ) ) end bindKey("F2","down", ShowGUI) function shift() triggerServerEvent("jobShift", localPlayer) end addEventHandler("onClientGUIClick", EndStartJ, shift) function hideGUI() guiSetVisible(JobGUI, false) showCursor(false) end addEvent("hide", true) addEventHandler("hide",root, hideGUI)
  11. Well, then you should first store them, then you can disable the buttons.
  12. Do you have these "points" stored somewhere?
  13. Seems like you have set the client side script as server side in the meta.xml.
  14. local pArea = createRadarArea ( 2130, 630, 200, 100, 0, 255, 0, 175 ) local pCuboid = createColCuboid ( 2133.1950683594, 633.66455078125, 10, 197.5, 92, 30 ) addEventHandler ( 'onColShapeHit', root, function ( p ) if ( getElementData ( p, "gang" ) ) then if ( source == pCuboid ) then outputChatBox ( "------||~ INFO ~||------", p, 0, 255, 0 ) outputChatBox ( "Turf owners: coming soon!", p, 255, 255, 0 ) outputChatBox ( "Taken time: 10minutes.", p, 255, 255, 0 ) outputChatBox ( "Wait 10min to take turf.", p, 255, 255, 0 ) outputChatBox ( "------||~ END ~||------", p, 255, 0, 0 ) setRadarAreaFlashing ( pArea, true ) local pGang = getElementData ( p, "gang" ) setTimer ( function ( ) setRadarAreaColor ( pArea, iR2, iG2, iB2, 100 ) givePlayerMoney ( p, 4000 ) outputChatBox ( "Congratulations, #FFFF00 you have taken the turf!", p, 0, 255, 0, true ) setRadarAreaFlashing ( pArea, false ) end ,2000, 1 ) end else outputChatBox ( "Get in a group first!", p, 255, 0, 0 ) end end ) addEventHandler ( 'onColShapeLeave', root, function ( ) if ( source == pCuboid ) then setRadarAreaFlashing ( pArea, false ) end end ) Works ( tested ).
  15. guiGridListGetSelectedItem doesn't return the text of the selected item, it returns the row and column index of the selected item. function selecteditem ( ) local row, col = guiGridListGetSelectedItem ( UsrList ) if ( row and col and row ~= -1 and col ~= -1 ) then local playerName = guiGridListGetItemText ( UsrList, row, 1 ) triggerServerEvent ( "selector:query", localPlayer, playerName ) end end
  16. --******************************************** --******************************************** userPanelWindow = guiCreateWindow(96,39,614,524,"Party ",false) guiSetVisible (userPanelWindow, false) memo = guiCreateMemo(131,76,464,351,"",false,userPanelWindow) playerNameEdit = guiCreateEdit(126,39,475,32,"",false,userPanelWindow) Button1 = guiCreateButton(130,475,109,37,"Add",false,userPanelWindow) Button2 = guiCreateButton(252,475,109,37,"Send",false,userPanelWindow) Button3 = guiCreateButton(378,475,100,36,"Clear",false,userPanelWindow) Button4 = guiCreateButton(494,475,100,36,"Close",false,userPanelWindow) edit2 = guiCreateEdit(126,435,475,32,"",false,userPanelWindow) playerGridList = guiCreateGridList(10,28,106,487,false,userPanelWindow) playersColumn = guiGridListAddColumn(playerGridList,"Players",0.85) function xx ( ) local playerName = getPlayerName ( localPlayer ) guiSetVisible ( userPanelWindow, not guiGetVisible ( userPanelWindow ) ) showCursor ( guiGetVisible ( userPanelWindow ) ) guiGridListClear ( playerGridList ) for id, plaItem in ipairs ( getElementsByType ( "player" ) ) do row = guiGridListAddRow ( playerGridList ) guiGridListSetItemText ( playerGridList, row, playersColumn, getPlayerName ( plaItem ), false, false ) end end bindKey ( "F1", "down", xx ) function setGUI ( ) local row, col = guiGridListGetSelectedItem ( playerGridList ) if ( row and col and row ~= -1 and col ~= -1 ) then local playerName = guiGridListGetItemText ( playerGridList, row, 1 ) guiSetText ( playerNameEdit, playerName ) end end addEventHandler( "onClientGUIDoubleClick", playerGridList, setGUI, false ) addEvent ( "onClient", true ) addEventHandler ( "onClient", getRootElement(), function ( chat, msg, name ) guiSetText ( memo, name ..": ".. msg .."\n".. chat ) end ) addEventHandler ( "onClientGUIClick", root, function ( ) if ( source == Button1 ) then local playerNick = guiGetText ( playerNameEdit ) local msg = guiGetText ( edit2 ) triggerServerEvent ( "sendmsg", localPlayer, playerNick, msg ) elseif ( source == Button2 ) then local chat = guiGetText ( memo ) local msg = guiGetText ( edit2 ) triggerServerEvent ( "onSend", localPlayer, chat, msg ) guiSetText ( edit2, "" ) showCursor ( true ) elseif ( source == Button3 ) then guiSetText ( memo, "" ) elseif ( source == Button4 ) then guiSetVisible ( userPanelWindow, false ) showCursor ( false ) end end )
  17. Errors or anything at debugscript?
  18. https://community.multitheftauto.com/ind ... ls&id=1030 That could work, maybe.
  19. You can draw texts and so on at objects using shaders.
  20. As I though, freeroam has a chat script as well.
×
×
  • Create New...