Jump to content

Chronic

Members
  • Posts

    145
  • Joined

  • Last visited

Everything posted by Chronic

  1. Chronic

    Please help me

    You don't name functions when you define it inside of addEventHandler I explained that terribly but here's an example function yo ( ) outputChatBox ( "yo" ) end addEventHandler ( "onClientRestore", root, yo ) addEventHandler ( "onClientRestore", root, function ( ) outputChatBox ( "yo" ) end ) Both would work, both would have the same result, but the second function cannot be called again later in the script.
  2. Don't destroy test, if you do it won't spawn again. Use usePickup instead. function onHit() test = createPickup (653.35773, -1769.18567, 13.57368, 3, 1247, 10000 ) addEventHandler("onPickupHit",test, function(player) if isPedInVehicle(player) then local vehicle = getPedOccupiedVehicle(player) usePickup ( test, player ) setPlayerWantedLevel(getVehicleController(vehicle),getPlayerWantedLevel(getVehicleController(vehicle))-1) else setPlayerWantedLevel(player,getPlayerWantedLevel(player)-1) usePickup ( test, player ) end end) end addEventHandler("onResourceStart",resourceRoot, onHit) Also, what is the point of having the timer
  3. function giveHealth ( p1, _, p2 ) if p2 then local ej = getPlayerFromName ( p2 ) if ej then local nab = getPlayerName ( p1 ) setElementHealth ( ej, 100 ) outputChatBox ( nab.." has given you 100% health.", ej ) end end end addCommandHandler ( "givehealth", giveHealth )
  4. Chronic

    Tables

    local serverResources = { "mta", "cows" } function ress( ) for k,resources in ipairs(serverResources) do outputChatBox(""..resources.."") end end addEvent("ResourcesTable", true) addEventHandler("ResourcesTable", root, ress) addCommandHandler("restest", ress)
  5. Chronic

    Please help me

    We are here to help you, not do it for you. If you post your code I will be able to see your problem and fix it.
  6. Yes it is possible, use createMarker
  7. Chronic

    callRemote

    Oh wow I didn't even think of that and no problem
  8. Chronic

    callRemote

    One way you could do it is if type ( theIP ) == "boolean" then setTimer (...) or something like that.. Good luck
  9. guiGetVisible So you can check if the GUI is already open for the player.
  10. function onLogin() if source == login then guiSetVisible(newGUI,true) showCursor ( true ) end end addEventHandler("onClientGUIClick",getRootElement(),onLogin) There are no GUI elements in onLogin Also, if source == login does not make sense. I recommend you look at the example at https://wiki.multitheftauto.com/wiki/OnClientGUIClick
  11. No that would not work. If this is the entire script, then you would have to fix a number of things: 1. sWidth and sHeight are not defined. 2. digFont is not a font, I'm guessing you're going to be using a custom font. 3. There is no onClientRender handler. 4. In the picture the money is shown in white. The rgb values you put in your script would make the text black. Good luck
  12. it is defined... acc = v
  13. Can you explain this better?
  14. Are you trying to disable weapons or stop the killing of innocent players, or..?
  15. Assuming the Picking Car and Hiding Car are in the same script, you could use destroyElement ( OwnerVehicle )
  16. This login panel uses XML to store data: https://community.multitheftauto.com/in ... ls&id=6367
  17. getAttachedElements will output a table with all the elements attached to it, however if there are no elements attached to it it will return a blank table. If there are no elements attached to hitElement then line 6 will loop through an empty table. Good luck
  18. Thanks Made, it was a problem in my meta.xml (facepalm)
  19. That doesn't work either. Client side functions do not work.
  20. Still doesn't work, it seems that when I deleted all the default resources none of the client-side functions work. Hmm
  21. Tried it, doesn't work local jW = guiCreateWindow ( 0, 0, 0.5, 0.4, "yo", true ) guiSetVisible ( jW, true ) No errors in debug
  22. So I deleted all the default scripts the only script I have is this: guiCreateWindow ( 0.5, 0.4, 1, 1, "yo", true ) That's the entire script but it doesn't work, it's on client side.
  23. Thank you TAPL, your solution works
  24. Alright I tried it, the skin gets set on login, however the team doesn't. addEventHandler ( "onPlayerQuit", root, function ( ) acc = getPlayerAccount ( source ) setAccountData ( acc, "team", getPlayerTeam ( source ) ) setAccountData ( acc, "skin", getElementModel ( source ) ) end ) addEventHandler ( "onPlayerLogin", root, function ( ) setElementModel ( source, getAccountData ( acc, "skin" ) ) setPlayerTeam ( source, getAccountData ( acc, "team" ) ) end )
×
×
  • Create New...