Jump to content

igthomas

Members
  • Posts

    62
  • Joined

  • Last visited

Everything posted by igthomas

  1. Doesn't work for me Is this my video card problem? http://i.imgur.com/abDSqU6.png
  2. https://community.multitheftauto.com/ind ... ls&id=7072 https://community.multitheftauto.com/ind ... ls&id=7074 stolen scripts DONE!
  3. Well the funny thing is that I was very close once just instead of setElementData(thePlayer,"away",{oldX, oldY, oldZ}) I did this without { } Anyways now I know my mistake and won't repeat them ;D setElementData(thePlayer,"away",oldX, oldY, oldZ)
  4. Thanks for your help guys csiguusz your script worked just one thing how could I stop the checking if the player is still afk? Because I have a feeling that if the player stays afk and it check everytime and save the position, it will save the new one where he's in the interior right?
  5. Thanks for help but it didn't work, I mean when I write back it doesn't do anything
  6. Hi I made an afk script , player gets moved to a specified interior and when he writes back it gets him back where he left being afk, but for some reason it gets the position of the interior not the one where he left. Oh and do you suggest doing setTimer every 1 seconds or is it bad for the server? function onIdle (thePlayer) for index, thePlayer in ipairs(getElementsByType("player"))do if (getPlayerIdleTime(thePlayer) > 5000) then --120000 local oldPos = getElementPosition (thePlayer) setElementData(thePlayer,"away",oldPos) setElementInterior ( thePlayer, 1, 681.5, -455.46, -25.6 ) end end end setTimer(onIdle, 1000, 0) function onBack (thePlayer) if getElementData(thePlayer,"away") then local oldPos = tonumber(getElementData(thePlayer,"away")) setElementInterior ( thePlayer, 0, oldPos ) end end addCommandHandler("back", onBack)
  7. Thanks man no more errors
  8. Hi, recently I was converting every of my gates script from getElementModel to getTeamName and I'm getting an error it's not really affecting the scripts but its annoying because more players are on the server more bigger the ouput in log file is gate1= createObject ( 2927, 215.878, 1875.722, 13.93899, 0, 0, 0 ) gate1_2 = createObject ( 2927, 211.7866, 1875.726, 13.93899, 0, 0, 0 ) marker_gate1 = createMarker(213.93994,1875.98022,10.3468,"cylinder",5, 225, 225, 0, 0 ) function open_gate1(hitElement) local armyTeam = getPlayerTeam ( hitElement ) if getTeamName(armyTeam) == "Army" then moveObject ( gate1, 2000, 219.9222, 1875.722, 13.93899 ) moveObject ( gate1_2, 2000, 207.98663, 1875.726, 13.93899 ) end end addEventHandler ("onMarkerHit",marker_gate1,open_gate1) function close_gate1(hitElement) local armyTeam = getPlayerTeam (hitElement) if getTeamName(armyTeam) == "Army" then moveObject ( gate1, 2000, 215.878, 1875.722, 13.93899 ) moveObject ( gate1_2, 2000, 211.7866, 1875.726, 13.93899 ) end end addEventHandler ("onMarkerLeave",marker_gate1,close_gate1) Here's the error: WARNING: Gates\server.lua:5: Bad 'player' pointer @ 'getPlayerTeam'(1) WARNING: Gates\server.lua:6: Bad argument @ 'getTeamName' From what I've discovered this only happens when the player is on a vehicle and opens the gate, ofc the gate opens but it outputs this annoying error
  9. The problem could be because on your first post the client script file is called "Spawnc.lua" instead of "spawn.lua". I've tested it again and everything worked very well
  10. Weird I've just tested it and everything worked well you sure you haven't forgot anything in meta?
  11. The problem with previous was that you had dots between "GUIEditor" and "window" instead of "_" so it gave some error. Here's for removing the spawnpanel: GUIEditor_button = {} GUIEditor_window = {} addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor_window[1] = guiCreateWindow(0, 0, 1365, 767, "Spawn", false) guiWindowSetSizable(GUIEditor_window[1], false) guiSetAlpha(GUIEditor_window[1], 1.00) Sniper = guiCreateButton(73, 121, 301, 93, "Sniper", false, GUIEditor_window[1]) guiSetFont(Sniper, "sa-header") GUIEditor_button[3] = guiCreateButton(73, 244, 301, 93, "Assault Unit", false, GUIEditor_window[1]) guiSetFont(GUIEditor_button[3], "sa-header") GUIEditor_button[4] = guiCreateButton(421, 121, 301, 93, "Mafia Hitman", false, GUIEditor_window[1]) guiSetFont(GUIEditor_button[4], "sa-header") GUIEditor_button[6] = guiCreateButton(421, 243, 301, 93, "Robber", false, GUIEditor_window[1]) guiSetFont(GUIEditor_button[6], "sa-header") GUIEditor_button[7] = guiCreateButton(776, 121, 301, 93, "News Reporter", false, GUIEditor_window[1]) guiSetFont(GUIEditor_button[7], "sa-header") GUIEditor_button[8] = guiCreateButton(776, 243, 301, 93, "Mechanic", false, GUIEditor_window[1]) guiSetFont(GUIEditor_button[8], "sa-header") GUIEditor_button[9] = guiCreateButton(73, 473, 301, 93, "Pilot", false, GUIEditor_window[1]) guiSetFont(GUIEditor_button[9], "sa-header") GUIEditor_button[10] = guiCreateButton(499, 473, 301, 93, "Rescuer", false, GUIEditor_window[1]) guiSetFont(GUIEditor_button[10], "sa-header") GUIEditor_button[11] = guiCreateButton(499, 596, 301, 93, "Execution Squad", false, GUIEditor_window[1]) guiSetFont(GUIEditor_button[11], "sa-header") GUIEditor_button[12] = guiCreateButton(73, 596, 301, 93, "Air Officer", false, GUIEditor_window[1]) guiSetFont(GUIEditor_button[12], "sa-header") Spawn = guiCreateButton(901, 483, 418, 179, "Spawn!", false, GUIEditor_window[1]) guiSetFont(Spawn, "sa-gothic") showCursor( true ) end ) function dxTexts() dxDrawText("Military Forces", 62, 32, 280, 142, tocolor(255, 255, 255, 255), 4, "default", "left", "top", false, false, true, false, false) dxDrawText("Criminals", 476, 32, 694, 142, tocolor(255, 255, 255, 255), 4, "default", "left", "top", false, false, true, false, false) dxDrawText("Civillians", 808, 32, 1026, 142, tocolor(255, 255, 255, 255), 4, "default", "left", "top", false, false, true, false, false) dxDrawText("U.S.S Air Force", 62, 380, 402, 490, tocolor(255, 255, 255, 255), 4, "default", "left", "top", false, false, true, false, false) dxDrawText("U.S.S Military Unit", 465, 380, 805, 490, tocolor(255, 255, 255, 255), 4, "default", "left", "top", false, false, true, false, false) end addEventHandler("onClientRender", root, dxTexts) showCursor( false ) addEventHandler("onClientGUIClick", root, function() if source == Sniper then triggerServerEvent("Sniper", localPlayer) elseif source == Spawn then destroyElement(GUIEditor_window[1]) removeEventHandler("onClientRender", root, dxTexts) showCursor(false) end end ) addEvent("setSpawnVisible",true) addEventHandler("setSpawnVisible",root, function () guiSetVisible( GUIEditor_window[1], true ) setTimer( function () showCursor( true ) end, 1000,1) end )
  12. Try this Server: addEvent( "Sniper", true) addEventHandler( "Sniper", root, function() setElementPosition ( source, 0, 0, 5 ) end ) addEventHandler ( "onPlayerJoin", root, function ( ) triggerClientEvent ( source, "setSpawnVisible", source, true ) end ) Client: GUIEditor_button = {} GUIEditor_window = {} addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor_window[1] = guiCreateWindow(0, 0, 1365, 767, "Spawn", false) guiWindowSetSizable(GUIEditor_window[1], false) guiSetAlpha(GUIEditor_window[1], 1.00) Sniper = guiCreateButton(73, 121, 301, 93, "Sniper", false, GUIEditor_window[1]) guiSetFont(Sniper, "sa-header") GUIEditor_button[3] = guiCreateButton(73, 244, 301, 93, "Assault Unit", false, GUIEditor_window[1]) guiSetFont(GUIEditor_button[3], "sa-header") GUIEditor_button[4] = guiCreateButton(421, 121, 301, 93, "Mafia Hitman", false, GUIEditor_window[1]) guiSetFont(GUIEditor_button[4], "sa-header") GUIEditor_button[6] = guiCreateButton(421, 243, 301, 93, "Robber", false, GUIEditor_window[1]) guiSetFont(GUIEditor_button[6], "sa-header") GUIEditor_button[7] = guiCreateButton(776, 121, 301, 93, "News Reporter", false, GUIEditor_window[1]) guiSetFont(GUIEditor_button[7], "sa-header") GUIEditor_button[8] = guiCreateButton(776, 243, 301, 93, "Mechanic", false, GUIEditor_window[1]) guiSetFont(GUIEditor_button[8], "sa-header") GUIEditor_button[9] = guiCreateButton(73, 473, 301, 93, "Pilot", false, GUIEditor_window[1]) guiSetFont(GUIEditor_button[9], "sa-header") GUIEditor_button[10] = guiCreateButton(499, 473, 301, 93, "Rescuer", false, GUIEditor_window[1]) guiSetFont(GUIEditor_button[10], "sa-header") GUIEditor_button[11] = guiCreateButton(499, 596, 301, 93, "Execution Squad", false, GUIEditor_window[1]) guiSetFont(GUIEditor_button[11], "sa-header") GUIEditor_button[12] = guiCreateButton(73, 596, 301, 93, "Air Officer", false, GUIEditor_window[1]) guiSetFont(GUIEditor_button[12], "sa-header") GUIEditor_button[13] = guiCreateButton(901, 483, 418, 179, "Spawn!", false, GUIEditor_window[1]) guiSetFont(GUIEditor_button[13], "sa-gothic") showCursor( true ) end ) addEventHandler("onClientRender", root, function() dxDrawText("Military Forces", 62, 32, 280, 142, tocolor(255, 255, 255, 255), 4, "default", "left", "top", false, false, true, false, false) dxDrawText("Criminals", 476, 32, 694, 142, tocolor(255, 255, 255, 255), 4, "default", "left", "top", false, false, true, false, false) dxDrawText("Civillians", 808, 32, 1026, 142, tocolor(255, 255, 255, 255), 4, "default", "left", "top", false, false, true, false, false) dxDrawText("U.S.S Air Force", 62, 380, 402, 490, tocolor(255, 255, 255, 255), 4, "default", "left", "top", false, false, true, false, false) dxDrawText("U.S.S Military Unit", 465, 380, 805, 490, tocolor(255, 255, 255, 255), 4, "default", "left", "top", false, false, true, false, false) end ) showCursor( false ) addEventHandler("onClientGUIClick", root, function() if source == Sniper then triggerServerEvent("Sniper", localPlayer) elseif source == Hydra then triggerServerEvent("Hydra", localPlayer) elseif source == Chainsaw then triggerServerEvent("Chainsaw", localPlayer) elseif source == MP5 then triggerServerEvent("RPG", localPlayer) elseif source == NRG500 then triggerServerEvent("NRG500", localPlayer) elseif source == Close then guiSetVisible(GUIEditor_window[1], false) showCursor(false) elseif source == Rhino then triggerServerEvent("Rhino", localPlayer) elseif source == Hunter then triggerServerEvent("Hunter", localPlayer) elseif source == Maverick then triggerServerEvent("Maverick", localPlayer) elseif source == Safezone then triggerServerEvent("Safezone", localPlayer) elseif source == MP5 then triggerServerEvent("MP5", localPlayer) end end ) addEvent("setSpawnVisible",true) addEventHandler("setSpawnVisible",root, function () guiSetVisible( GUIEditor_window[1], true ) setTimer( function () showCursor( true ) end, 1000,1) end )
  13. Hey Guys, I've a strange problem, don't know if it's my PC or the createObject bug, my map file with createObject is 120Kb and seems that when I go 20 meter far from the object, it dissapears and sometimes I don't even see it and can go through the object Oo Are there any solutions for that?
  14. Try this addEventHandler("onClientPlayerJoin", getRootElement(), function() fadeCamera(true, 5) setCameraMatrix(1468.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316) end )
  15. Hey guys, I have a problem with my progress bar, when I type /nano the progress bar goes down and when its 0 it goes to 100 again but after that if I type it again the progress doesnt go down I get this error when I shoot WARNING: nano\client.lua:49: Bad Argument @ 'killTimer' [Expected lua-timer at argument 1] Here's the code: GUIEditor_Progress = {} function showBar() GUIEditor_Progress[1] = guiCreateProgressBar(0.0127,0.3,0.1719,0.0417,true) guiSetAlpha(GUIEditor_Progress[1],1) progres = 100 timer = nil; guiProgressBarSetProgress(GUIEditor_Progress[1],progres) end addEvent("showBar", true) addEventHandler ("showBar", getRootElement(),showBar) function move_progressbar () if timer then return end function chech_move () progres = progres - 1 guiProgressBarSetProgress(GUIEditor_Progress[1],progres) check_progres () if (guiProgressBarGetProgress(GUIEditor_Progress[1]) >= 100) then killTimer( timer ) timer = nil; end end timer = setTimer(chech_move,200,100) end addCommandHandler ( "nano", move_progressbar ) function check_progres () if guiProgressBarGetProgress(GUIEditor_Progress[1]) == 0 then triggerServerEvent ("desactivete", localPlayer) progres = progres + 1 guiProgressBarSetProgress(GUIEditor_Progress[1],progres) stop = setTimer (restore, 1000, 0) end end function restore () progres = progres + 1 guiProgressBarSetProgress(GUIEditor_Progress[1],progres) stop = setTimer (restore, 1000, 0) if (guiProgressBarGetProgress(GUIEditor_Progress[1]) >= 100) then killTimer( stop ) end end function onClientPlayerWeaponFireFunc(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement) if getElementAlpha(getLocalPlayer()) == 0 then killTimer( timer ) triggerServerEvent ("desactive", localPlayer) restore () move_progressbar () else if getElementAlpha(getLocalPlayer()) == 255 then cancelEvent() end end end addEventHandler("onClientPlayerWeaponFire", root, onClientPlayerWeaponFireFunc)
  16. I guess he means replace every source element in client script to localPlayer
  17. ah ok ye I see my mistake now, Thank you very much
  18. Hello everyone, today I tried to make a script that triggers a progress bar(client side) but it debugs a very strange error I've never seen before WARNING: nano\server.lua:4: Bad argument @ 'getElementModel' [Expected element at argument 1, got number '213.85562133789'] What does that mean with 213.85... ? Here's the script local skins = {[240]=true,[121]=true} function showProgres (source) if (skins[getElementModel(source)]) then triggerClientEvent ("showBar", getRootElement()) end end addEventHandler ("onPlayerSpawn", getRootElement(), showProgres)
  19. No I tried it already, for some reason if it works for you in server side that means it won't work for some other people. I guess it's a MTA bug so better make it client side and just place removeWorldModel without any functions or events. Correct if I'm wrong but that's what I realised
  20. Try Code removeWorldModel(16613, 200, -346.671875, 1595.078125, 79.6640625) --object removeWorldModel(16614, 200, -346.671875, 1595.078125, 79.6640625) --LOD Meta I had same problem, if you use it client side then you shouldn't use eventhandler and function just removeWorldModel
  21. igthomas

    Server list spam

    IP: 178.238.236.62:22020 This arabic server is hacking somehow so it shuts my server down and redirects all the players from my server to their server. It's like the 6-7 th time they are doing it in 1 week
  22. Thank you man it worked didn't know that I didn't need to use setWeaponProperty
×
×
  • Create New...