-
Posts
575 -
Joined
Everything posted by codeluaeveryday
-
I made the same for my BaseMode server. Client: weaponDING = 'ding.mp3' addEventHandler('onClientPlayerDamage', getRootElement(), function(attacker, weapon, bodypart) if attacker == localPlayer then playSound(weaponDING) end end ) Replace line 1 with your damage sound.
-
This should do it my awesome friend, function timerText() dxDrawBorderedTitleText("Time Left: "..(timeLeft or 'BUGGED'), 0, 0, 1279, 65, tocolor(0, 255, 255, 255), 2, "default", "center", "center", false, false, true, false, false) end function startJailGUITimer(player,timer) addEventHandler('onClientRender',root,timerText) setTimer( function () removeEventHandler("onClientRender",root,timerText) end, timer * 1000, 1 ) timeLeft = timer setTimer( function() timeLeft = timeLeft - 1 end, 1000, timer ) end addEvent("jail:startDxTimer",true) addEventHandler("jail:startDxTimer",root,startJailGUITimer)
-
It was a bit annoying to not know what purpose you need it for, but this is the best example I could create for you, it actually could've been better, but you get the point. sX, sY = guiGetScreenSize() addEventHandler('onClientRender', getRootElement(), function() dxDrawRectangle(sX, sY, 200, 50, tocolor(30, 30, 30, 200), false) dxDrawRectangle(sX, sY, dxProgressBarGetProgress()*2, 50, tocolor(255, 0, 0, 200), false) end ) function dxProgressBarSetProgress(new) progress = new end function dxProgressBarGetProgress() return progress end
-
Yes Max, it should be, good job!
-
Try this friend, plus there are many bugs. SCREENSHOT AND UPLOAD WHAT IT LOOKS LIKE IN 800x600 and your main resolution. sx,sy = guiGetScreenSize() font = dxCreateFont("tsw.ttf", 20) local messagesList = { "LOL MESSAGE", "Server Owner: Sex*", "Have Fun!" } local currentMessage = 0 function toggleHideAll() startTimess = getTickCount() addEventHandler("onClientRender",getRootElement(),mapwindowa) end addEventHandler ( "onClientPlayerWasted", localPlayer, function ( ) toggleHideAll ( ) end ) function mapwindowa() local pX, pY, pZ = getElementPosition ( source ) local hours = getRealTime() .hour local minutes = getRealTime() .minute local seconds = getRealTime() .second local sec = getTickCount() / 1 local rotate = math.ceil(sec) * 0.20 deltaTime = (getTickCount()) - startTimess if deltaTime <= 1000 then beta = sy - ((deltaTime/1000)*100) elseif (deltaTime > 1000) and (deltaTime < 4000) then beta = sy-100 end dxDrawRectangle((sx-(1400/1366)*sx)/2,beta,(1400/1366)*sx,110,tocolor ( 0, 0, 0, 225 )) dxDrawImage ( sx-200, sy-100, 140, 100, 'load.png', rotate, 0, 0 ) dxDrawText("Time:"..hours..":"..minutes..":"..seconds,125+(sx-400)/2,beta+50,((sx-400)/2)+400,beta+99,tocolor(255,255,255),2,"default-bold","left","top",true,true,true) dxDrawText(messagesList[currentMessage + 1], screenWidth - 400, 6, screenWidth - 400, 16, tocolor(0, 255, 0, 255), 1, "font", "center", "top", false, false, false) end ) function updateMessage() if (currentMessage == 4) then currentMessage = 0 else currentMessage = currentMessage + 1 end end setTimer(updateMessage, 5000, 0) addEvent (":O", true) addEventHandler (":O", root, function () removeEventHandler ("onClientRender", root, mapwindowa) removeEventHandler ( "onClientPlayerSpawn", getLocalPlayer(), mapwindowa) end )
-
Are you SERIOUS right now? Wtf, Anderl I know your pain everyday. /whowas PlayerNameToBan Copy the serial /banserial SERIAL ^^ DUHHHHHH.... Plus Anderl my code addition above does that lol... I'm still with Anderl. P.S Send me the hack in a PM, uhm just for testing so I can develop a anti-hack code for it... Yep anti-hack Quick send it.
-
Errors: #1 ) unpackPoles() at Line 3 is undefined #2 ) In the createPoleMarkerAndBlip() function, you are using source, this will work for everything but the onClientResourceStart, since the source of the event is the started element... #3 ) localPlayer is being used at line 4 instead of using source, also this will cause a relevant problem with #2 if you don't fix problem #2. #4 ) The arguments you passed in onClientMarkerHit are wrong, you just have player, you need player and dimension. There will be a few more bugs after this for you to figure out. Try new code, make sure you define unpackPoles(): function createPoleMarkerAndBlip() if getElementData(source, "Occupation") == "Electrician" and getElementType(source) == 'player' then local x, y, z = unpackPoles() electritionPoleMarker = createMarker(x, y, z, "cylinder", 3, 200, 200, 0, 85, source) setElementData(electritionPoleMarker, "Electrician", "poleMarker", true) electritonPoleBlip = createBlip(x, y, z, 19) elseif getElementType(source) ~= 'player' then local x, y, z = unpackPoles() -- You need to DEFINE this... electritionPoleMarker = createMarker(x, y, z, "cylinder", 3, 200, 200, 0, 85, localPlayer) setElementData(electritionPoleMarker, "Electrician", "poleMarker", true) electritonPoleBlip = createBlip(x, y, z, 19) end end addEvent("electrition:createPoles", true) addEventHandler("electrition:createPoles", root, createPoleMarkerAndBlip) addEventHandler("onClientPlayerJoin", root, createPoleMarkerAndBlip) addEventHandler("onClientResourceStart", root, createPoleMarkerAndBlip) addEventHandler("onClientMarkerHit", electritionPoleMarker, function(player, dimension) if isPlayerInVehicle ( player ) or ( doesPlayerHaveJetPack ( player ) ) then outputChatBox("Get out of the vehicle, to fix the pole.", 255, 0, 0) return end if source == electritionPoleMarker and player == localPlayer and getElementData(player, "Occupation") == "Electrician" then setElementFrozen(localPlayer, true) showCursor(true) guiSetVisible(jobs_electitian_label_timeLeft, true) triggerServerEvent("electrain:fixPole:animation", localPlayer) guiSetText(jobs_electitian_label_timeLeft, "Time Left: 6") setTimer(function() guiSetText(jobs_electitian_label_timeLeft, "Time Left: 5") end, 1000, 1) setTimer(function() guiSetText(jobs_electitian_label_timeLeft, "Time Left: 4") end, 2000, 1) setTimer(function() guiSetText(jobs_electitian_label_timeLeft, "Time Left: 3") end, 3000, 1) setTimer(function() guiSetText(jobs_electitian_label_timeLeft, "Time Left: 2") end, 4000, 1) setTimer(function() guiSetText(jobs_electitian_label_timeLeft, "Time Left: 1") end, 5000, 1) startTimerWhenMarkerHit = setTimer(function() destroyElement(electritonPoleBlip) destroyElement(electritionPoleMarker) triggerEvent("electrition:createPoles", localPlayer) triggerServerEvent("electrition:fixPole", localPlayer) showCursor(false, false) setElementFrozen(localPlayer, false) guiSetVisible(jobs_electitian_label_timeLeft, false) end, 6000, 1) end end )
-
Max, you cannot make images in serverside, I assume you want the bodypart image to appear when they die. CLIENT: bodypartImage = { [3] = 'IMAGE.PNG', [4] = 'IMAGE.PNG', [5] = 'IMAGE.PNG', [6] = 'IMAGE.PNG', [7] = 'IMAGE.PNG', [8] = 'IMAGE.PNG', [9] = 'IMAGE.PNG', } addEventHandler('onClientPlayerWasted', getRootElement(), function(killer, weapon, bodypart) screenX, screenY = guiGetScreenSize() width = 300 height = 300 guiCreateStaticImage((screenX/2)-(width/2), (screenY/2)-(height/2), width, height, bodypartImage[bodypart], false) end ) Very simple just edit the table and replace the images for the different ID's, and replace the width and height variables with the correct size.
-
I am with Anderl, I also said in my post that this is just like banning a serial, it could at least be updated to using a database or a webpage of blocked serials and you can update it regularly. Also hackers? WTF I swear there is no such thing as a hack on the updated versions of MTA:SA, I've played lots of Race and Weapon Deathmatch / Basemode servers, I am extremely pro at this and have good ranks in certain servers and I never have seen a hacker, the only thing I could think of coming close to a hack would be someone with 1000 ping or more, or 6 FPS or less.
-
Hello all! I am not sure how many people have noticed that the Admin resource has outdated IP tables, and sometimes people which joined my server had the an unknown location. There is a simple way of overcoming this issue using Application programming interface (API), this allows us to access other websites applications to obtain data and in this case we will access a constantly updated IP API to get the location. This code can be easily melded into any purpose and even the possibility of blocking certain countries from joining the server. We will be using http://ipinfodb.com to collect the players country. IPInfoDB provides you with 2 calls per second, anything more is delayed by one second, this is good because we can then store this data in a table! IPInfoDB says that they are using a less accurate database, but its very accurate, they update it themselves, and if you answer the register properly you will only be helping. Dependencies: Title Case function (Add it to your code): function titlecase(str) result='' for word in string.gfind(str, "%S+") do local first = string.sub(word,1,1) result = (result .. string.upper(first) .. string.lower(string.sub(word,2)) .. ' ') end return result end Steps: 1) Getting an API key from IPInfoDB A) Goto http://ipinfodb.com/register.php B) Fill in the details on the register page and click register. C) You will need to go to your email to confirm your account. D) When you log-in you will now see your API Key at the bottom of the grey box, keep that somewhere, we will need it shortly. EXAMPLE: API Key aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 2) Creating the join code addEventHandler('onPlayerJoin', root, function() fetchRemote("http://api.ipinfodb.com/v3/ip-country/?key=Your_API_Key&format=xml&ip="..getPlayerIP(source), countryResult, "", false, source) end ) Replace Your_API_Key with your API key from IPInfoDB. The above code is downloading the source of a file which contains info on the player's country. Now we need to create the function called countryResult, this contains the returned data. 3) Returning the page data sent from the fetchRemote() This function contains the data returned from the fetchRemote, aka the Country and the IP. Add the below to your code: function countryResult(responseData, errno, thePlayer) startEntry, endEntry = responseData:find('') startEnding, endEnding = responseData:find('', endEntry+1) country = titlecase(responseData:sub(endEntry+1, startEnding - 1)) startEntry, endEntry = responseData:find('') startEnding, endEnding = responseData:find('', endEntry+1) ip = responseData:sub(endEntry+1, startEnding - 1) oldIPS[ip] = country outputChatBox('#0099FF[JOIN]#FFFFFF '.. getPlayerName(thePlayer) ..'#FFFFFF has joined from '..(country), root, 255, 100, 100,true) end 4) Storing the ip and country to save server bandwidth. Use tables of this. Firstly put a table at the beggining at line one: oldIPS = { } Now add this to the beginning of your onPlayerJoin event: if oldIPS[getPlayerIP(source)] then outputChatBox('#0099FF[JOIN]#FFFFFF '.. getPlayerName(thePlayer) ..'#FFFFFF has joined from '..(oldIPS[getPlayerIP(source)]), root, 255, 100, 100,true) return end 5) Adding a simple output for when a player changes their nickname Add the below to your code: addEventHandler('onPlayerChangeNick', root, function(oldNick, newNick) outputChatBox('#0099FF[NICK]#FFFFFF ' .. oldNick .. '#FFFFFF is now known as ' .. newNick, root, 255, 100, 100,true) end ) 6) Adding the quit message and using the table to get the country This uses the stored countries to output the players country when they quit, add the below to your code: addEventHandler('onPlayerQuit', root, function(reason) outputChatBox('#0099FF[QUIT]#FFFFFF ' .. getPlayerName(source) .. '#FFFFFF has left from '.. oldIPS[getPlayerIP(source)] .. ' [' .. reason .. ']', root, 255, 100, 100,true) end ) Full Code (If your copying the full code, then replace the Your_API_Key with the key you obtained from Step 1: oldIPS = { } function titlecase(str) result='' for word in string.gfind(str, "%S+") do local first = string.sub(word,1,1) result = (result .. string.upper(first) .. string.lower(string.sub(word,2)) .. ' ') end return result end function countryResult(responseData, errno, thePlayer) startEntry, endEntry = responseData:find('') startEnding, endEnding = responseData:find('', endEntry+1) country = titlecase(responseData:sub(endEntry+1, startEnding - 1)) startEntry, endEntry = responseData:find('') startEnding, endEnding = responseData:find('', endEntry+1) ip = responseData:sub(endEntry+1, startEnding - 1) oldIPS[ip] = country outputChatBox('#0099FF[JOIN]#FFFFFF '.. getPlayerName(thePlayer) ..'#FFFFFF has joined from '..(country), root, 255, 100, 100,true) end addEventHandler('onPlayerJoin', root, function() if oldIPS[getPlayerIP(source)] then outputChatBox('#0099FF[JOIN]#FFFFFF '.. getPlayerName(thePlayer) ..'#FFFFFF has joined from '..(oldIPS[getPlayerIP(source)]), root, 255, 100, 100,true) return end fetchRemote("http://api.ipinfodb.com/v3/ip-country/?key=Your_API_Key&format=xml&ip="..getPlayerIP(source), countryResult, "", false, source) end ) addEventHandler('onPlayerChangeNick', root, function(oldNick, newNick) outputChatBox('#0099FF[NICK]#FFFFFF ' .. oldNick .. '#FFFFFF is now known as ' .. newNick, root, 255, 100, 100,true) end ) addEventHandler('onPlayerQuit', root, function(reason) outputChatBox('#0099FF[QUIT]#FFFFFF ' .. getPlayerName(source) .. '#FFFFFF has left from '.. oldIPS[getPlayerIP(source)] .. ' [' .. reason .. ']', root, 255, 100, 100,true) end )
-
Ok man, this needs some serious updates. Also no offense, but the way you are doing it isn't the most effective way, take note of the modifications below, also this has the same ability as normal bans... Use: https://wiki.multitheftauto.com/wiki/OnPlayerConnect Server = --------Made By Ops1 = Yasser --- xxx = serials not allowed players you can put 10 serials firewall = { ['XXX'] = true, ['XXX'] = true, ['XXX'] = true, ['XXX'] = true, ['XXX'] = true, ['XXX'] = true, ['XXX'] = true, ['XXX'] = true, ['XXX'] = true, ['XXX'] = true, ['XXX'] = true, } addEventHandler('onPlayerConnect', getRootElement(), function(playerNick, playerIP, playerUsername, playerSerial, playerVersionNumber, playerVersionString) if firewall[playerSerial] then cancelEvent('You can\'t enter the server, your serial blocked.') end end ) Also in the client, you are using onClientPlayerQuit, this might get in the way of other peoples codes, so you might wish to block it.
-
Ok, so I can practically guess people will want me to make a parser, I literally am willing to waste more time accessing and reading the table, I would happily go through the servers memory, if someone will guide me. The reason is because of my IP to location code, it calls a site and returns the country and a other data in Json format, I store their IP's in a table to prevent bandwidth usage. So its obviously temporary and I wish to make it permanent. I was thinking about finding a way to get the userdata of it then using createElement, probably not possible. There has to be a another way...
-
1) As far as I know clothing cannot be scaled as it is not an actual object. 2) Small errors: function updateBlipColor ( player ) local attachedblip = getElementAttachedTo ( player ) if ( attachedblip ) then local r,g,b = getTeamColor ( getPlayerTeam( player ) ) setBlipColor(attachedblip, r,g,b, 255) end end Make sure your calling this function...
-
lol just lol, I have contacted a few scripters and they can't solve it either, it was created on a client side script and it worked until I restarted the resource, then it started returning false.
-
Ok guys I will need help, but I will make this a game. The first person to actually solve this wins cake! LUA CODE: xmlMain = xmlLoadFile('myvehicles.xml') What are the reasons for the above returning false? BTW, the file does exist, its in my folder, and this is clientsided. EDIT: SOmething is bugged in my post views for this Topic, wtf, where do i report this type of bug also?
-
I guess if you wanted to one shot players with your car you could use handling to make the car heavy and fast. the player would die from that.
-
how do people not know bbcode?
-
They should make it available for us to change how much the damage we take from being rammed. The more the better.
-
Great, another player doesn't understand, I don't want my scripts to be re-shared. It is not SHAREWARE... I have updated my code, so look at version 2.6.0 to compare. My resource: https://community.multitheftauto.com/index.php?p= ... ls&id=2963 His resource (STOLEN): https://community.multitheftauto.com/index.php?p= ... ls&id=6117 Coding is practically the same, he modified the table. Also modified the meta.xml to have his name. DONE
-
I am currently camping and I told manve so he would fix it, I got low reception too.
-
Manve1 all I see from you is scripting mistakes, your code will make everyone in the the server god mode when a player is damaged. You need to make the god mode clientsided, and you should never rely on names, use serials / account. I understand your new to this, but he wants a solid working code.
-
Hi all, this is my first map ever, I have never mapped a race map before. I am posting it here to see what people think. I came here prepared for insults, now go ahead and surprise me! Cheers Chris...
-
Nope, I easily added crosshairs for normal weapons, using shaders. Shaders will replace them without a problem.
-
I did not modify anything. I added color to the window name, i added a few textboxes. The problem I believe is i added a position code with GUIEDITOR, and the error says that on line 698, ___PositionCode)___ tab was not defined, now I have all my other codes which are working fine, and this was my first output, could it be because of that?
-
This code, it was the first output: GUIEditor = { tab = {}, button = {}, edit = {}, label = {}, } GUIEditor = { tabpanel = {} } local screenW, screenH = guiGetScreenSize() LoginPanel = guiCreateWindow((screenW - 283) / 2, (screenH - 359) / 2, 283, 359, "Login Panel", false) guiWindowSetMovable(LoginPanel, false) guiSetAlpha(LoginPanel, 1.00) guiSetProperty(LoginPanel, "CaptionColour", "FFF8B516") GUIEditor.tabpanel[1] = guiCreateTabPanel(10, 19, 264, 331, false, LoginPanel) GUIEditor.tab[1] = guiCreateTab("Login", GUIEditor.tabpanel[1]) GUIEditor.button[1] = guiCreateButton(168, 267, 91, 35, "Login", false, GUIEditor.tab[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA") GUIEditor.edit[1] = guiCreateEdit(92, 36, 158, 30, "", false, GUIEditor.tab[1]) GUIEditor.label[1] = guiCreateLabel(0, 36, 92, 30, "Username:", false, GUIEditor.tab[1]) guiSetFont(GUIEditor.label[1], "default-bold-small") guiLabelSetColor(GUIEditor.label[1], 204, 98, 20) guiLabelSetHorizontalAlign(GUIEditor.label[1], "center", false) guiLabelSetVerticalAlign(GUIEditor.label[1], "center") GUIEditor.label[2] = guiCreateLabel(0, 5, 263, 18, "Login", false, GUIEditor.tab[1]) guiSetFont(GUIEditor.label[2], "default-bold-small") guiLabelSetColor(GUIEditor.label[2], 227, 84, 21) guiLabelSetHorizontalAlign(GUIEditor.label[2], "center", false) guiLabelSetVerticalAlign(GUIEditor.label[2], "center") GUIEditor.label[3] = guiCreateLabel(-3, 16, 263, 15, "________________________________________", false, GUIEditor.tab[1]) guiSetFont(GUIEditor.label[3], "default-bold-small") guiLabelSetColor(GUIEditor.label[3], 227, 84, 21) guiLabelSetHorizontalAlign(GUIEditor.label[3], "center", false) GUIEditor.tab[2] = guiCreateTab("Register", GUIEditor.tabpanel[1])