Jump to content

Franky

Members
  • Posts

    24
  • Joined

  • Last visited

Everything posted by Franky

  1. I already found the solution. You have to set to 1 and to an open port!
  2. Hey. I tried to put up my own server and i keep getting this error. "Error downloading requested files. Couldn't connect to the server!" What it does is it connects to the server and when the downloading starts it gives this error and disconnects from the server. I can get into other servers, so it must be my servers settings fault. I turned off my Antivirus and firewall but still doesn't work I found this: https://wiki.multitheftauto.com/wiki/Kno ... sted_files ,but i can't understand if i need to fill the httpdownloadurl slot. If so what do i type there? I had a working server before 1.0 came out but i guess some settings were changed. Can anyone help?
  3. I have the basics. i just don't know how to separate the number like i want to. if you could make an example it would be great because that way i can learn it quicker
  4. what i want to do is i want to make a mini game. you have to enter the right numbers to win. you get a 5 key combination code and when you enter the five numbers, then the numbers, that are right, turn green and the rest turn red. does anyone know how to do it? if someone could just give me some kind of an example or a link i would appreciate it thanks Franky
  5. function enableGuns ( source ) getPedOccupiedVehicle ( source ) setVehicleGunsEnabled ( theVehicle, true ) end addCommandHandler ( "guns", getRootElement(), enableGuns ) attempt to call global 'setVehicleGunsEnabled' (a nil value) Does this function exist? its in the wiki but i think its not working
  6. function setCameraOnPlayerJoin() fadeCamera(source, true, 5) setCameraMatrix(source, 1468.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316) end addEventHandler("onPlayerJoin", getRootElement(), setCameraOnPlayerJoin) Do i have to spawn the player first? Does this function even work? First i tried to make it myself but then i just copied it from the wiki. I just downloaded a new mta from the mta's homepage. i think i should be v1.0
  7. function setDataOnStart ( ) for key, value in ipairs(getElementsByType("vehicle")) do local blockState = getElementData ( theVehicle, "engine.block" ) if ( blockState ) == false or ( blockState ) == nil then setElementData ( theVehicle, "engine.block", 100 ) end local battState = getElementData ( theVehicle, "engine.battery" ) if ( battState ) == false or ( battState ) == nil then setElementData ( theVehicle, "engine.battery", 100 ) end local generatorState = getElementData ( theVehicle, "engine.generator" ) if ( generatorState ) == false or ( generatorState ) == nil then setElementData ( theVehicle, "engine.generator", 100 ) end local radiState = getElementData ( theVehicle, "engine.radiator" ) if ( radiState ) == false or ( radiState ) == nil then setElementData ( theVehicle, "engine.radiator", 100 ) end local hosesState = getElementData ( theVehicle, "engine.hoses" ) if ( hosesState ) == false or ( hosesState ) == nil then setElementData ( theVehicle, "engine.hoses", 100 ) end local pistonState = getElementData ( theVehicle, "engine.pistons" ) if ( pistonState ) == false or ( pistonState ) == nil then setElementData ( theVehicle, "engine.pistons", 100 ) end local beltState = getElementData ( theVehicle, "engine.belts" ) if ( beltState ) == false or ( beltState ) == nil then setElementData ( theVehicle, "engine.belts", 100 ) end local gearboxState = getElementData ( theVehicle, "engine.gearbox" ) if ( gearboxState ) == false or ( gearboxState ) == nil then setElementData ( theVehicle, "engine.gearbox", 100 ) end local oilpanState = getElementData ( theVehicle, "engine.oilpan" ) if ( oilpanState ) == false or ( oilpanState ) == nil then setElementData ( theVehicle, "engine.oilpan", 100 ) end local starterState = getElementData ( theVehicle, "engine.starter" ) if ( starterState ) == false or ( starterState ) == nil then setElementData ( theVehicle, "engine.starter", 100 ) end end end addEventHandler ( "onResourceStart", getRootElement ( ), setDataOnStart ) function testing ( source ) local theVehicle = getPlayerOccupiedVehicle ( source ) if ( theVehicle ) == false then else local engBlock = getElementData ( theVehicle, "engine.block" ) local engBattery = getElementData ( theVehicle, "engine.battery" ) local engGenerator = getElementData ( theVehicle, "engine.generator" ) local engRadiator = getElementData ( theVehicle, "engine.radiator" ) local engHoses = getElementData ( theVehicle, "engine.hoses" ) local engPistons = getElementData ( theVehicle, "engine.pistons" ) local engBelts = getElementData ( theVehicle, "engine.belts" ) local engGearbox = getElementData ( theVehicle, "engine.gearbox" ) local engOilpan = getElementData ( theVehicle, "engine.oilpan" ) local engStarter = getElementData ( theVehicle, "engine.starter" ) outputChatBox ( "Engine block state is" .. engBlock .. "%", source, 250, 1, 1 ) outputChatBox ( "Battery state is" .. engBattery .. "%", source, 250, 1, 1 ) outputChatBox ( "Generator state is" .. engGenerator .. "%", source, 250, 1, 1 ) outputChatBox ( "Radiator state is" .. engRadiator .. "%", source, 250, 1, 1 ) outputChatBox ( "Hoses state is" .. engHoses .. "%", source, 250, 1, 1 ) outputChatBox ( "Pistons state is" .. engPistons .. "%", source, 250, 1, 1 ) outputChatBox ( "Belts state is" .. engBelts .. "%", source, 250, 1, 1 ) outputChatBox ( "Gearbox state is" .. engGearbox .. "%", source, 250, 1, 1 ) outputChatBox ( "Oilpan state is" .. engOilpan .. "%", source, 250, 1, 1 ) outputChatBox ( "Starter state is" .. engStarter .. "%", source, 250, 1, 1 ) end end addCommandHandler ( "test", testing ) Im getting bad argument errors on lines 51-60 can anyone help.. i don't understand whats wrong.. and in case you need to know its a server side script
  8. It needs to be in client side because all GUI's are client side.. it sets the ElementData at server side script.. i have an idea so ill try it.. thanks..
  9. local gPlayer = getLocalPlayer ( ) local gVehicle = getPlayerOccupiedVehicle ( gPlayer ) function analyseGui ( ) local engineSize = getElementData ( gVehicle, "engine.size" ) --sets it by car id. it the engine size in liters. example: 2.8 window = guiCreateWindow ( 0.25, 0.25, 0.5, 0.5, " Gui ", true ) guiCreateLabel ( 0.05, 0.05, 0.3, 0.5, engineSize.. "liter", true, window ) guiWindowSetSizable ( analysegui, false ) guiSetVisible ( analysegui, false ) end addEventHandler( "onClientResourceStart", getResourceRootElement ( getThisResource ( ) ), analyseGui ) function analyseCMD ( source, commandName ) if ( gVehicle ) == false then outputChatBox ( "You need to be in the car you want to analyse!", source, 255, 0, 0 ) else guiSetVisible ( analysegui, true ) showCursor ( true ) end end addCommandHandler ( "analyse", analyseCMD ) It gives and error "Bad Argument @ "getElementData" line 5 Can someone help?
  10. still the same.. "Bad argument @ "addEventHandler" line 26"
  11. Sorry i forgot:D it gives me an error like "Bad argument @ line 26 "addEventHandler" " or something like that.. it doesn't give it in the console, it in the debug script.
  12. function analyseGui ( ) analysegui = guiCreateWindow ( 0.3, 0.25, 0.4, 0.5, "Analysing results", true ) space1 = guiCreateGridList ( 0.015, 0.06, 0.483, 0.1, true, analysegui ) space2 = guiCreateGridList ( 0.512, 0.06, 0.483, 0.1, true, analysegui ) space3 = guiCreateGridList ( 0.015, 0.18, 0.483, 0.1, true, analysegui ) space4 = guiCreateGridList ( 0.512, 0.18, 0.483, 0.1, true, analysegui ) space5 = guiCreateGridList ( 0.015, 0.3, 0.985, 0.6, true, analysegui ) closeBTN = guiCreateButton ( 0.8, 0.92, 0.2, 0.098, "Close", true, analysegui ) guiSetVisible ( analysegui, false ) end addEventHandler( "onClientResourceStart", getResourceRootElement ( getThisResource ( ) ), analyseGui ) function analyseCMD ( thePlayer, commandName ) guiSetVisible ( analysegui, true ) showCursor ( true ) guiSetInputEnabled ( true ) end addCommandHandler ( "analyse", analyseCMD ) function onGuiClose ( ) showCursor ( false ) guiSetVisible ( analysegui, false ) guiSetInputEnabled ( false ) end addEventHandler ( "onClientGUIClick", closeBTN, onGuiClose, false )
  13. it doesn't say if it comes in DP3 or not.. check it yourself http://development.mtasa.com/index.php? ... ngineState
  14. function engineOnOff ( thePlayer ) local playerVehicle = getPlayerOccupiedVehicle ( thePlayer ) if ( playerVehicle ) == false then outputChatBox ( "You need to be in a vehicle!",thePlayer, 225, 1, 1 ) else local playerseat = getPlayerOccupiedVehicleSeat ( thePlayer ) if ( playerseat ) == 0 then local enginestate = getVehicleEngineState ( playerVehicle ) if ( enginestate ) == true then setVehicleEngineState ( playerVehicle, false ) else setVehicleEngineState ( playerVehicle, true ) end else outputChatBox ( "You need to be the driver!", thePlayer, 255, 1, 1 ) end end end addCommandHandler ( "engine", engineOnOff ) Can someone fix what i did wrong?
  15. but how to i get to know then if the engine is on or off?
  16. what does this error mean? attempt to call global (a nil value) ERROR: ...ver/mods/deathmatch/resources/script/asd.lua:8: attempt to call global 'getVehicleEngineState' (a nil value)
  17. Okey like i see you cant understand what i mean.. I want to know how to write something like this: if player's health is 91-100 then he will be okey, but if player health is 71-90 then he will bleed a little and if players health is 11-70 then he will bleed heavily. And if player's health is 1-10 he will black out and bleed to death(which is HP 0)
  18. That their health is between 100 to 50
  19. What i need to know is that how do i say 100 to 50 in lua Example: If (playerHP) "100 to 50" then make him die. Hope you getting this
×
×
  • Create New...