Jump to content

tosfera

Members
  • Posts

    1,193
  • Joined

  • Last visited

Everything posted by tosfera

  1. 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.
  2. tosfera

    help

    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.
  3. tosfera

    ?? BindKey

    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 )
  4. Thats also possible, using the isElementAttached function you can see if an element is attached.
  5. 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")
  6. 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
  7. 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.
  8. Yes it is. https://wiki.multitheftauto.com/wiki/Is ... amageProof
  9. tosfera

    help

    if(string.match(tostring( messageParameters[1] ), "[0-9]")) then -- Check if first try that.
  10. tosfera

    question

    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
  11. 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.
  12. 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.
  13. 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)
  14. 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...
  15. It's locked up in my brain. No one has access to it, thats why I got a blackout.
  16. tosfera

    question

    The standard Gui elements does not accept hex colors as a parameter, you can use the dxDrawText to draw the color's though.
  17. 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!
  18. 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!
  19. Sec, working on something to show you!
  20. Why do you want to save it into a XML file?
  21. tosfera

    question

    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);
  22. I'm already saying tomuch hahaha.
  23. 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!
×
×
  • Create New...