Jump to content

glowdemon1

Members
  • Posts

    171
  • Joined

  • Last visited

Everything posted by glowdemon1

  1. Use https://wiki.multitheftauto.com/wiki/Rem ... andHandler and set a timer on addCommandHandler.
  2. Does it do the rest like setPedArmor() etc? Because AFAIK math.random only works with numbers, so try math.random(1,4) Try local positions= { { -3511.0622558594, 1745.8352050781, 75.607810974121 }, { -3507.8325195313, 1771.8107910156, 75.607810974121 }, { -3552.9904785156, 1773.0948486328, 75.607810974121 }, { -3555.6606445313, 1742.8951416016, 75.607810974121 }, } function oh(thePlayer) local azar = math.random ( 1,4 ) local x,y,z = unpack(positions[azar]) setPedArmor ( thePlayer, 0 ) takeAllWeapons (thePlayer) setElementPosition (thePlayer, x,y,z) setElementHealth (thePlayer, 1) end addCommandHandler("oh", oh)
  3. if (isObjectInACLGroup(killer,'vip')) then givePlayerMoney(killer,10) else etc etc.
  4. Complete opposite, serverside is for commands and such but GUIS are clientside. If you go on the wiki you can find functions and events. Most of them are categorized as clientside or serverside, you cannot use a clientside event/function serverside etc. You might want to put most of your code serverside as clientside scripts get downloaded and become accesible, they're still compiled hopefuly. Sooo : Put everything important serverside. When you're using MYSQL, you'll see that you cannot use mysql functions clientside just because putting things client side isn't considered safer than serverside.
  5. https://wiki.multitheftauto.com/wiki/Scr ... troduction "You may have already noticed these or similiar terms (Server/Client) somewhere on this wiki, mostly in conjunction with functions. MTA not only supports scripts that run on the server and provide commands (like the one we wrote above) or other features, but also scripts that run on the MTA client the players use to connect to the server. The reason for this is, that some features MTA provides have to be clientside (like a GUI - Graphical User Interface), others should be because they work better and still others are better off to be serverside or just don't work clientside." If you still don't understand, feel free to leave another message.
  6. local myMarker = createMarker(0,0,3, 'corona', 2.0, 255, 0, 0, 150) -- i make marker function MarkerHit( hitElement, matchingDimension ) if hitElement and getElementType( hitElement ) == 'player' then fadeCamera( hitElement, true, 0.5 ) end end addEventHandler( "onMarkerHit", myMarker, MarkerHit ) This worked for me, are you sure that the file name you put this function is is called marker.lua and check the server console, did it give any errors there? Has the resource been restarted correctly?
  7. You should try blauwee's function, it does what I suggested you to do, check if the hit element is a player. If you use it, please go to the marker ON FOOT, not when you're in a vehicle. Post your meta incase you think it's the meta file's fault.
  8. Change player to hitElement at line 7, however if you hit the marker with a vehicle for instance, it will try and fade the vehicle's camera. You'll need to check what hit the element and so on.
  9. local myMarker = createMarker(-2596.625, 579.358, 15.626, 'corona', 2.0, 255, 0, 0, 150) -- i make marker function MarkerHit( hitElement, matchingDimension ) local elementType = getElementType( hitElement ) outputChatBox( elementType.." test", hitElement, 255, 255, 0 ) -- Change this to hitElement so it outputs for hitElement fadeCamera(player, true, 0.5) end addEventHandler( "onMarkerHit", myMarker, MarkerHit ) The timer and function above myMarker was incorrect. IT looks good like this, didn't test yet.
  10. I assume so. guiSetVisible() is only useful (in my eyes) for temporary GUI-text storing. Like, you fill in a field with text and do guiSetVisible(field,false), the field dissapears. But after a while you want to open that field again with guiSetVisible(field,true) and it shows the text you put in there.
  11. guiSetVisible() works for editBoxes and buttons also. Alternatively you could use destroyElement()
  12. They are optional arguments, so therefore not needed. But they will come in handy when you need to position things. For example, when you attachElements(a,b) they look like they are mixed together. So you can give the x,y,z a value so that the objects will part from eachother but still be attached to eachother. So basicly, adding a value of 10 to X, will make the objects be 10units from apart. It's hard to explain, if you still dont get it, leave another message.
  13. Not sure if this might be the problem but "object" is already an element type, so I4d try giving it another name.
  14. Fixed, ty for reminding me. On the other hand I find this one useful for when I first started and didn't use relative positioning yet.
  15. Didn't test the function spaijk made but this should work if you ofcourse add spaijk's function. for a,b in pairs(getUnoccupiedSeats(vehicle)) do outputChatBox("Unoccupied seats : " ..b) end
  16. Perhaps getElementPosition(thePlayer) and fiddle around until you found the right spot.
  17. executeCommandHandler would be lots easier, I'd go for that however you'd have to change the arguments possibly because it might not return the correct arguments. You can still add arguments like executeCommandHandler("jump",jumpbabe,thePlayer,theVehicle) etc etc..
  18. glowdemon1

    port poblem

    Yeap, http://puu.sh/5mqij.png Assuming External Port Start is "Begin poort" and External Port End is "Eind poort" on the image I posted. No clue if you've got to write something on the last three boxes. You can try and leave it blank, if it doesn't work reply back. You can test your ports by writing "openports" (without strings) in the console, in case you didnt' know
  19. You could replace guiSetVisible with destroyElement(wdwLogin), but it's probably caused by the MYSQL part where I can't really help ya with.
  20. glowdemon1

    Function

    You mean https://wiki.multitheftauto.com/wiki/OnClientGUIClick ?
  21. https://wiki.multitheftauto.com/wiki/GuiBringToFront if that's what you mean.
  22. https://wiki.multitheftauto.com/wiki/GetColorFromString
  23. You mean : https://wiki.multitheftauto.com/wiki/Call ?
  24. Good luck, design looks nice. I hope to see this on a server soon.
  25. I don't think there's an event for that and I highly doubt it, assuming you'll have to custom make on which isn't that hard. if you made the script yourself or know how to edit it : setTimer(3000,1,function() triggerEvent() end)
×
×
  • Create New...