-
Posts
1,193 -
Joined
-
Last visited
Everything posted by tosfera
-
I see what you mean, I got the function from the wiki and when I use it, it also gives me an error. Not sure what it is though... I'll play around with it for a few mins.
-
Found your problem! local vehMarker = createMarker(playerX, playerY-5, playerZ-2, "cylinder", 5, 255, 0, 0, 100) -- line 9 Also, predefine the marker; local vehMarker; -- line 1 beside that, you know the source of onMarkerHit is the marker that's being hit? Not the player thats walking in. Thats the hitElement.
-
Mate, your code is a mess. You created a function in a function. Thats like, impossible... try this; local Marker = createMarker ( 2498.1000976563, -1683.5999755859, 13.39999961853, "cylinder", 5, 255, 255, 0, 255 ) addEventHandler ( "onClientMarkerHit", Marker, function ( hitPlayer, matchingDimension ) if ( hitPlayer == localPlayer ) then bindKey("f1", "down", showDx) end end ) function showDx() -- @todo end function hideDx() -- @todo end addEventHandler ( "onClientMarkerLeave", Marker, function ( leftPlayer, matchingDimension ) unbindKey("f1", "down", ) end )
-
Thats also possible, using the isElementAttached function you can see if an element is attached.
-
Like I said, remove the local's. that will fix 1 part. Cause it has to work without the local's, if that doesn't work try this; GUIEditor = { button = {}, staticimage = {}, label = {} } ------------- --World Gui-- ------------- addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.staticimage[1] = guiCreateStaticImage(0.00, 0.00, 1.00, 1.00, "img/backround.png", true) showCursor(true) -- labels SignPainter45 = guiCreateFont("fonts/SignPainter.ttf", 45) ForzaLight15 = guiCreateFont("fonts/ForzaLight.ttf", 15) --SELECT WORLD LABEL GUIEditor.label[1] = guiCreateLabel(0.27, 0.02, 0.47, 0.12, "Select World", true, GUIEditor.staticimage[1]) guiSetFont(GUIEditor.label[1], SignPainter45) guiLabelSetHorizontalAlign(GUIEditor.label[1], "center", false) guiLabelSetVerticalAlign(GUIEditor.label[1], "center") --TOTAL PLAYERS LABEL GUIEditor.label[2] = guiCreateLabel(0.38, 0.89, 0.24, 0.06, "Total players:", true, GUIEditor.staticimage[1]) guiSetFont(GUIEditor.label[2], ForzaLight15) guiLabelSetHorizontalAlign(GUIEditor.label[2], "center", false) guiLabelSetVerticalAlign(GUIEditor.label[2], "center")
-
Here's an example while I look through you code; addEventHandler("onMarkerHit", marker, function ( hitElement ) if ( isElement ( hitPlayer ) ) then setElementHealth ( hitPlayer, 0 ); end end ); edit; I changed the first part of your code to this; try doing it with the rest! function gridClick ( state, absoluteX, absoluteY) if isElement(panteraprev) and isElement(pastorprev) then destroyElement(panteraprev); destroyElement(pastorprev); end local campos = guiGridListGetItemText ( myGridList, guiGridListGetSelectedItem ( myGridList ), 1 ) if campos == "Tiger" then tigreprev = createPed( 40, 2144.87671, -1177.68799, 23.82031 ) if ( isElement ( panteraprev ) ) then destroyElement(panteraprev); end if ( isElement ( pastorprev ) ) then destroyElement(pastorprev); end if ( isElement ( rotprev ) ) then destroyElement(rotprev); end if ( isElement ( loboprev ) ) then destroyElement(loboprev); end if ( isElement ( foxprev ) ) then destroyElement(foxprev); end end
-
Give me the entire script.
-
The fonts you created are displayed as Local, are they in the same function or another function? If it are 2 different functions, remove the local infront of the font names.
-
Yes it is. https://wiki.multitheftauto.com/wiki/Is ... amageProof
-
replace your guiCreateLabel with this; guiCreateColorLabel(0.5, 0.5, 0.3, 0.3, "THIS IS A LABEL! ;3", true ); I think! never used this function, not sure how you give the color anyway... Maybe in the str ("THIS IS A LABEL"), try to add HEX colors to it. n_n
-
The base member has a skin - team or elementData? Just let it trigger it on the skin then. @denny, yes I did. Cause of the fact thats its a gangserver, not a RP or what ever. :3 So there will only be 2 or 3 marker's ingame.
-
You also have to edit the gui of course. Its just a simple window with a label. Change the label to a memo, change the buttons so it has 2 buttons; accept and cancel. Add a nice picture, idk. Make it like you want it.
-
My script doesn't work with xml's. I hate xml files, blegh! hahaha, anyway all you have to do in the onClientResourceStart, is add a line; triggerEvent("createJob", localPlayer(), "Police", "Being a cop isn't easy ya know!", police, 280, 14, 0, 0, 5, 255, 0, 255, 255)
-
try this addEventHandler("onMarkerHit", root, function ( hitElement ) if ( source == marker and getElementType ( hitElement ) == "player" ) then -- if the marker = markername setElementPosition( hitElement, 2821.3000488281, 1340.3000488281, 65.099998474121 ); end end ); Off topic: You know.... I NEVER followed any tut of lua... O_O" kinda weird...
-
It's locked up in my brain. No one has access to it, thats why I got a blackout.
-
The standard Gui elements does not accept hex colors as a parameter, you can use the dxDrawText to draw the color's though.
-
Not in the meta, in a .lua file.
-
Ahh you're not getting something from the wiki. The float is the type of the element you've to provide. Use it like this; marker = createMarker ( 2806.6999511719, 1371.0999755859, 10, "corona", 4, 0, 0, 255, 255); And just place it on the first line of your script!
-
What do you think about this; function createJob( jobName, jobDesc, jobTeam, jobSkin, jobWeapon, jobMarkerX, jobMarkerY, jobMarkerZ, jobMarkerR, jobMarkerG, jobMarkerB, jobMarkerA ) marker = createMarker( jobMarkerX, jobMarkerY, jobMarkerZ, "cylinder", 2, jobMarkerR, jobMarkerG, jobMarkerB, jobMarkerA ); setElementData(marker, "job", jobName); createTeam( tostring(jobTeam), jobMarkerR, jobMarkerG, jobMarkerB ); local X = 0.375 local Y = 0.250 local Width = 1 local Height = 1 gui = {} gui["_jobWindow".. jobName] = guiCreateWindow (X, Y, Width/4, Height/4, tostring( jobName ), true) guiWindowSetSizable(gui["_jobWindow".. jobName], false) gui["_jobWindow".. jobName .."_lblDesc"] = guiCreateLabel ( 0.1, 0.1, 0.8, 0.1, jobDesc, true, gui["_jobWindow".. jobName]); gui["_jobWindow".. jobName .."_btnAccept"] = guiCreateButton( 0.1, 0.8, 0.8 , 0.2, "Take the job!", true, gui["_jobWindow".. jobName] ); guiSetVisible(gui["_jobWindow".. jobName], false); end addEventHandler("onClientMarkerHit", root, function ( hitElement ) local markerName = getElementData( source ); setGuiVisible( gui["_jobWindow".. markerName], true ); showCursor( true ); end ); didn't test it so it might contain bugs!
-
Sec, working on something to show you!
-
Why do you want to save it into a XML file?
-
sure; local lblName = guiCreateLabel(0.5, 0.5, 0.2, 0.2, "I'M A RED LABEL! FULLY VISIBLE", true); local lblName2 = guiCreateLabel(0.5, 0.6, 0.2, 0.2, "I'M A GREEN LABEL! FULLY VISIBLE", true); local lblName3 = guiCreateLabel(0.5, 0.7, 0.2, 0.2, "I'M A BLUE LABEL! FULLY VISIBLE", true); guiLabelSetColor(lblName, 255, 0, 0, 250); guiLabelSetColor(lblName2, 0, 255, 0, 250); guiLabelSetColor(lblName3, 0, 0, 255, 250);
-
I'm already saying tomuch hahaha.
-
You can use the following functions for that, it's not that hard trust me! createMarker -- to create the jumping marker onMarkerHit -- whent he player walks into the marker setElementPosition -- move the player Thats all!
