Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Because it's commented out, so it won't work, obviously.
  2. function godmode ( ) local team = getPlayerTeam ( source ) if ( team and getTeamName ( team ) == "Freeroam" ) then executeCommandHandler ( "godmode", source ) end end addEventHandler ( "onPlayerLogin", getRootElement(), godmode ) That code doesn't work?
  3. Copy the code again.
  4. You are confusing me, I thought you wanted to show it on start, if not, use this: ----------------------------- -- Userpanel Design --------- ----------------------------- local ikony = { ["pohar"] = guiCreateStaticImage(0.09, 0.11, 0.27, 0.20, "img/1.png", true), -- Obdélník ["ovladac"] = guiCreateStaticImage(0.09, 0.32, 0.13, 0.20, "img/5.png", true), -- Čtverec ["sluchatka"] = guiCreateStaticImage(0.2296, 0.32, 0.13, 0.20, "img/7.png", true), -- Čtverec ["taska"] = guiCreateStaticImage(0.507, 0.11, 0.13, 0.20, "img/9.png", true), -- Čtverec ["fotak"] = guiCreateStaticImage(0.368, 0.11, 0.13, 0.20, "img/8.png", true), -- Čtverec ["posta"] = guiCreateStaticImage(0.368, 0.32, 0.27, 0.20, "img/6.png", true), -- Obdélník ["kalendar"] = guiCreateStaticImage(0.368, 0.53, 0.27, 0.20, "img/2.png", true), -- Obdélník ["kufr"] = guiCreateStaticImage(0.646, 0.53, 0.27, 0.20, "img/3.png", true), -- Obdélník ["statistika"] = guiCreateStaticImage(0.646, 0.32, 0.27, 0.20, "img/11.png", true), -- Obdélník ["cas"] = guiCreateStaticImage(0.646, 0.11, 0.27, 0.20, "img/10.png", true), -- Obdélník ["zpet"] = guiCreateStaticImage(0.09, 0.53, 0.27, 0.20, "img/4.png", true), -- Obdélník } guiSetEnabled (ikony["cas"], false ) guiSetEnabled (ikony["kalendar"], false ) local labely = { ["cas"] = guiCreateLabel(0.637, 0.13, 0.27, 0.19, "", true), ["datum"] = guiCreateLabel(0.37, 0.53, 0.27, 0.09, "", true), ["rok"] = guiCreateLabel(0.365, 0.62, 0.27, 0.09, "2013", true), } font = guiCreateFont( "cas.ttf", 75 ) guiSetFont( labely["cas"], font ) guiLabelSetHorizontalAlign(labely["cas"], "center", false) guiLabelSetVerticalAlign(labely["cas"], "center") font2 = guiCreateFont( "cas.ttf", 50 ) guiSetFont( labely["datum"], font2 ) guiLabelSetHorizontalAlign(labely["datum"], "center", false) guiLabelSetVerticalAlign(labely["datum"], "center") font3 = guiCreateFont( "cas.ttf", 60 ) guiSetFont( labely["rok"], font3 ) guiLabelSetHorizontalAlign(labely["rok"], "center", false) guiLabelSetVerticalAlign(labely["rok"], "center") -- Alphy -- guiSetAlpha ( ikony["pohar"], 0.75 ) guiSetAlpha ( ikony["ovladac"], 0.75 ) guiSetAlpha ( ikony["sluchatka"], 0.75 ) guiSetAlpha ( ikony["taska"], 0.75 ) guiSetAlpha ( ikony["fotak"], 0.75 ) guiSetAlpha ( ikony["posta"], 0.75 ) guiSetAlpha ( ikony["kalendar"], 1 ) guiSetAlpha ( ikony["kufr"], 0.75 ) guiSetAlpha ( ikony["statistika"], 0.75 ) guiSetAlpha ( ikony["cas"], 1 ) guiSetAlpha ( ikony["zpet"], 0.75 ) for _, gui in pairs ( ikony ) do guiSetVisible ( gui, false ) end for _, gui in pairs ( labely ) do guiSetVisible ( gui, false ) end -- Alphy -- addEventHandler ( "onClientMouseEnter", root, function ( aX, aY ) for _, gui in pairs ( ikony ) do if ( gui == source ) then guiSetAlpha ( source, 1 ) break end end end ) addEventHandler ( "onClientMouseLeave", root, function ( aX, aY ) for _, gui in pairs ( ikony ) do if ( gui == source ) then guiSetAlpha ( source, 0.75 ) break end end end ) local visible = false bindKey ("U", "down", function ( ) visible = ( not visible ) for _, gui in pairs ( ikony ) do guiSetVisible ( gui, visible ) end for _, gui in pairs ( labely ) do guiSetVisible ( gui, visible ) end if ( visible ) then local realTime = getRealTime ( ) local rTime = string.format ( "%02d:%02d", realTime.hour, realTime.minute) local realDate = getRealTime ( ) local rDate = string.format ( "%02d/%d", realDate.monthday, realDate.month+1) guiSetText ( ["cas"], rTime ) guiSetText ( ["datum"], rDate ) end end )
  5. ----------------------------- -- Userpanel Design --------- ----------------------------- local ikony = { ["pohar"] = guiCreateStaticImage(0.09, 0.11, 0.27, 0.20, "img/1.png", true), -- Obdélník ["ovladac"] = guiCreateStaticImage(0.09, 0.32, 0.13, 0.20, "img/5.png", true), -- Čtverec ["sluchatka"] = guiCreateStaticImage(0.2296, 0.32, 0.13, 0.20, "img/7.png", true), -- Čtverec ["taska"] = guiCreateStaticImage(0.507, 0.11, 0.13, 0.20, "img/9.png", true), -- Čtverec ["fotak"] = guiCreateStaticImage(0.368, 0.11, 0.13, 0.20, "img/8.png", true), -- Čtverec ["posta"] = guiCreateStaticImage(0.368, 0.32, 0.27, 0.20, "img/6.png", true), -- Obdélník ["kalendar"] = guiCreateStaticImage(0.368, 0.53, 0.27, 0.20, "img/2.png", true), -- Obdélník ["kufr"] = guiCreateStaticImage(0.646, 0.53, 0.27, 0.20, "img/3.png", true), -- Obdélník ["statistika"] = guiCreateStaticImage(0.646, 0.32, 0.27, 0.20, "img/11.png", true), -- Obdélník ["cas"] = guiCreateStaticImage(0.646, 0.11, 0.27, 0.20, "img/10.png", true), -- Obdélník ["zpet"] = guiCreateStaticImage(0.09, 0.53, 0.27, 0.20, "img/4.png", true), -- Obdélník } guiSetEnabled (ikony["cas"], false ) guiSetEnabled (ikony["kalendar"], false ) local realTime = getRealTime ( ) local rTime = string.format ( "%02d:%02d", realTime.hour, realTime.minute) local realDate = getRealTime ( ) local rDate = string.format ( "%02d/%d", realDate.monthday, realDate.month+1) local labely = { ["cas"] = guiCreateLabel(0.637, 0.13, 0.27, 0.19, rTime, true), ["datum"] = guiCreateLabel(0.37, 0.53, 0.27, 0.09, rDate, true), ["rok"] = guiCreateLabel(0.365, 0.62, 0.27, 0.09, "2013", true), } font = guiCreateFont( "cas.ttf", 75 ) guiSetFont( labely["cas"], font ) guiLabelSetHorizontalAlign(labely["cas"], "center", false) guiLabelSetVerticalAlign(labely["cas"], "center") font2 = guiCreateFont( "cas.ttf", 50 ) guiSetFont( labely["datum"], font2 ) guiLabelSetHorizontalAlign(labely["datum"], "center", false) guiLabelSetVerticalAlign(labely["datum"], "center") font3 = guiCreateFont( "cas.ttf", 60 ) guiSetFont( labely["rok"], font3 ) guiLabelSetHorizontalAlign(labely["rok"], "center", false) guiLabelSetVerticalAlign(labely["rok"], "center") -- Alphy -- guiSetAlpha ( ikony["pohar"], 0.75 ) guiSetAlpha ( ikony["ovladac"], 0.75 ) guiSetAlpha ( ikony["sluchatka"], 0.75 ) guiSetAlpha ( ikony["taska"], 0.75 ) guiSetAlpha ( ikony["fotak"], 0.75 ) guiSetAlpha ( ikony["posta"], 0.75 ) guiSetAlpha ( ikony["kalendar"], 1 ) guiSetAlpha ( ikony["kufr"], 0.75 ) guiSetAlpha ( ikony["statistika"], 0.75 ) guiSetAlpha ( ikony["cas"], 1 ) guiSetAlpha ( ikony["zpet"], 0.75 ) -- Alphy -- addEventHandler ( "onClientMouseEnter", root, function ( aX, aY ) for _, gui in pairs ( ikony ) do if ( gui == source ) then guiSetAlpha ( source, 1 ) break end end end ) addEventHandler ( "onClientMouseLeave", root, function ( aX, aY ) for _, gui in pairs ( ikony ) do if ( gui == source ) then guiSetAlpha ( source, 0.75 ) break end end end ) local visible = true bindKey ("U", "down", function ( ) visible = ( not visible ) for _, gui in pairs ( ikony ) do guiSetVisible ( gui, visible ) end for _, gui in pairs ( labely ) do guiSetVisible ( gui, visible ) end if ( visible ) then local realTime = getRealTime ( ) local rTime = string.format ( "%02d:%02d", realTime.hour, realTime.minute) local realDate = getRealTime ( ) local rDate = string.format ( "%02d/%d", realDate.monthday, realDate.month+1) guiSetText ( ["cas"], rTime ) guiSetText ( ["datum"], rDate ) end end )
  6. ----------------------------- -- Userpanel Design --------- ----------------------------- local ikony = { ["pohar"] = guiCreateStaticImage(0.09, 0.11, 0.27, 0.20, "img/1.png", true), -- Obdélník ["ovladac"] = guiCreateStaticImage(0.09, 0.32, 0.13, 0.20, "img/5.png", true), -- Čtverec ["sluchatka"] = guiCreateStaticImage(0.2296, 0.32, 0.13, 0.20, "img/7.png", true), -- Čtverec ["taska"] = guiCreateStaticImage(0.507, 0.11, 0.13, 0.20, "img/9.png", true), -- Čtverec ["fotak"] = guiCreateStaticImage(0.368, 0.11, 0.13, 0.20, "img/8.png", true), -- Čtverec ["posta"] = guiCreateStaticImage(0.368, 0.32, 0.27, 0.20, "img/6.png", true), -- Obdélník ["kalendar"] = guiCreateStaticImage(0.368, 0.53, 0.27, 0.20, "img/2.png", true), -- Obdélník ["kufr"] = guiCreateStaticImage(0.646, 0.53, 0.27, 0.20, "img/3.png", true), -- Obdélník ["statistika"] = guiCreateStaticImage(0.646, 0.32, 0.27, 0.20, "img/11.png", true), -- Obdélník ["cas"] = guiCreateStaticImage(0.646, 0.11, 0.27, 0.20, "img/10.png", true), -- Obdélník ["zpet"] = guiCreateStaticImage(0.09, 0.53, 0.27, 0.20, "img/4.png", true), -- Obdélník } guiSetEnabled (ikony["cas"], false ) guiSetEnabled (ikony["kalendar"], false ) local labely = { ["cas"] = guiCreateLabel(0.637, 0.13, 0.27, 0.19, "", true), ["datum"] = guiCreateLabel(0.37, 0.53, 0.27, 0.09, "", true), ["rok"] = guiCreateLabel(0.365, 0.62, 0.27, 0.09, "2013", true), } font = guiCreateFont( "cas.ttf", 75 ) guiSetFont( labely["cas"], font ) guiLabelSetHorizontalAlign(labely["cas"], "center", false) guiLabelSetVerticalAlign(labely["cas"], "center") font2 = guiCreateFont( "cas.ttf", 50 ) guiSetFont( labely["datum"], font2 ) guiLabelSetHorizontalAlign(labely["datum"], "center", false) guiLabelSetVerticalAlign(labely["datum"], "center") font3 = guiCreateFont( "cas.ttf", 60 ) guiSetFont( labely["rok"], font3 ) guiLabelSetHorizontalAlign(labely["rok"], "center", false) guiLabelSetVerticalAlign(labely["rok"], "center") -- Alphy -- guiSetAlpha ( ikony["pohar"], 0.75 ) guiSetAlpha ( ikony["ovladac"], 0.75 ) guiSetAlpha ( ikony["sluchatka"], 0.75 ) guiSetAlpha ( ikony["taska"], 0.75 ) guiSetAlpha ( ikony["fotak"], 0.75 ) guiSetAlpha ( ikony["posta"], 0.75 ) guiSetAlpha ( ikony["kalendar"], 1 ) guiSetAlpha ( ikony["kufr"], 0.75 ) guiSetAlpha ( ikony["statistika"], 0.75 ) guiSetAlpha ( ikony["cas"], 1 ) guiSetAlpha ( ikony["zpet"], 0.75 ) -- Alphy -- addEventHandler ( "onClientMouseEnter", root, function ( aX, aY ) for _, gui in pairs ( ikony ) do if ( gui == source ) then guiSetAlpha ( source, 1 ) break end end end ) addEventHandler ( "onClientMouseLeave", root, function ( aX, aY ) for _, gui in pairs ( ikony ) do if ( gui == source ) then guiSetAlpha ( source, 0.75 ) break end end end ) local visible = false bindKey ("U", "down", function ( ) visible = ( not visible ) for _, gui in pairs ( ikony ) do guiSetVisible ( gui, visible ) end for _, gui in pairs ( labely ) do guiSetVisible ( gui, visible ) end if ( visible ) then local realTime = getRealTime ( ) local rTime = string.format ( "%02d:%02d", realTime.hour, realTime.minute) local realDate = getRealTime ( ) local rDate = string.format ( "%02d/%d", realDate.monthday, realDate.month+1) guiSetText ( ["cas"], rTime ) guiSetText ( ["datum"], rDate ) end end )
  7. function check2 ( ) local _, anim = getPedAnimation ( localPlayer ) if ( anim == "CAR_fallout_LHS" ) then setElementHealth ( localPlayer, ( getElementHealth ( localPlayer ) - 5 ) ) fadeCamera ( false, 1, 255, 0, 0 ) setTimer ( fadeCamera, 150, 1, true ) end end setTimer ( check2, 100, 0 )
  8. What's the problem with it?
  9. for _, gui in pairs ( ikony ) and ( labely ) do You can't do that, you must loop each table individually.
  10. for _, gui in pairs ( ikony ) do guiSetVisible ( gui, false ) end
  11. Loop it the same way as for over-effect, but instead of set alpha, hide it.
  12. I don't get what do you mean.
  13. That's because all the other images are disabled by guiSetEnabled, and this one "kufr" is not because you made a typo when disabling it at line 35. ----------------------------- -- Userpanel Design --------- ----------------------------- function design () showCursor (true) local realTime = getRealTime ( ) local rTime = string.format ( "%02d:%02d", realTime.hour, realTime.minute) local realDate = getRealTime ( ) local rDate = string.format ( "%02d/%d", realDate.monthday, realDate.month+1) local ikony = { ["pohar"] = guiCreateStaticImage(0.09, 0.11, 0.27, 0.20, "img/1.png", true), -- Obdélník ["ovladac"] = guiCreateStaticImage(0.09, 0.32, 0.13, 0.20, "img/5.png", true), -- Čtverec ["sluchatka"] = guiCreateStaticImage(0.2296, 0.32, 0.13, 0.20, "img/7.png", true), -- Čtverec ["taska"] = guiCreateStaticImage(0.507, 0.11, 0.13, 0.20, "img/9.png", true), -- Čtverec ["fotak"] = guiCreateStaticImage(0.368, 0.11, 0.13, 0.20, "img/8.png", true), -- Čtverec ["posta"] = guiCreateStaticImage(0.368, 0.32, 0.27, 0.20, "img/6.png", true), -- Obdélník ["kalendar"] = guiCreateStaticImage(0.368, 0.53, 0.27, 0.20, "img/2.png", true), -- Obdélník ["kufr"] = guiCreateStaticImage(0.646, 0.53, 0.27, 0.20, "img/3.png", true), -- Obdélník ["statistika"] = guiCreateStaticImage(0.646, 0.32, 0.27, 0.20, "img/11.png", true), -- Obdélník ["cas"] = guiCreateStaticImage(0.646, 0.11, 0.27, 0.20, "img/10.png", true), -- Obdélník ["zpet"] = guiCreateStaticImage(0.09, 0.53, 0.27, 0.20, "img/4.png", true), -- Obdélník } guiSetEnabled ( ikony["pohar"], false ) guiSetEnabled ( ikony["ovladac"], false ) guiSetEnabled ( ikony["sluchatka"], false ) guiSetEnabled ( ikony["taska"], false ) guiSetEnabled ( ikony["fotak"], false ) guiSetEnabled ( ikony["posta"], false ) guiSetEnabled ( ikony["kalendar"], false ) guiSetEnabled ( ikony["kufr"], false ) guiSetEnabled ( ikony["statistika"], false ) guiSetEnabled ( ikony["cas"], false ) guiSetEnabled ( ikony["zpet"], false ) local labely = { ["cas"] = guiCreateLabel(0.637, 0.13, 0.27, 0.19, ""..rTime, true), ["datum"] = guiCreateLabel(0.37, 0.53, 0.27, 0.09, ""..rDate, true), ["rok"] = guiCreateLabel(0.365, 0.62, 0.27, 0.09, "2013", true), } font = guiCreateFont( "cas.ttf", 75 ) guiSetFont( labely["cas"], font ) guiLabelSetHorizontalAlign(labely["cas"], "center", false) guiLabelSetVerticalAlign(labely["cas"], "center") font2 = guiCreateFont( "cas.ttf", 50 ) guiSetFont( labely["datum"], font2 ) guiLabelSetHorizontalAlign(labely["datum"], "center", false) guiLabelSetVerticalAlign(labely["datum"], "center") font3 = guiCreateFont( "cas.ttf", 60 ) guiSetFont( labely["rok"], font3 ) guiLabelSetHorizontalAlign(labely["rok"], "center", false) guiLabelSetVerticalAlign(labely["rok"], "center") -- Alphy -- guiSetAlpha ( ikony["pohar"], 0.75 ) guiSetAlpha ( ikony["ovladac"], 0.75 ) guiSetAlpha ( ikony["sluchatka"], 0.75 ) guiSetAlpha ( ikony["taska"], 0.75 ) guiSetAlpha ( ikony["fotak"], 0.75 ) guiSetAlpha ( ikony["posta"], 0.75 ) guiSetAlpha ( ikony["kalendar"], 0.75 ) guiSetAlpha ( ikony["kufr"], 0.75 ) guiSetAlpha ( ikony["statistika"], 0.75 ) guiSetAlpha ( ikony["cas"], 0.75 ) guiSetAlpha ( ikony["zpet"], 0.75 ) -- Alphy -- function pohar() addEventHandler ( "onClientMouseEnter", root, function ( aX, aY ) for _, gui in pairs ( ikony ) do if ( gui == source ) then guiSetAlpha ( source, 1 ) break end end end ) addEventHandler ( "onClientMouseLeave", root, function ( aX, aY ) for _, gui in pairs ( ikony ) do if ( gui == source ) then guiSetAlpha ( source, 0.75 ) break end end end ) addEventHandler ( "onClientGUIClick", ikony["pohar"], btn2, false ) end function btn2(button) if button == "left" then outputChatBox ("xaxax") end end addCommandHandler ("up", pohar ) end addCommandHandler ("up", design ) With that code, none will work now, you can't do the over-effect if the images are disabled.
  14. The chat is not loged by default, freeroam script logs it.
  15. vehWnd = guiCreateWindow(324, 200, 468, 387, "Police Vehicle Spawner", false) guiWindowSetSizable(vehWnd, false) guiSetVisible(vehWnd, false) carsG = guiCreateGridList(59, 137, 131, 220, false, vehWnd) guiGridListAddColumn(carsG, "Vehicle", 0.9) vehicles = { {"Police Car", 596}, {"Police Ranger", 599}, } for i,vehicles in ipairs(vehicles) do row = guiGridListAddRow(carsG) guiGridListSetItemText(carsG, row, 1, tostring(vehicles[1]), false, false) guiGridListSetItemData(carsG, row, 1, tostring(vehicles[2])) end guiGridListAddRow(carsG) spawnbtn = guiCreateButton(205, 314, 125, 43, "Spawn", false, vehWnd) desc = guiCreateMemo(43, 33, 384, 94, "Here you can spawn yourself a vehicle!\n", false, vehWnd) guiMemoSetReadOnly(desc, true) local vehmarker = createMarker ( 1555.4000244141, -1610.9000244141,12.300000190735, "cylinder", 2.5, 100, 149, 237, 170 ) function spawnStart(hitElement) if getElementType(hitElement) == "player" and (hitElement == localPlayer) then if not guiGetVisible(vehWnd) then guiSetVisible(vehWnd, true) showCursor(true) end end end addEventHandler("onClientMarkerHit", vehmarker, spawnStart) function spawnVeh() if ( source == spawnbtn ) then local row, col = guiGridListGetSelectedItem( carsG ) local id = guiGridListGetItemData( carsG, row, col ) triggerServerEvent("spawn", getLocalPlayer(), id) guiSetVisible(jobWnd,false) showCursor(false) end end addEventHandler("onClientGUIClick",root,spawnVeh)
  16. addEventHandler ( "onClientMouseEnter", root, function ( aX, aY ) for _, gui in pairs ( ikony ) do if ( gui == source ) then guiSetAlpha ( source, 1 ) break end end end ) addEventHandler ( "onClientMouseLeave", root, function ( aX, aY ) for _, gui in pairs ( ikony ) do if ( gui == source ) then guiSetAlpha ( source, 0.75 ) break end end end ) Is that what you did?
  17. That's because you are trying to loop the elements, not the table. for key,gui in pairs (ikony["pohar"]) and (ikony["ovladac"]) and (ikony["sluchatka"]) and (ikony["taska"]) and (ikony["fotak"]) and (ikony["posta"]) and (ikony["kalendar"]) and (ikony["statistika"]) and (ikony["cas"]) and (ikony["zpet"]) do Should be: for key, gui in pairs ( ikony ) do
  18. That should also work, as far as I know. P.S: You got a typo there: "extecuteCommandHandler " instead of "executeCommandHandler".
  19. Does the script output any kind of error at the debugscript?
  20. It could be that the client side is not yet loaded.
  21. Get the selected item from your gridlist using: guiGridListGetSelectedItem then get the item data, which is the model: guiGridListGetItemData then just send the result of that to the server side at triggerServerEvent.
  22. local realTime = getRealTime ( ) local rTime = string.format ( "%02d:%02d:%02d", realTime.hour, realTime.minute, realTime.second ) outputChatBox ( "The time is: ".. rTime )
×
×
  • Create New...