Jump to content

Chronic

Members
  • Posts

    145
  • Joined

  • Last visited

Everything posted by Chronic

  1. You put setElementInterior twice However, still doesn't work.
  2. When I go in theMarker3, nothing happens, I'm really confused on what I did wrong. function marker ( thePlayer ) theMarker3 = createMarker ( 497.24795532227,-75.805885314941,997.5578125, "cylinder", 1, 255, 105, 180, 170 ) setElementInterior ( theMarker3, 11 ) addEventHandler ( "onMarkerHit", theMarker3, drinks ) end addEventHandler ( "onResourceStart", resourceRoot, marker ) function drinks ( thePlayer ) outputChatBox ( "test" ) end The marker spawns fine, but nothing happens when I enter it.
  3. No, don't replace any lines. Just add this at the beginning of your script. g_CurrentRaceMode = getMapName()
  4. Oh, sorry didn't see your post when I said it. Anyway thanks for telling me!
  5. Trust me, this will work. I tried doing that on my other scripts, but didn't work. triggerClientEvent ( "onUpgradeText", source, message )
  6. This should work. triggerClientEvent ( "onUpgradeText", source, message )
  7. g_CurrentRaceMode is nil, it was never defined. Assuming what you're trying to do is get the Map name, I would use getMapName and g_CurrentRaceMode = getMapName()
  8. Also, be sure to turn off your router's firewall or make an exception. I can't explain how to do this, because every router is different. Good luck!
  9. I've been having problems with triggerServerEvent and triggerClientEvent, which is what I think the source of the problem is. When I do this Server Script, it works Then when I do this: Server Client It doesn't work. I think it's probably because of the trigger events, either I don't need to use it, or I'm using it wrong. Both come up as Bad Argument in the debug. Any help would be amazing at this point, as I'm very close to finishing it.
  10. Yeah I have had a lot of people tell me I'm unorganized thanks for the advice, didn't fix my problem, but I figured it out on my own. Really careless of me to not see this Problem was the coordinates sx,sy = guiGetScreenSize () window = guiCreateWindow(sx/2-648/2, sy/2-303/2, 648, 303, "Buy Weapon", false) guiWindowSetMovable(window, true) guiWindowSetSizable(window, true) weapon = guiCreateButton(sx/2, sy/2, 400/2, 150/2, "Buy Weapons", false, window) Should be sx,sy = guiGetScreenSize () window = guiCreateWindow(sx/2-648/2, sy/2-303/2, 648, 303, "Buy Weapon", false) guiWindowSetMovable(window, true) guiWindowSetSizable(window, true) weapon = guiCreateButton(sx/2-648/2, sy/2-303/2, 374, 151, "Buy Weapons", false, window) Thanks to everyone that helped, much appreciated I will be sure to PM you if I have trouble
  11. Thanks man, fixed my problem. EDIT: After some scripting, I made the GUI show up but the button does not. Client: Server: function marker () ped = createPed (200, 0, -2, 5) theMarker = createMarker ( 0, 0, 3, "cylinder", 1, 0, 255, 0, 170 ) addEventHandler ( "onMarkerHit", theMarker, gui ) end addEventHandler ( "onResourceStart", getRootElement(), marker ) function gui () triggerClientEvent ( "onAmmunation", getRootElement(), ammunationHandler ) end
  12. Thanks, that got rid of the error, but the gui still doesn't open. Any advice? So now I see I added a sz, which doesn't make sense because the screen doesn't have depth, so I got rid of it. After looking at the debug it says "attempted to perform arithmetic on global 'sx' (a function value)
  13. Hi I'm new to MTA and Lua, as you can probably tell by now. After being introduced to it by an experienced Lua scripter, I tried to make my own script, but failed. [17:31:36] WARNING: ammunation\server.lua:19: Bad argument @ 'addEventHandler Expected element at argument 2, got nil] Server function marker () ped = createPed (200, 0, -2, 5) theMarker = createMarker ( 0, 0, 3, "cylinder", 1, 0, 255, 0, 170 ) end addCommandHandler ("x", marker) function takeCash ( thePlayer, command, amount) takePlayerMoney ( thePlayer, 100 ) giveWeapon ( thePlayer , 31, 200 ) end function consoleGive ( thePlayer, commandName, weaponID, ammo ) giveWeapon (thePlayer, 31, 200, true ) end function gui () triggerClientEvent ( "onAmmunation", getRootElement(), ammunationHandler ) end addEventHandler ( "onMarkerHit", theMarker, gui ) Client function ammunationHandler () sx,sy,sz = guiGetScreenSize window[1] = guiCreateWindow(sx/2, sy/2, 800/2, 300/2, "Buy Weapon", false) weapon[1] = guiCreateButton(606, 316, 241, 83, "Buy Weapons", false, window[1]) end addEvent ( "onAmmunation", true ) addEventHandler ( "onAmmunation", getRootElement(), ammunationHandler )
×
×
  • Create New...