Jump to content

dzek (varez)

Retired Staff
  • Posts

    4,144
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by dzek (varez)

  1. WTF? leave these timers alone!! function disableFireForHunter ( theVehicle, seat ) if ( getElementModel ( theVehicle ) == 425 ) then -- if they entered a hunter toggleControl ( "vehicle_secondary_fire", false ) -- disable their fire key else -- if they entered another vehicle toggleControl ( "vehicle_secondary_fire", true ) -- enable their fire key end end addEventHandler ( "onClientPlayerVehicleEnter", getLocalPlayer(), disableFireForHunter) the only problem is that onClientPlayerEnterVehicle event not exist, it's onClientPlayerVehicleEnter there was bug in wiki, and i fixed it
  2. just read examples in wiki? like this one https://wiki.multitheftauto.com/wiki/OnPlayerLogin
  3. https://community.multitheftauto.com/?p=resources ... ils&id=940
  4. 2nd argument of getControlState is STRING getControlState(thePlayer, "accelerate")
  5. onClientPlayerJoin will never fire for local player you didnt get idea how to make it.. addEventHandler( "onClientResourceStart", getRootElement(), function(startedRes) if (startedRes == getResourceRootElement()) then -- only if THIS resource starts (not any resource) OnPlayerJoinToServer() end end ) function OnPlayerJoinToServer() outputChatBox ( "Welcome to the FOBI RPG/Freeroam server!", getRootElement(), 0, 0, 255 ) outputChatBox ( "In FOBI you have to register with /register [Password] and /login [Password]", getRootElement(), 0, 0, 255 ) outputChatBox ( "But be careful! Always use the same name! Otherwise the server wont recognize you!", getRootElement(), 0, 0, 255 ) outputChatBox ( "You are now ready to join the server. Play fair, be nice and have fun!", getRootElement(), 0, 0, 255 ) fadeCamera(true) setCameraTarget(getLocalPlayer()) setCameraMatrix(2051.3527832031, 1343.1384277344, 19.391807556152, 1981.9815673828, 1343.0343017578, 12.447468757629) -- end and it will output that text and show hotel every restart. why you want to restart it over and over? for testing you should use local server i think ..
  6. check in race resource how it's done and copy-paste ;p
  7. ghostM = false -- default, on join - its false (changing that will not cause ghost mode to be on btw) AFKtimer = nil function checkAFK() if (conditions) -- replace conditions with getControlState setElementData( thePlayer, "overrideCollide.uniqueblah", nil, false) removeTimer(AFKtimer) end end function GhostMode() thePlayer = source setElementData( thePlayer, "overrideCollide.uniqueblah", 0, false ) if isTimer(AFKtimer) then killTimer(AFKtimer) end -- we kill timer if theres already one AFKtimer = setTimer(checkAFK, 50, 0) -- we are creating new one end i wrote it in browser, could not work, but should.. try some debugging if not (put outputDebugString and some text after each function, if, etc - see debug with "debugscript 3" in ingame console)
  8. if you want only to show them in editor (not being able to move them) - just start your resource via console (f8, "start res_name").. if you want to move them.. you have to save your objects to xml file, like map editor does..
  9. lets check it line by line, or something: (btw, use "lua" tags, not "code") addEvent('onClientMapStarting', true) -- we are adding event function GhostMode() -- this is fired when map is starting thePlayer = source setElementData( thePlayer, "overrideCollide.uniqueblah", 0, false ) -- we are setting element data if getKeyState( "w" ) == true or getKeyState( "s" ) == true then -- and ONCE (function is fired once! it's logical)on this one frame when event is being fired, we are checking if player is pressing w or s.. so player need to keep it pressed all the time on new map start to make it work.. setElementData( thePlayer, "overrideCollide.uniqueblah", nil, false ) end end addEventHandler('onClientMapStarting', getRootElement(), GhostMode) -- we are adding event handler. once again: THIS IS FIRED ONCE on every map start you should add timer (and remove old timer, if player was afk whole round) checking if player is pressing ACCELERATION or BRAKE/REVERSE (not "w", "s".. im playing using key up/down arrow, somebody could use "i" "k", somebody even "f3" and "f10" ;p -- use getControlState) on this timer after player is pressing needed key - remove the timer and setElementData
  10. I totally missed this party and topic (was on vacation), and i see it (topic) is closed now.. But.. I WAS NOT THERE o_O I saw you was talking something about me I'm not playing MTA anymore, and I'm not even using "varez" ingame.. Some stranger (not to say: fcker) could ruin my reputation, or something, by doing this ;| Where is topic: "Post here and see what will happen" gone? It was dumb etc, and i didn't like the way my msgs was edited, but now it's gone w/out single word.. It's all getting weird ;|
  11. i know this is old, i just remembered it yesterday, and posted ;P
  12. TC I had lots of fun playing games with you in person. The gaming and non-gaming activities were amazing. I don't know what everyone else is complaining about. Every time I think about what we did together I just get shivers up and down my spine. I can't for the next event.
  13. dzek (varez)

    time

    well, your right 50p. Wisin, you dont understand your code right? you should get back to basics
  14. its <?php echo $_SERVER['REMOTE_ADDR']; ?> actually ;p
  15. we need more info any errors? what exactly is not working? is gui working fine? etc etc
  16. haha, epic drawing im not sure if its possible to attach player to player, your code looks ok, does it throw any error/warning? are you sure you put it server side? yes, detachElements will be ok
  17. there was on this forum (look pages 2-5, should be somewhere there) an example, as another user was asking for it
  18. dzek (varez)

    time

    you wanted to show play time not join time, right? on every player join (btw, do it server side) - save his join time in table/array: joinTimes = { } function onJoin() joinTimes[source]=getTickCount() end then every second or somthing loop through all players (getElementsByType) for each of them get actual tick count, subtract actual from join, convert it with function, and set element data
  19. https://community.multitheftauto.com/?p=resources ... nts&id=934
  20. if you will rebuild GUI, and script a lot, there is a way to script new weapon. it will be a much to code anyway, but you can try, but dont except us to do it
  21. dzek (varez)

    time

    you put it already, afair.. ?? just convert it with this before assigning element data..
  22. dzek (varez)

    time

    ill check it as i cannot spot error in browser edit: oh, addCommandHandler on server side it will be function convert_to_human_time(thePlayer, commandName, dana) on client: function convert_to_human_time(commandName, dana) this is basics.. you really have to spend some time on learning..
×
×
  • Create New...