Jump to content

Dark Dragon

Members
  • Posts

    1,619
  • Joined

  • Last visited

Everything posted by Dark Dragon

  1. good work, but "easy to use" is something different in my opinion. see how the original helpmanager does it. It uses exported functions to give scripters the opportunity to design their own tabs and put it directly into the helpmanager. to improve your intogui you should make it fully compatible with the functionality of the original helpmanager, and then add new features. good luck
  2. unfortunately not. this is a valid request. feel free to post it on mantis: http://bugs.mtasa.com/main_page.php
  3. it just stays because you set the camera matrix only once. use client side code and set the camera matrix within onClientPreRender, like in my example
  4. create a table which stores the clip size of all weapons, then simply add the difference between max clip amount and currently in clip amount to your totalammo
  5. Dark Dragon

    DD/DM WIN

    there simply is no such event unless you trigger it somewhere else. race won't
  6. there is no such event and if it existed sourcePlayer would still be missing, beside that i doubt setPedFrozen will have any effect on a ped/player in a vehicle
  7. Dark Dragon

    Help!!

    could you tell us what doesn't work? how far can you get?
  8. Dark Dragon

    bets

    race fires custom events which are meant to be used local allowBets = false function betLimit(newState,oldState) allowBets = true if newState == "Running" then setTimer(endBetTime,30000,1) end end) addEvent("onRaceStateChanging",true) addEventHandler("onRaceStateChanging",getRootElement(),betLimit) function endBetTime() allowBets = false end --etc...
  9. function someFunction() setElementInterior(source,interior,x,y,z) -- replace interior,x,y and z end addEventHandler("onPlayerSpawn",getRootElement(),someFunction)
  10. in this case adding the command handler server side would probably be the more efficient way
  11. in what way is this relevant to the problem? his problem is using the editor in general did you read https://wiki.multitheftauto.com/wiki/Resource:Editor it says pretty much everything you need
  12. remember what i told you about debugging? try this function onSoundEvent () outputDebugString("command used") local sound = playSound("music.mp3",false) outputDebugString(tostring(sound)) end addCommandHandler("startc", onSoundEvent)
  13. is this a client side file? did you add the file in the meta.xml? by the way you broke your script even further function onSoundEvent () local sound = playSound("music.mp3",false) end addCommandHandler("startc", onSoundEvent)
  14. function onResourceStart() local sound = playSound("music.mp3",true) end addCommandHandler("startc",onResourceStart) is this what you mean?
  15. Dark Dragon

    timer :S

    where is your 'randomVehColors' function? put the ) behind the first 'end'
  16. in line 6 you use afkTime, which does not exist. but wait there is more, i will now teach you to find problems like this! afkTimer = 30000 function funcInput ( key, keyState ) outputDebugString("key state change") if ( keyState == "up" ) then outputDebugString("state up") if not isTimer(afktimer) then outputDebugString("no timer existing") afktimer = setTimer(function() outputChatBox("afk") end,afkTime,1) outputDebugString(tostring(afktimer)) end else killTimer ( afktimer ) end end function bindTheKeys () outputDebugString("resoruce start") bindKey ( "w", "both", funcInput ) bindKey ( "a ", "both", funcInput ) bindKey ( "s", "both", funcInput ) bindKey ( "d", "both", funcInput ) bindKey ( "arrow_l", "both", funcInput ) bindKey ( "arrow_r", "both", funcInput ) bindKey ( "arrow_u", "both", funcInput ) bindKey ( "arrow_d", "both", funcInput ) end addEventHandler("onClientResourceStart",getRootElement(),bindTheKeys) see all those debug string outputs? they help you find problems. in this case you would see the following when testing: resource start key state change bad argument @killTimer key state change state up no timer existing false false? oh, seems like setTimer had some problems. now you should have no problem finding the problem, you use a afkTime variable, but you never define it, all you have is a afkTimer variable. voilà, problem found. i'll also fix some other problems with your script afkTime = 30000 function funcInput ( key, keyState ) if ( keyState == "up" ) then if not isTimer(afktimer) then afktimer = setTimer(function() outputChatBox("afk") end,afkTime,1) end else if isTimer( afktimer) then -- only try to kill the timer if there actually is a timer killTimer ( afktimer ) end end end function bindTheKeys () bindKey ( "w", "both", funcInput ) bindKey ( "a ", "both", funcInput ) bindKey ( "s", "both", funcInput ) bindKey ( "d", "both", funcInput ) bindKey ( "arrow_l", "both", funcInput ) bindKey ( "arrow_r", "both", funcInput ) bindKey ( "arrow_u", "both", funcInput ) bindKey ( "arrow_d", "both", funcInput ) end addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),bindTheKeys) -- only trigger for the start of this resource
  17. setElementData(winner,"Race Loses",tonumber(getElementData(winner,"Race Loses"))+1) might this be the problem?
  18. if you cannot connect at all it could be the fault of some very strict firewall or even anti virus software. disable them for a moment, then try again, if it works make sure you allow mta to access the internet and turn your security software on again
  19. not possible at the moment, but will be available as soon as mta successfully migrated to the BASS audio library. you can follow developer progress here: http://code.google.com/p/mtasa-blue/source/list
  20. I think what you want to do can be done a lot easier local numberOfAllLaps = get(getResourceName(call(getResourceFromName("mapmanager"),"getRunningGamemodeMap"))..".laps")
  21. there is no such function, it's an exported function from the resource mapmanager. use call to use exported functions
  22. you can simply modify the interiors resource to your preferences, see this page for information on how to do that: https://wiki.multitheftauto.com/wiki/Resource:Interiors
  23. local obj1 = createObject(1337,0,0,5) setElementAlpha(obj1,0) local obj2 = createObject(1337,-5,5,4.5) setElementAlpha(obj2,0) fadeCamera(true) moveObject(obj1,30000,5,0,5) moveObject(obj2,30000,10,5,4.5) addEventHandler("onClientPreRender",getRootElement(), function() local cx,cy,cz = getElementPosition(obj1) local tx,ty,tz = getElementPosition(obj2) setCameraMatrix(cx,cy,cz,tx,ty,tz) end )
×
×
  • Create New...