Jump to content

Fabio(GNR)

Members
  • Posts

    210
  • Joined

  • Last visited

Everything posted by Fabio(GNR)

  1. Yes i was kinda into the variable thing that i forgot to add that EDIT: from my other post: But its kinda hard to understand everything, i did understand the introduction, but 2 things: Im dutch, i never scripted/programmed before, im willing to learn now. but it's kinda hard. but why would i need a variable if i only use it one time, or is a variable something else. cause at the tutorial's im following (links from main wiki page) don't really describe everything. EDIT2: I got it to work, thanks varez, im going further now, well it did go like this: i added a command handler that checks if your spawned vehicle (vehicle_panel) is damageproof, it will output ERROR when it is, and it worked now im gonna try to make it use the same command anyway i gotta go now thanks for the help EDIT3: 1 more small question before i leave: can i use like 2 if's? i want to put this one function checkdamageproof (playerSource) if isVehicleDamageProof ( vehicle ) then outputChatBox ( "ERROR", playerSource, 255, 0, 0 ) else outputChatBox ( " /cargod", playerSource, 0, 225, 0 ) end end together with this one: function godcar (g_Me) local vehicle = getPedOccupiedVehicle(g_Me) if not vehicle then outputChatBox("You have to be in a vehicle for CAR-god-mode!!",playerSource,255,0,0) else outputChatBox ( "Your car is now Damage-proof, Leaving vehicle will dis-able", playerSource, 0, 255, 0 ) setVehicleDamageProof(vehicle, true) end end addCommandHandler ( "cargod", godcar ) Vehicle is assigned before this function
  2. The one you send me? Introducing to scripting? i did that, or is there more stuff? But its kinda hard to understand everything, i did understand the introduction, but 2 things: Im dutch, i never scripted/programmed before, im willing to learn now. but it's kinda hard
  3. Im not, im readin this tutorial: http://nixstaller.berlios.de/manual/0.2 ... statements but yes, i forgot to to select vehicle but before that function is the script from vehicle_panel for taalasmaa (permission to edit it) but why would it be always true, i read trough the introduction and some other tuts on that page and your links but anyway i'll try some thing, read , fail, try again and maybe succeed
  4. its not a command well, it puts out then if vehicle not; and other goes when it succeeds ( the command ) but varez, i think it is my problem, also the scripting thing tough im readin again now EDIT: can i ask some questions about it here? I think i created something thats ok, but i don't exactly get it it would be nice if someone would point me out the error: n = true function checkdamageproof () if isVehicleDamageProof n then outputChatBox ( "ERROR", playerSource, 0, 255, 0 ) end end BTW: it gives me those error's in script editor: Then expected near = (the line of vehicledamageproof) en expected near end like 3 times EDIT2: Lol, forgot to trigger
  5. https://wiki.multitheftauto.com/wiki/Scr ... troduction and generally whole "Scripting" box on main page: https://wiki.multitheftauto.com/wiki/Main_Page Ok thanks, i searched on google and now im doing a random java programming tut, but i will the right one now And to MiniGoveya, i tried that but then with playersource but i'll try again maybe i mistyped something or did it wrong thanks EDIT: i'll read further tomorrow, im starting to get what variables are thanks!!!
  6. Isvehicledamageproof, I don't know how to do that, i created a script with help from wiki to set it DamageProof, and i want a function that sets it to false if the player is out the vehicle for xx seconds, So how do make it something like isvehicledmageproof = true then??? Wiki is unfinished at that page. And Colors, idk but with everyscript i use my colors dont work code for ouputplayerchatbox: outputChatBox ( "Your car is now Damage-proof, Leaving vehicle will dis-able", source, 0, 255, 0 ) Code SETvehicledamageproof: function godcar (g_Me) local vehicle = getPedOccupiedVehicle(g_Me) if not vehicle then outputChatBox("You have to be in a vehicle for CAR-god-mode!!",source,255,0,0) else outputChatBox ( "Your car is now Damage-proof, Leaving vehicle will dis-able", source, 0, 255, 0 ) setVehicleDamageProof(vehicle, true) end end (yes i kinda copied it from wiki ) Thanks...
  7. I think it's already applied. Oh, but sometime;s my objects still rotate weird, but it's ok
  8. Ok, thanks, (bit offtopic) But how to install the rotOrderpatch? http://bugs.mtasa.com/print_bug_page.php?bug_id=4609
  9. You mean the Destructable map resource? Go to Community, press resources search for destruction.... if you didn't ment that then i dont know
  10. Yes, i know how.... it's kinda hard to explain but some raw info: Open xfire main menu, Extra, Options, Games it will search for games. If it doesn't find MTA do the following: Go to un-installed games (in the extra, options, game place) search MTA san andreas, And select Manual Detect, then select your file, with clicking the button.... Find the Multi Theft Auto.exe file, and make sure Xfire in-game is enabled, hope it works worked for me
  11. Uhm how to install?? put the .patch file in the resource folder???
  12. Nice, but i don't need it for my server, but would it be definitely useful for RolePlay too, if they use hacks to get under the ground etc.
  13. No not really I'll read EDIT: so if im right, a variable is something thats used alot? or by many scripts? EDIT2: Or to who/what it's aimed? EDIt3: Or something a script can recognize easily?
  14. Ok, im trying to understand now Sorry but it's kinda hard im a noob So if u put that print function on start and addcommandhandeler key print???? Sorry
  15. Could you explain me something about variables? BTW: your 50p's public resources is broken
  16. Only 1 bug, when you started it, and then you stop it, start won't work anymore, how to fix?? :D EDIT: Never mind, i setted the timer to 10 min or so never waited so long, changed to 1000 and its fixed
  17. I got this god-mode script: function godmode(attacker, weapon, bodypart) cancelEvent() end addEventHandler("onClientPlayerDamage", getLocalPlayer(), godmode) But i want it to enable/disable by a command, how to? Thanks! :D
  18. Ok reading now So if i paste this on front of my code: tr1 = togglerocket1 print(tr1) --> togglerocket1 it will recognize it? I don't get it this is what i found: http://www.lua.org/pil/1.2.html but, it's really hard for a noobie like me EDIT: maybe i should drop this mess, and make the fuel something like 100000000 And when its down make an outputbox command that will say: please re-enter settings idk, That would be ok too, thanks for your idea tough, but i really don't get it... Please explain me, if you have the time otherwise i'll use the 10000000 fuel idea
  19. Sorry, i don't get it, i never used Global/Local variables Sorry for late response
  20. Uhm i did not create the script, but thats not what your saying i'll have to search on wiki for global variable thanks for the info, ill report back if i done it EDIT: can't find anything on wiki about global variable
  21. Ok, i thought it maybe wasnt allowed to copy rresource's script on forum: --[[Version 1.1 Changes 1. When a player leaves his vehicle while using boost the rocket is deactivated, meter closes, and resuming acceleration on a vehicle will not activate rocket automaticly 2. Smoke is now serverside --]] addEvent ( "kill", true ) addEventHandler ( "onClientResourceStart", getResourceRootElement ( getThisResource() ), function() if getLocalPlayer() then bindKey ( "lshift", "up", ignition ) bindKey ( "lshift", "up", kill ) local sx, sy = guiGetScreenSize() fuelGauge = guiCreateProgressBar ( sx/4, sy/24, sx/2, sy/42, false ) guiSetVisible ( fuelGauge, false ) guiProgressBarSetProgress ( fuelGauge, 100 ) outputChatBox ( "Keys bound", 255, 255, 255 ) end end ) function ignition ( player ) if isPedInVehicle ( getLocalPlayer() ) then if getVehicleController ( getPedOccupiedVehicle ( getLocalPlayer() ) ) == getLocalPlayer() then if isVehicleOnGround ( getPedOccupiedVehicle ( getLocalPlayer() ) ) == true then if getAnalogControlState ( "accelerate" ) == 1 then if fuelAmmount > 0 then initiate = addEventHandler ( "onClientRender", getRootElement(), rocketBoost, getLocalPlayer() ) if initiate then guiSetVisible ( fuelGauge, true ) if fuelAmmount > 0 then triggerServerEvent ( "createSmoke", getLocalPlayer() ) smokeGenerator = "true" else if smokeGenerator then triggerServerEvent ( "killSmoke", getLocalPlayer() ) smokeGenerator = nil end end end end end end end end end function kill ( player ) if isPedInVehicle ( getLocalPlayer() ) then if getVehicleController ( getPedOccupiedVehicle ( getLocalPlayer() ) ) == getLocalPlayer() then removeEventHandler ( "onClientRender", getRootElement(), rocketBoost, player ) guiSetVisible ( fuelGauge, false ) if smokeGenerator then triggerServerEvent ( "killSmoke", getLocalPlayer() ) smokeGenerator = nil if guiGetVisible ( fuelGauge ) == true then guiSetVisible ( fuelGauge, false ) end end end end end fuelAmmount = 1300 boost = 1.03--default value is 1.01 subtractor = 3--default value function rocketBoost ( player ) if isPedInVehicle ( getLocalPlayer() ) then if getVehicleController ( getPedOccupiedVehicle ( getLocalPlayer() ) ) == getLocalPlayer() then if isVehicleOnGround ( getPedOccupiedVehicle ( getLocalPlayer() ) ) == true then if getAnalogControlState ( "accelerate" ) == 1 then if fuelAmmount > 0 then if dankSetting == "low" then boost = 1.01 subtractor = 3 elseif dankSetting == "medium" then boost = 1.03 subtractor = 6 elseif dankSetting == "high" then boost = 1.05 subtractor = 9 end local velX, velY, velZ = getElementVelocity ( getPedOccupiedVehicle ( getLocalPlayer() ) ) injectFuel = setElementVelocity ( getPedOccupiedVehicle ( getLocalPlayer() ), velX * boost, velY * boost, velZ ) fuelAmmount = fuelAmmount - subtractor guiProgressBarSetProgress ( fuelGauge, fuelAmmount/10 ) else local x, y = guiGetScreenSize() dxDrawText ( "Rocket Fuel Tank Empty", x/4, y/4 ) if smokeGenerator then triggerServerEvent ( "killSmoke", getLocalPlayer() ) smokeGenerator = nil end if getKeyState ( "lshift" ) == true then if fuelAmmount <= 0 then removeEventHandler ( "onClientRender", getRootElement(),rocketBoost, getLocalPlayer() ) unbindKey ( "lshift", "down", ignition ) unbindKey ( "lshift", "up", ignition ) setTimer ( restoreFuel, 1000, 1 ) addEventHandler ( "onClientRender", getRootElement(), restoreFuelCheck ) end end end end end end end end function restoreFuel() fuelAmmount = 1000 guiProgressBarSetProgress ( fuelGauge, 100 ) bindKey ( "lshift", "up", ignition ) bindKey ( "lshift", "both", ignition ) outputChatBox ( "Fuel #00FF00Restored", 255, 255, 255, true ) end function restoreFuelCheck() if fuelAmmount < 1000 then local x, y = guiGetScreenSize() dxDrawText ( "Restoring Rocket Fuel...", x/2.3, y/23, x, y, tocolor ( 255, 0, 0, 255 ), 1.5, "default", "left", "top", false, false, true ) elseif fuelAmmount == 1000 then removeEventHandler ( "onClientRender", getRootElement(), restoreFuelCheck ) end end function rockettoggle1 () unbindKey ( "lshift", "down", kill ) bindKey ( "lshift", "up", kill ) unbindKey ( "lshift", "up", ignition ) bindKey ( "lshift", "down", ignition ) end function rockettoggle2 () unbindKey ( "lshift", "up", kill ) bindKey ( "lshift", "down", kill ) unbindKey ( "lshift", "down", ignition ) bindKey ( "lshift", "up", ignition ) end addCommandHandler ( "tr1",rockettoggle1 ) addCommandHandler ( "tr2",rockettoggle2 ) addCommandHandler ( "rocket", function ( player, number ) if number == "1" then dankSetting = "low" outputChatBox ( "Rocket velocity set to #00FF00low", 255, 255, 255, true ) elseif number == "2" then dankSetting = "medium" outputChatBox ( "Rocket velocity set to #00FF00medium", 255, 255, 255, true ) elseif number == "3" then dankSetting = "high" outputChatBox ( "Rocket velocity set to #00FF00high", 255, 255, 255, true ) elseif number == nil then outputChatBox ( "You must specify either 1 2 or 3", 255, 255, 255 ) else outputChatBox ( "Invalid Number; use 1 2 or 3", 255, 255, 255 ) end end ) addEventHandler ( "onClientPlayerVehicleExit", getRootElement(), function() if getAnalogControlState ( "accelerate" ) == 1 then removeEventHandler ( "onClientRender", getRootElement(), rocketBoost, player ) guiSetVisible ( fuelGauge, false ) if smokeGenerator then triggerServerEvent ( "killSmoke", getLocalPlayer() ) smokeGenerator = nil end end end ) addEventHandler ( "kill", getRootElement(), kill )
  22. Well i edited the rocketcar script by phillyblunt https://community.multitheftauto.com/index.php?p=resources&s=details&id=810, i won't upload it ofcourse, but i could need some help... I have created 2 commands, /tr1 and /tr2 it sets toggle on or off, that sets toggle, in Rocket Car script if you press left shift you activate boost, and stops when released, /tr1 stands for Relase the key to stop, /tr2 to make it toggle (press lshift once, and again to stop) That works, but after it restores fuel, (you have fuel ) the binds in the tr1 and tr2 settings are gone, and i have to bind them again, anyway to automatically restore binds? Sorry if its the wrong place or not allowed to post topics about this, but i will learn something about scripting too thanks for your time. EDIT: will it work with executecommand or something??
  23. Ok, http://img237.imageshack.us/img237/389/mapuf.png hehe sorry for that but the BUMP worked EDIT: Change the .png?? could changing the png affect the GUI??
×
×
  • Create New...