-
Posts
105 -
Joined
-
Last visited
Everything posted by Alen141
-
8x 16 Slot servers for free! gta-servers.net giveaway!
Alen141 replied to =FAS=Shigawire's topic in Hosting solutions
Edit:... -
localPlayer is not defined, use getLocalPlayer() or define localPlayer local localPlayer = getLocalPlayer()
-
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
-
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)
-
hahaha thx, when I used function from my job script
-
window is still not closing from some reason but I can move
-
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?
-
how to tell client to send "id" to server side EDIT : how to tell client that "id" is second value
-
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)
-
just enable control again toggleControl ( source, "fire", true )---- this will enable you to shoot again
-
add me on skype, i'll help you my skype name = alenalen1411
-
thanks , completely forgot to put that line
-
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)
-
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 )
-
use call(getResourceFromName("scoreboard"), "addScoreboardColumn", "Rank") instead of exports.scoreboard:addScoreboardColumn('Rank')
-
try using destroyElement
-
use : dxDrawText addEventHandler("OnClientRender", root, func) ---- as event handler use "OnClientRender"
-
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)
-
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
-
Read beneath onClientPlayerJoin. use onClientResourceStart. addEventHandler("onClientResourceStart", resourceRoot, drawSpawnScreen) I still get black screen.. Maybe I put it on wrong line?
-
now i get black screen