Jump to content

Alen141

Members
  • Posts

    105
  • Joined

  • Last visited

Everything posted by Alen141

  1. Alen141

    Police /tie

    you can use unbindKey
  2. Alen141

    XML Files

    can you suggest me any resource to use as an example to guide me?
  3. localPlayer is not defined, use getLocalPlayer() or define localPlayer local localPlayer = getLocalPlayer()
  4. Alen141

    XML Files

    Hey guys I need help ,again, more like tip.. How to learn creating xml files in wich I can edit and make things as : ---- Making some stuff client and server side and then make it easier to create( perhaps respawn points ) ----- " x, y, z " /> ---- or for jobs ---- "NAMEHERE" description = "" skin= "" pos = "" /> ---- Not exactly like that, but kind of like that
  5. Hey guys how are you today? Good, me too but I have a bit of a situation going on with my script here. So the problem is following: [+] When I hit the marker first time it shows all correct : health, money, job, location! ----> PROBLEM ---->[-] When I hit the marker for second time it dosen't update it just creates another label, but I want to know if it's possible to update label or some way to delete it! function openGUI( ) local playerX, playerY, playerZ = getElementPosition ( localPlayer ) local playerZoneName = getZoneName ( playerX, playerY, playerZ ) local health = getElementHealth ( getLocalPlayer() ) local class = getElementData ( getLocalPlayer(), "Job" ) local cash = getPlayerMoney( getLocalPlayer() ) guiSetVisible(reWnd, true) showCursor(true) money = guiCreateLabel(13, 93, 200, 19, "Money : "..cash.."$", false, reWnd) job = guiCreateLabel(239, 93, 200, 19, "Job : "..class.."", false, reWnd) hp = guiCreateLabel(239, 55, 200, 19, "Health : "..health.."%", false, reWnd) loc = guiCreateLabel(13, 55, 200, 19, "Location : "..playerZoneName.."", false, reWnd) end addEventHandler("onClientPickupHit", disk, openGUI) addEventHandler("onClientPickupHit", disk1, openGUI) addEventHandler("onClientPickupHit", disk2, openGUI)
  6. hahaha thx, when I used function from my job script
  7. window is still not closing from some reason but I can move
  8. 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 name = guiGridListGetItemText( carsG, row, col ) if name == "Police Car" then local id = 596 triggerServerEvent("spawn", getLocalPlayer(), id) guiSetVisible(jobWnd,false) showCursor(false) elseif name == "Police Ranger" then local id = 599 triggerServerEvent("spawn", getLocalPlayer(), id) guiSetVisible(jobWnd,false) showCursor(false) end end end addEventHandler("onClientGUIClick",root,spawnVeh) i've done it but now window stays open, do you know why?
  9. how to tell client to send "id" to server side EDIT : how to tell client that "id" is second value
  10. Alen141

    help

    ..... EDIT: Code was wrong ...
  11. Hey guys,I want to make car spawner gui, like some servers have but I have problems creating vehicle! My Clientside: 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) guiGridListSetItemText(carsG, 0, 1, "Car Name", false, false) 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 triggerServerEvent("spawn", getLocalPlayer()) guiSetVisible(jobWnd,false) showCursor(false) end end addEventHandler("onClientGUIClick",root,spawnVeh) My Server Side: function spawnVeh(id) local playerTeam = getPlayerTeam ( source ) local teamName = ( playerTeam and getTeamName ( playerTeam ) or "" ) if ( teamName == "Police" ) then local x,y,z = getElementPosition(source) createVehicle(id,x+5,y,z) end end addEvent("spawn", true) addEventHandler("spawn",root,spawnVeh)
  12. just enable control again toggleControl ( source, "fire", true )---- this will enable you to shoot again
  13. add me on skype, i'll help you my skype name = alenalen1411
  14. thanks , completely forgot to put that line
  15. So I was working on my Job GUI, and I finished GUI fully ( from buttons to setting team, closing, opening ) but my problem is that gui shows when resource start and not only on marker hit : script_c [client_side] : jobWnd = guiCreateWindow(422, 250, 511, 272, "Job GUI v0.1", false) guiWindowSetSizable(jobWnd, false) desc = guiCreateMemo(9, 20, 492, 117, "Description: ....", false, jobWnd) guiMemoSetReadOnly(desc, true) yesbtn = guiCreateButton(64, 215, 156, 47, "Take Job", false, jobWnd) nobtn = guiCreateButton(266, 215, 156, 47, "Cancel", false, jobWnd) quitbtn = guiCreateButton(168, 147, 156, 47, "Quit Job", false, jobWnd) local jobmarker = createMarker ( -694.44318, 971.71588, 12.26492, "cylinder", 1.5, 255, 255, 0, 170 ) function SAPDjob(hitElement) if getElementType(hitElement) == "player" and (hitElement == localPlayer) then if not guiGetVisible(jobWnd) then guiSetVisible(jobWnd, true) showCursor(true) end end end addEventHandler("onClientMarkerHit", jobmarker, SAPDjob) function closeGUI() if (source == nobtn) then showCursor(false) guiSetVisible( jobWnd, false ) end end addEventHandler("onClientGUIClick",root,closeGUI) function takeJob() if ( source == yesbtn ) then triggerServerEvent("getJob", getLocalPlayer()) guiSetVisible(jobWnd,false) showCursor(false) end end addEventHandler("onClientGUIClick",root,takeJob) function quitJob() if ( source == quitbtn ) then triggerServerEvent("quitJob", getLocalPlayer()) guiSetVisible(jobWnd,false) showCursor(false) end end addEventHandler("onClientGUIClick",root,quitJob)
  16. Alen141

    help

    I never used progressbar, but here try this : function greetingHandler ( ) guiProgressBarSetProgress ( progressBar, ( guiProgressBarGetProgress ( progressBar ) + 50 ) ) local mu = guiProgressBarGetProgress (progressBar) if mu >= 100 then guiSetText(nivlab, "1") guiProgressBarSetProgress(progressBar, 0) if mu >= 200 then guiSetText(nivlab, "2") end end end addEvent ( "gret", true ) addEventHandler ( "gret", getRootElement(), greetingHandler )
  17. use call(getResourceFromName("scoreboard"), "addScoreboardColumn", "Rank") instead of exports.scoreboard:addScoreboardColumn('Rank')
  18. try using destroyElement
  19. use : dxDrawText addEventHandler("OnClientRender", root, func) ---- as event handler use "OnClientRender"
  20. Alen141

    help

    Use this functions to create marker hit: createMarker triggerClientEvent addEventHandler("onPlayerMarkerHit", getRootElement(), func) and this for your Cancel button function closeGUI() if (source == cancelButton) then showCursor(false) guiSetVisible( Window, false ) end end addEventHandler("onClientGUIClick",root,closeGUI)
  21. Alen141

    Need help,

    It does , If you are reading this can you tell me what's best way to learn lua/mta scripting AND MOST of all GUIs
  22. Read beneath onClientPlayerJoin. use onClientResourceStart. addEventHandler("onClientResourceStart", resourceRoot, drawSpawnScreen) I still get black screen.. Maybe I put it on wrong line?
×
×
  • Create New...