Jump to content

Bonus

Members
  • Posts

    297
  • Joined

  • Last visited

Everything posted by Bonus

  1. The timer is 2*60*60*1000 = 120 minutes. setWeatherBlended changes the weather in a 2 hours period. If you want a faster change use setWeather instead and change the time to something lower like 30*1000 (30 secs). Try that: function changeWeatherRandom ( ) setWeather ( math.random ( 0, 255 ) end setTimer ( changeWeatherRandom, 20*1000, 0 ) Then you will see how it works.
  2. Then you have to trigger it in triggerServerEvent and use the skin-ID in spawnPlayer
  3. Bonus

    Solved

    No, there is no [] You want help? Then do what I tell you. Look in your local resources folder, not where your serversided files are. You have to look there where the clientsided files are getting downloaded. Mine would be: C:\Program Files (x86)\MTA San Andreas 1.4\mods\deathmatch\resources\TDS\logs\logs.log Its NOT server! I never wrote server! TDS is the name of MY resource. Your resource should be something else.
  4. Don't use setElementModel clientsided, else only the client can see it. Use the Skin-ID in spawnPlayer.
  5. Bonus

    Solved

    No, not [gamemodes] Your local mta folder, not server folder. Mine would be: C:\Program Files (x86)\MTA San Andreas 1.4\mods\deathmatch\resources\TDS\logs\logs.log Its clientsided, thats why you get the file in your local resources folder, not where your serverfiles are.
  6. Bonus

    Cant upload!!

    "type: The type of this resource, that can be "gamemode", "script", "map" or "misc"." Not sure if meta.xml has to be case-sensitive in info. And dunno why but your Uploader expects a version in info: version="1.0" just put that in
  7. function changeRandomWeather ( ) setWeatherBlended ( math.random ( 0, 255 ) ) end setTimer ( changeRandomWeather, 2*60*60*1000, 0 )
  8. Bonus

    Cant upload!!

    Its meta.xml not Meta.xml. Show us your meta ...
  9. Then learn it Look in mta Wiki, https://wiki.multitheftauto.com
  10. You can work with dxDrawImage (for the bubble), getScreenFromWorldPosition, GetPedBonePosition, dxDrawText, onPlayerChat, isLineOfSightClear
  11. Bonus

    Solved

    You changed your nick and looked into MTA -> mods -> deathmatch -> resources -> [TheResourceName] -> logs -> logs.log But there is no file? Or is the file empty?
  12. Or put a simple tostring ( VapidCount or "wait ..." ) in
  13. You can't avoid rockets with onClientVehicleDamage? If you want others to do still damage you can ask if there is an attacker or weapon.
  14. Attach onPedDamage only to the Ped. onPlayerDamage gets triggered whenever a player gets hit, but yo are hitting a fed. And use source instead of ped, then you can create many peds with rhe same event. Then you dont destroy the tree or the ped. If you damage the ped again there will be more created objects. You arent destroying the ped or asking if he already died once.
  15. Bonus

    Solved

    You didnt add the log file in the meta right? If you did it, remove it.
  16. I think these functions don't support marker. Only vehicles, skins, objects and weapons
  17. Try this: addEventHandler ( "onClientVehicleDamage", root, function ( ) -- If you want it to take damage, but not explode -- -- if getElementHealth ( source ) < 300 then -- dunno if 300 is good, test it local rx,ry = getElementRotation ( source ) if rx > 90 and rx < 270 or ry > 90 and ry < 270 then cancelEvent() -- If it was burning before -- if getElementHealth ( source ) < 300 then setElementHealth ( source, 300 ) -- dunno if 300 is good, test it end end --end end ) I think onClientVehicleDamage should be triggered when the vehicle gets damage when its on the roof.
  18. I searched and didnt find anything. Dont understand what tocolor is doing. tocolor ( 255, 255, 255, 255 ) is equal -1 tocolor ( 0, 0, 0, 0 ) is equal 0 tocolor ( 45, 213, 31, 31 ) is equal 523097375 tocolor ( 0, 0, 0, 255 ) is equal -16777216 tocolor ( 255, 255, 255, 0 ) is equal 16777216 (the opposite)
  19. @KariiiM: With your code it gets binded only on resource start. If a player joines after the resource startet he won't get the bind for jetpack. Also there is no need for ipairs, it just slows the script for no reason. Better use: local players = getElementsByType ( "player" ) for i=1, #players do bindKey ( players[i] ... ... end or for index, player in pairs ( getElementsByType ( "player" ) do @Electro88: You can use row 1-6 in his code if you want to (re-)start the Resource while playing.
  20. The way you use bindKey is clientsided, not serversided. You have to use player for 1. argument. You can put bindKey in onPlayerJoin like addEventHandler ( "onPlayerJoin", root, function ( ) bindKey ( source, "J", "down", giveJetpack_func ) end ) function giveJetpack_func ... Oh and you can delete the 2nd doesPedHaveJetPack. If you have a jetpack it gets removed and the function stops. So you can't get to row 13 with an Jetpack, thats why its totally useless.
  21. 1. Why are you using getRootElement(), getLocalPlayer() Why not use the localPlayer as the source of the event? 2. You only trigger the localPlayer in your code. That means you get only 1 argument in your function, the player, not item or loot. You can't just write down "item" and expect it to become an item. If you dont trigger item as an argument you cant use it. Dont even understand what item or loot is. Its like you just copy and paste, don't even think about what you wrote. Try that: addEventHandler("onClientVehicleExit",getRootElement(),function() triggerServerEvent("sv_destroyWeapon", getLocalPlayer(), source) end) addEventHandler("onClientVehicleEnter",getRootElement(),function() triggerServerEvent("sv_createWeapon", getLocalPlayer(), source) end) addEvent("sv_createWeapon", true) addEventHandler("sv_createWeapon", getRootElement(), function( veh ) local x,y,z = getElementPosition(veh) local mid = getElementModel(veh) if weapOff[mid] and not getElementData(veh, "weapon2") then local weapon = createObject ( 362, x+weapOff[mid][1],y+weapOff[mid][2],z+weapOff[mid][3]) local weapon_base = createObject ( 336, x+weapOff[mid][1],y+weapOff[mid][2],z) attachElements ( weapon_base, veh, weapOff[mid][1], weapOff[mid][2], weapOff[mid][3], 0, 0, 0) attachElements ( weapon, weapon_base, 0, -0.3, 0.9, weapOff[mid][4], weapOff[mid][5], weapOff[mid][6]) setElementData(veh, "weapon", weapon_base) setElementData(veh, "weapon2", weapon) end --triggerClientEvent("cl_waitForKey", getRootElement(), veh, weapon, player) end) Not sure if its better to trigger the vehicle or get it serversided with getPedOccupiedVehicle. Don't think there's much difference.
×
×
  • Create New...