-
Posts
575 -
Joined
Everything posted by codeluaeveryday
-
I've tested it, the 'onClientMouseEnter' isn't starting...
-
I swear it should work, change guiRoot to getRootElement().
-
Can't you just use (client): setPedAimTarget()
-
No problem, it's my fault for making that dumb small mistake I actually feel bad for doing that. Have a lovely year.
-
Enjoy. local Buttons = { [Button[1]] = true, [Button[2]] = true, [Button[3]] = true, [Button[4]] = true, [Button[5]] = true } addEventHandler("onClientMouseEnter",guiRoot, function ( ) if Buttons[source] then playSoundFrontEnd(3) end end )
-
Dude wTF, I've told you to not use onClientRender, it will spam and bug. Tell me what you are trying to do.
-
[TUT] Join Country - Revamped Scripting (Admin is outdated)
codeluaeveryday replied to codeluaeveryday's topic in Tutorials
No problem Markeloff -
Sorry small mistake, its now working: addEventHandler('onClientResourceStart', getRootElement(), function(that) if that ~= this then for i, v in ipairs(getElementsByType("sound")) do stopSound(v) end startMusic() end end ) function startMusic() setRadioChannel(0) song = playSound("song.mp3",true) end function makeRadioStayOff() setRadioChannel(0) cancelEvent() end function toggleSong() if not songOff then setSoundVolume(song,0) songOff = true removeEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff) else setSoundVolume(song,1) songOff = false setRadioChannel(0) addEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff) end end addEventHandler("onClientPlayerRadioSwitch",getRootElement(), makeRadioStayOff) addEventHandler("onClientPlayerVehicleEnter",getRootElement(), makeRadioStayOff) addCommandHandler("music", toggleSong) bindKey("m","down","music")
-
{9MoD} for sell Group-System V1.1 by ahmedfef [same cit2]
codeluaeveryday replied to ahmedfef's topic in Resources
what are you say? i made the same script to sell it you know arabic people Sabotage any server Best of his server so made and sell is the best solution Ahmed, I don't doubt you didn't make it, but your selling other peoples ideas. -
Techniqually you cannot guess the next map of a random map, I think if you could find a way to set the next map to a random choice, then you could create DX text for it.
-
Your code is spamming the setTimer over and over and over and will never finish the loop. Let the best kid in town solve this problemo for you. Since it is a client sided code, it would be ok to use setTimer: function startZoom() z = 100 setCameraMatrix(0,0,z,-1056.7127685547, 1042.8658447266, 38.503734588623) setTimer(function() z = z - 1 setCameraMatrix(0,0,z,-1056.7127685547, 1032.8658447266, 38.503734588623) end, 50, 95) end addCommandHandler('zoom', startZoom) Couldn't fully decipher what you needed, so is this what you wanted? If this is what you wanted, just add startZoom() to wherever in your code you want it to begin, also you might want to remove the command handler.
-
The way you did it was very untidy. I have fixed the problem, all the functions were jumbled and out of order, also you didnt have 'g' and 'b' defined in the 'nametagColorChangeManual' function. New Code: function nametagColorChangeManual ( thePlayer, commandName, r, g, b ) setPlayerNametagColor ( thePlayer, r, g, b ) end addCommandHandler ( "namecolormanual", nametagColorChangeManual ) function namecolorred ( thePlayer ) local arg = { 255,0,0 } executeCommandHandler ( "namecolormanual", thePlayer, arg[1], arg[2], arg[3]) end addCommandHandler ( "namecolor-red", namecolorred )
-
You need to set the interval in how long until the time is reset. setMinuteDuration(31536000000) No need to set a timer, that should last 12 months before it begins changing. Enjoy.
-
I suspect your HTTP server is offline, I ran into a similar problem. Make sure your server is offline while we do this. Open mtaserver.conf, and ensure that the 'httpserver' is equaled to 1! <!-- This parameter specifies whether the builtin http server will be used. Values: 0 - disabled , 1 - enabled ; default value: 1. Optional parameter. --> <httpserver>1</httpserver> Now you may restart your server, hopefully this was the case.
-
Each port is unique and cannot overlap, port '22011' is currently in use. Open up the 'mtaserver.conf' file, and look for HTTP port and not the server port. ONLY THE HTTP port, change this value to a new number. <!-- This parameter specifies the TCP port on which the server will be accepting incoming http connections. It can be set to the same value as <serverport> <httpport>31100</httpport>
-
Blinking is usually subsequent, using math.random is not needed. If I saw unordered blinking in a server I'd cut my throat. I have a very fast reaction time, I can count in milliseconds, so I would notice this, not sure of others. If it was DX Text, I'd either use a timer to modify an Alpha Variable, or I would add this to the onClientRender: speed = 20 blink = (blink or 0) + 1 if blink == (speed / 2) then alpha = 255 elseif blink == speed then alpha = 0 end You would need to add the alpha value to your DX Text. P.S ( Reason I can count in milliseconds is because I meditate and I also play very time dependent games )
-
I ALREADY TOLD YOU, to block it using the freaking ACL, this will block all maps.
-
Your welcome friend.
-
function DestructionWin( vehicle ) local alivePlayers = getAlivePlayers( ) if (#alivePlayers == 1) and getElementData(alivePlayers[1], 'state') ~= 'waiting' then thePlayer = alivePlayers[1] if isElement( thePlayer ) then local account = getPlayerAccount( thePlayer ) if isGuestAccount( account ) then return end local mapsWonDM = tonumber(loadPlayerData(thePlayer,"mapsWonDM")) savePlayerData(thePlayer,"mapsWonDM", mapsWonDM+1) outputChatBox ( "#00FF00* [#FFFFFFWIN#00FF00]#FFFFFF" .. getPlayerName( thePlayer ) .. " #FFFFFFwins this map!", root, 255, 255, 255, true ) end end end addEvent( 'onPlayerRaceWasted',true ) addEventHandler( "onPlayerRaceWasted", root,DestructionWin )
-
My script for what you want is almost complete.
-
Its a custom DX chatbox. I had this idea some time ago I know how to script it (in theory). I was about to make you guys make it yourself, Im making it now.
-
Please take note! It is not that hard to understand. I only added a few characters. function DestructionWin( vehicle ) local alivePlayers = getAlivePlayers( ) if (#alivePlayers == 1) and getElementData(alivePlayers[1], 'state') ~= 'waiting' then if isElement( alivePlayers[1] ) then local account = getPlayerAccount( alivePlayers[1] ) if isGuestAccount( account ) then return end local mapsWonDM = tonumber(loadPlayerData(thePlayer,"mapsWonDM")) savePlayerData(thePlayer,"mapsWonDM", mapsWonDM+1) outputChatBox ( "#00FF00* [#FFFFFFWIN#00FF00]#FFFFFF" .. getPlayerName( alivePlayers[1] ) .. " #FFFFFFwins this map!", root, 255, 255, 255, true ) end end end addEvent( 'onPlayerRaceWasted',true ) addEventHandler( "onPlayerRaceWasted", root,DestructionWin )
-
Please learn from this code I just baked in my oven. chatRadius = 30 addEventHandler('onPlayerChat', getRootElement(), function(message, mType) if mType == 1 then cancelEvent() local posX, posY, posZ = getElementPosition(source) local chatSphere = createColSphere(posX, posY, posZ, chatRadius) local nearbyPlayers = getElementsWithinColShape(chatSphere, "player") destroyElement(chatSphere) for i, v in ipairs(nearbyPlayers) do outputChatBox('* '..getPlayerName(v):gsub('#%x%x%x%x%x%x', '')..' '..message:gsub('#%x%x%x%x%x%x', ''), v, 255, 0, 255) end end end )
-
You need to use onClientResourceStart. I recommend you do not mute the sound, this can cause lag as it still uses background CPU. Example: -- This script requires mapmanager to be running! addEventHandler('onClientResourceStart', getRootElement(), function(that) if that ~= this and exports.mapmanager:isMap(that) then for i, v in ipairs(getElementsByType("sound")) do stopSound(v) end startMusic() end end ) function startMusic() setRadioChannel(0) song = playSound("song.mp3",true) end function makeRadioStayOff() setRadioChannel(0) cancelEvent() end function toggleSong() if not songOff then setSoundVolume(song,0) songOff = true removeEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff) else setSoundVolume(song,1) songOff = false setRadioChannel(0) addEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff) end end addEventHandler("onClientPlayerRadioSwitch",getRootElement(), makeRadioStayOff) addEventHandler("onClientPlayerVehicleEnter",getRootElement(), makeRadioStayOff) addCommandHandler("music", toggleSong) bindKey("m","down","music")
-
Ixjf is correct about this. You are sending the file at the same speed as the file size, if this was a big file it would lag the server. The point of latent events is too be able to slow the process so the server doesn't get overworked so much with bandwidth.