-
Posts
575 -
Joined
Everything posted by codeluaeveryday
-
You really need to learn LUA. This should help you. I finished your script. I can see your new. Your resource will need admin rights in the ACL! Client: addEventHandler("onClientResourceStart",resourceRoot, function() GUIEditor_Memo = {} Login_window = guiCreateWindow(191,106,422,357,"Login/Register",false) guiSetInputEnabled (true) -- Disables all other keys like Chat while logging in! showCursor(true) guiWindowSetMovable(Login_window,false) guiWindowSetSizable(Login_window,false) KraZWorld_image = guiCreateStaticImage(0.0853,0.0504,0.8152,0.381,"images/KraZWorld.png",true,Login_window) Username_label = guiCreateLabel(0.0711,0.4594,0.1635,0.0504,"Username:",true,Login_window) guiLabelSetColor(Username_label,255,255,255) guiLabelSetVerticalAlign(Username_label,"top") guiLabelSetHorizontalAlign(Username_label,"left",false) Username_edit = guiCreateEdit(0.2393,0.4538,0.6825,0.0672,"",true,Login_window) Password_label = guiCreateLabel(0.0711,0.5854,0.1777,0.0616,"Password:",true,Login_window) guiLabelSetColor(Password_label,255,255,255) guiLabelSetVerticalAlign(Password_label,"top") guiLabelSetHorizontalAlign(Password_label,"left",false) Password_edit = guiCreateEdit(0.2393,0.5742,0.6825,0.0728,"",true,Login_window) guiEditSetMasked (Password_edit, true) -- Masks the pass box with ***** Login_button = guiCreateButton(0.1303,0.6975,0.3649,0.1513,"Login",true,Login_window) guiSetFont(Login_button,"clear-normal") Register_button = guiCreateButton(0.5355,0.6975,0.3649,0.1513,"Register",true,Login_window) guiSetFont(Register_button,"clear-normal") Info_label = guiCreateLabel(0.2938,0.8768,0.436,0.056,"Register an account and login!",true,Login_window) guiLabelSetColor(Info_label,255,255,255) guiLabelSetVerticalAlign(Info_label,"top") guiLabelSetHorizontalAlign(Info_label,"left",false) Register_Window = guiCreateWindow(619,105,178,358,"Register",false) guiSetVisible(Register_Window,false) guiWindowSetSizable(Register_Window,false) RegisterUsername_Label = guiCreateLabel(0.3371,0.1201,0.3989,0.0503,"Username:",true,Register_Window) guiLabelSetColor(RegisterUsername_Label,255,255,255) guiLabelSetVerticalAlign(RegisterUsername_Label,"top") guiLabelSetHorizontalAlign(RegisterUsername_Label,"left",false) RegisterUsername_edit = guiCreateEdit(0.0506,0.1872,0.8989,0.067,"",true,Register_Window) RegisterPassword_label = guiCreateLabel(0.3371,0.2821,0.4326,0.0587,"Password:",true,Register_Window) guiLabelSetColor(RegisterPassword_label,255,255,255) guiLabelSetVerticalAlign(RegisterPassword_label,"top") guiLabelSetHorizontalAlign(RegisterPassword_label,"left",false) RegisterPassword_edit = guiCreateEdit(0.0506,0.3408,0.8876,0.0726,"",true,Register_Window) guiEditSetMasked (RegisterPassword_edit, true) -- Masks the pass box with ***** GUIEditor_Memo[1] = guiCreateMemo(113,-540,5,411,"",false,Register_Window) NOTE_Label = guiCreateLabel(0.1348,0.0587,0.764,0.0503,"[NOTE] Case Sensitive!",true,Register_Window) guiLabelSetColor(NOTE_Label,255,255,255) guiLabelSetVerticalAlign(NOTE_Label,"top") guiLabelSetHorizontalAlign(NOTE_Label,"left",false) RegisterRegister_Button = guiCreateButton(0.1348,0.4413,0.736,0.1173,"Register!",true,Register_Window) S1_Label = guiCreateLabel(0.0618,0.5726,0.8371,0.0503,"We Are Not Resposible for:",true,Register_Window) guiLabelSetColor(S1_Label,255,255,255) guiLabelSetVerticalAlign(S1_Label,"top") guiLabelSetHorizontalAlign(S1_Label,"left",false) S2_Label = guiCreateLabel(0.2528,0.6229,0.5169,0.0475,"Lost Passwords,",true,Register_Window) guiLabelSetColor(S2_Label,255,255,255) guiLabelSetVerticalAlign(S2_Label,"top") guiLabelSetHorizontalAlign(S2_Label,"left",false) S3_Label = guiCreateLabel(0.2079,0.6704,0.7416,0.095,"Hacked Accounts,",true,Register_Window) guiLabelSetColor(S3_Label,255,255,255) guiLabelSetVerticalAlign(S3_Label,"top") guiLabelSetHorizontalAlign(S3_Label,"left",false) S4_label = guiCreateLabel(0.0506,0.7374,0.9101,0.0419,"We suggest to prevent this",true,Register_Window) guiLabelSetColor(S4_label,255,255,255) guiLabelSetVerticalAlign(S4_label,"top") guiLabelSetHorizontalAlign(S4_label,"left",false) S5_Label = guiCreateLabel(0.0506,0.7793,0.8708,0.067,"by signing up to the forums",true,Register_Window) guiLabelSetColor(S5_Label,255,255,255) guiLabelSetVerticalAlign(S5_Label,"top") guiLabelSetHorizontalAlign(S5_Label,"left",false) S6_Label = guiCreateLabel(0.0506,0.8212,0.9438,0.0391,"with the same username and",true,Register_Window) guiLabelSetColor(S6_Label,255,255,255) guiLabelSetVerticalAlign(S6_Label,"top") guiLabelSetHorizontalAlign(S6_Label,"left",false) S7_Label = guiCreateLabel(0.0506,0.8687,0.8989,0.0475,"If you forget your password",true,Register_Window) guiLabelSetColor(S7_Label,255,255,255) guiLabelSetVerticalAlign(S7_Label,"top") guiLabelSetHorizontalAlign(S7_Label,"left",false) S8_Label = guiCreateLabel(0.0393,0.9162,0.882,0.0559,"You will be able to retrive it",true,Register_Window) guiLabelSetColor(S8_Label,255,255,255) guiLabelSetVerticalAlign(S8_Label,"top") guiLabelSetHorizontalAlign(S8_Label,"left",false) end ) addEventHandler("onClientGUIClick",getRootElement(), function() if source == Login_button then -- Checks if the login button was clicked! local getUsernameField = guiGetText(Username_edit) -- Gets the username box data when clicking login! local getPasswordField = guiGetText(Password_edit) -- Gets the password box data when clicking login! if getUsernameField and getPasswordField then -- Checks if data was successfully recieved from the fields! triggerServerEvent("loginFromClient", getLocalPlayer(), getUsernameField, getPasswordField) -- Sent username and password data to serverside! end end if source == RegisterRegister_Button then -- Checks if the register button was clicked! local getUsernameField1 = guiGetText(RegisterUsername_edit) -- Gets the username box data when clicking register! local getPasswordField1 = guiGetText(RegisterPassword_edit) -- Gets the password box data when clicking register! if getUsernameField1 and getPasswordField1 then -- Checks if data was successfully recieved from the fields! triggerServerEvent("registerFromClient", getLocalPlayer(), getUsernameField1, getPasswordField1) -- Sent username and password data to serverside! end end if source == Register_button then -- If the register button to show the window to register was clicked if guiGetVisible(Register_Window) == true then guiSetVisible(Register_Window, false) showCursor(true) elseif guiGetVisible(Register_Window) == false then guiSetVisible(Register_Window, true) showCursor(true) end end end ) addEvent("onClientLoginHide",true) addEventHandler("onClientLoginHide",getRootElement(), function() showCursor(false) guiSetVisible(Register_Window, false) guiSetVisible(Login_window, false) guiSetInputEnabled(false) end ) Server: addEvent("loginFromClient",true) -- Adds the event to be triggered! addEventHandler("loginFromClient",getRootElement(), -- When the event is triggered, this function will also be triggered! function(user,pass) -- Received user and pass data! local account = getAccount ( user, pass ) if account then -- Checks if login returned true, or is accepted! local isLoginAccepted = logIn(source, account, pass) -- Adds a variable to login! if isLoginAccepted then outputChatBox("You have successfully logged into "..user.."'s account!",source, 0,255,0,true) -- Outputs a success message if the player logged in! triggerClientEvent ("onClientLoginHide", getRootElement()) end else outputChatBox(user.."'s account does not exist! Please register!",source, 200,20,0,true) -- Outputs a fail message! end end ) addEvent("registerFromClient",true) -- Adds the event to be triggered! addEventHandler("registerFromClient",getRootElement(), -- When the event is triggered, this function will also be triggered! function(user1,pass1) -- Received user and pass data from the register GUI! local account1 = getAccount ( user1, pass1 ) local isRegisterAccepted = addAccount(user1,pass1) -- Adds a variable to addAccount! if isRegisterAccepted then -- Checks if addAccount returned true, or is accepted! outputChatBox("You have successfully registered "..user1.."'s account!",source, 0,255,0,true) -- Outputs a success message if the player registered! else -- If it failed, the account is already registered! outputChatBox(user1.."'s account already exists!",source, 200,20,0,true) -- Outputs a fail message! end end )
-
Np, your still the better scripter though. This is just something which someone told me. Same method as centering text
-
Ok good point... Ill have to force that as a habit. thanks for the idea. And your first code was bugged, now u fixed it.
-
There you go my best friend: function dx() sx, sy = guiGetScreenSize() dxDrawText("dx 24/7 text DD/DM",0,0,sx,sy,tocolor(255,255,255,255), (sx/1024)*0.8, "bankgothic", "right","top") end addEventHandler("onClientRender", getRootElement(), dx) A little idea Venom taught me. I hope all is well with xG, i do miss you. This code will work on all res's MWAHHAAHAHAHHAHAHA
-
I beat kenix to a working script lol... Also kenix's script he replied with doesnt set a cursor. Just use mine lol. His time: My time:
-
Working: GUIEditor_Window = {} GUIEditor_TabPanel = {} GUIEditor_Tab = {} GUIEditor_Memo = {} GUIEditor_Image = {} GUIEditor_Window[1] = guiCreateWindow(78,70,642,498,"",false) guiSetVisible( GUIEditor_Window[1],false ) showCursor(false) GUIEditor_Image[1] = guiCreateStaticImage(0.2555,0.0462,0.4782,0.2369,"images/KraZWorld.png",true,GUIEditor_Window[1]) GUIEditor_Memo[1] = guiCreateMemo(0.0187,0.2671,0.9626,0.253,"KraZ'World is a MTA:SA Roleplay server based on the real world. We aim to create a laidback server fun for everyone with tons of jobs and activites throughout. We noticed that most RPG server admins were being a bit rough on their players and not playing their role as admin. When we choose staff we only pick the people who are serious but also give chance. This roleplay server is owned by [staff]KraZ and no one else you can find the staff members and other information below.\n\nWebsite & Forums:: [url=http://www.KraZKraft.co.uk]http://www.KraZKraft.co.uk[/url]",true,GUIEditor_Window[1]) GUIEditor_TabPanel[1] = guiCreateTabPanel(0.0187,0.5422,0.9626,0.4257,true,GUIEditor_Window[1]) GUIEditor_Tab[1] = guiCreateTab("Commands:",GUIEditor_TabPanel[1]) GUIEditor_Memo[2] = guiCreateMemo(0.0065,0.0372,0.9871,0.9415,"Commands are features you can access in-game to give to easier access to items/cars/objects.\nYou can also use commands for fun features which will be listed below. Commands can be used by going to your chatbox (T - Deafult) and typing the commands like so: (Say:/Commandname) then by pressing enter.\nCommands availible:\n/reconnect\n\n[More commands will be added soon]",true,GUIEditor_Tab[1]) GUIEditor_Tab[2] = guiCreateTab("Rules:",GUIEditor_TabPanel[1]) GUIEditor_Memo[3] = guiCreateMemo(0.0065,0.0319,0.9871,0.9468,"Rules are Rules, All rules must be followed or you can face up to a month in ban or jail time. You can appeal permanent bans on the forums.\n\n1. - No Deathmatching (Deathmatching is allowed to a certain extent for example if you are a police officer going for somone wanted or if you'r a criminal and you want to go turf wars, We do allow some deathmatching but not always depends which staff member you get when the report is filed\nJail time for this offence: 800 minutes)\n\n2. - No Bug Abuse/Mods/Cheats (Using cheats or mods or abusing a bug are a serious offence on KraZ'World and you can get up to a month ban for using them, We do allow some mods like: e.g car mods, Skin mods, Jail time for this offence: MONTH BAN)\n\n3. - Listen To Staff Members (Staff members are located with the [staff] Tag, Listen to these people and do not ignore them, Jail time for this offence: 500 minutes)\n\n4. - Use /local chat before using Global, (Don't go abusing globalchat, use /local chat first\nJail time for this offence: 100 minutes)\n\n5. - Do not abuse the /support chat (/Support chat is only if you need support please no advertising or general conversation. Jail time for this offence: 200 minutes)\n\n6. - No Spamming Chat (Do not spam chat with the same sentance or advertising of anykind,\n Jail time for this offence: 300 minutes\n",true,GUIEditor_Tab[2]) GUIEditor_Tab[3] = guiCreateTab("Getting Started:",GUIEditor_TabPanel[1]) GUIEditor_Memo[4] = guiCreateMemo(0.0049,0.0213,0.9887,0.9574,"Okay, This tab is like a tutorial for new beginners, First off you'r going to want to get a job to earn some money, Do this by walking into a red marker, Pick a skin and accept the job, For this example i will post some jobs below,\n\nBus Driving - \nYou can get this job by going to unity station in Los Santos and picking the skin required for that job, Then you will need to get in a bus by entering a yellow marker and then drive to the bus stops, Simple.\n\nPolice/Medic - \nYou can get this job by going into the Red marker at a police station or hospital, pick the skin required get a car/ambulance then drive off and look for wanted players/low health players.\n\nPilot - \nGo to any airport except for the Abandoned one in Las Venturas, Go into the Red Marker and pick the skin required for the job, get in a plane by entering a yellow marker, and do your job as a pilot.\n\nJobs can be located by pressing F11 and looking for the job marker on the minimap (Jobs are Yellow blips on the minimap and the Large map)\n\n",true,GUIEditor_Tab[3]) GUIEditor_Tab[4] = guiCreateTab("Support:",GUIEditor_TabPanel[1]) GUIEditor_Memo[5] = guiCreateMemo(0.0049,0.0213,0.9903,0.9574,"If you need support its fairly simple just follow the instructions below:\n\nIf you need support fast, type this command into the chatbox - /Support yourmessagehere\n\nIf you need support but on something a staff member can help on go to the website and forums and post in the Support category of the forum.\n\nIf you need help on any other category ask some players of KraZ'World,",true,GUIEditor_Tab[4]) GUIEditor_Tab[5] = guiCreateTab("Staff Members:",GUIEditor_TabPanel[1]) GUIEditor_Memo[6] = guiCreateMemo(0.0049,0.016,0.9903,0.266,"There are 3 types of staff members: The following ranks and staff members are \nModerators, SuperModerators, Admins Below in the next box:",true,GUIEditor_Tab[5]) GUIEditor_Memo[7] = guiCreateMemo(0.0049,0.2819,0.9903,0.6755,"KraZ - [Admin] Dylan - [Admin] Taran - [Admin]\n\n\n",true,GUIEditor_Tab[5]) GUIEditor_Tab[6] = guiCreateTab("Donation Information:",GUIEditor_TabPanel[1]) GUIEditor_Memo[8] = guiCreateMemo(0.0049,0.0266,0.9903,0.9521,"Donating helps the server pay for fees and more, therfore you will recive more privlages than most players, you can donate by visiting the website and forums and clicking the donate button there.\n\n[NOTE]: To get the privlages you want you must donate over 7.50 British Pounds Sterlin.\n\nDonating helps us alot, feel free to help us out by donating after you have donating 7.50, If you donate over a certain ammount we will decide if you should be ranked as [staff]\n\n",true,GUIEditor_Tab[6]) bindKey("F9","down", function() if guiGetVisible(GUIEditor_Window[1]) == true then guiSetVisible(GUIEditor_Window[1], false) showCursor(false) elseif guiGetVisible(GUIEditor_Window[1]) == false then guiSetVisible(GUIEditor_Window[1], true) showCursor(true) end end ) Also make sure you stop helpmanager from getting in the way
-
Mine works, and its /homeland to open and /homeland to close
-
Use myonlake script plus use this: addEventHandler("onPlayerLogin",root, function () local account = getPlayerAccount(source) if isGuestAccount(account) then return end local raceWins = getAccountData(account,"Race Wins") local raceLoses = getAccountData(account,"Race Loses") local timePlayed = getAccountData(account, "Time played") local ratio = getAccountData(account, "Ratio") if raceWins then setAccountData(account,"Race Wins",tostring(raceWins)) else setAccountData(account,"Race Wins",0) end if raceLoses then setAccountData(account,"Race Loses",tostring(raceLoses)) else setAccountData(account,"Race Loses",0) end if timePlayed then setAccountData ( account, "Time played", tostring(hours) ..":".. tostring(mins) ..":".. tostring(newsec)) else setAccountData(account, "Time played","0:0:0") end if ratio then setAccountData(account,"Ratio",tostring(ratio)) else setAccountData(account,"Ratio",0) end end) You forgot to close of the if's!
-
Working local gui = {} gui._placeHolders = {} local screenWidth, screenHeight = guiGetScreenSize() local windowWidth, windowHeight = 842, 498 local left = screenWidth/2 - windowWidth/2 local top = screenHeight/2 - windowHeight/2 gui["_root"] = guiCreateWindow(left, top, windowWidth, windowHeight, "Form", false) guiWindowSetSizable(gui["_root"], false) guiSetVisible(gui["_root"], false) gui["tabWidget"] = guiCreateTabPanel(0, 75, 821, 431, false, gui["_root"]) gui["tab"] = guiCreateTab("United States Department of Homeland Security ", gui["tabWidget"]) gui["plainTextEdit"] = guiCreateMemo(10, 10, 401, 361, "The Department of homeland security was founded in this server by tim260.\n\nIts now lead by tim260 and is not yet active, as we are developing it.", false, gui["tab"]) guiMemoSetReadOnly(gui["plainTextEdit"], true) gui["label_2"] = guiCreateLabel(460, 90, 271, 221, "", false, gui["tab"]) guiLabelSetHorizontalAlign(gui["label_2"], "left", false) guiLabelSetVerticalAlign(gui["label_2"], "center") gui["tab_3"] = guiCreateTab("Joining", gui["tabWidget"]) gui._placeHolders["line"] = {left = 27, top = 180, width = 751, height = 20, parent = gui["tab_3"]} gui["tab_2"] = guiCreateTab("Members", gui["tabWidget"]) gui["label"] = guiCreateLabel(290, 25, 411, 31, "Homeland security info panel", false, gui["_root"]) guiLabelSetHorizontalAlign(gui["label"], "left", false) guiLabelSetVerticalAlign(gui["label"], "center") function OpenClose() if guiGetVisible(gui["_root"]) == true then guiSetVisible(gui["_root"], false) showCursor(false) elseif guiGetVisible(gui["_root"]) == false then guiSetVisible(gui["_root"], true) showCursor(true) end end addCommandHandler ( "homeland", OpenClose )
-
Solidsnake just created the onMoneyChange event handler Great job, is it ok if I implement this in one of my scripts?
-
I believe addPedClothes could never be possible on anything other than CJ, unless someone is willing to make all peds naked... Then we leave the rest to MTA.
-
I think it would be better rated by amount of joins. Like gametracker, they have server ranks, aka, a server always has the most players, and have received the most activity, they are ranked one. Base it on amount of connects which the server have received.
-
Removed by Chris*
-
Thanks, i made it all client, thanks for your help. Its highly appreciated.
-
Omg man your an idiot, im saying i'd prefer it without a GUI, cause the mouse needs to be shown... Could we please get someone who actually knows what he is doing. Im not a noob...
-
Hey all, i'm having a small issue with my script... I wish to create a speed boost script which pushes the player's speed with scroll. My problem is though it needs a GUI element, and the cursor needs to be shown... This is the problem, the player cant drive with a cursor on the screen... I tested it with other active GUI's and it was slightly not working just a bad argument in the server script... So all i need you focusing on is the client... I can do the rest. I just need the client's gui to be hidden, aka GUISetAlpha, and somehow make it always active... I dont think this is possible No cursor is good... Meta.xml: "Chris" version="1.0" type="script" name="Speed Boost" description="Move your scroll wheel up and down to increase speed!" /> booster-c.lua: window = {} window[1] = guiCreateWindow(0,0,1,1,"",true) addEventHandler( "onClientMouseWheel", getRootElement(), function(up_down) if (up_down == 1) then triggerServerEvent ( "pushSpeed", getLocalPlayer()) elseif (up_down == -1) then triggerServerEvent ( "pullSpeed", getLocalPlayer()) end end ) booster-s.lua: function getElementSpeed(element,unit) if (unit == nil) then unit = 0 end if (isElement(element)) then local x,y,z = getElementVelocity(element) if (unit=="mph" or unit==1 or unit =='1') then return (x^2 + y^2 + z^2) ^ 0.5 * 100 else return (x^2 + y^2 + z^2) ^ 0.5 * 1.61 * 100 end else outputDebugString("Not an element. Can't get speed") return false end end function setElementSpeed(element, unit, speed) if (unit == nil) then unit = 0 end if (speed == nil) then speed = 0 end speed = tonumber(speed) local acSpeed = getElementSpeed(element, unit) if (acSpeed~=false) then local diff = speed/acSpeed local x,y,z = getElementVelocity(element) setElementVelocity(element,x*diff,y*diff,z*diff) return true end return false end addEvent("pushSpeed",true) addEventHandler( "pushSpeed", getRootElement(), function() theVehicle = getPedOccupiedVehicle(source) if (theVehicle) then setElementSpeed(theVehicle, 2, getElementSpeed(theVehicle,2)+55) end end ) addEvent("pullSpeed",true) addEventHandler( "pullSpeed", getRootElement(), function() theVehicle = getPedOccupiedVehicle(source) if (theVehicle) then setElementSpeed(theVehicle, 2, getElementSpeed(theVehicle,2)-55) end end ) After failing i tried this: addEventHandler( "onClientKey", getRootElement(), function(button, press) if (button == mouse_wheel_up) then triggerServerEvent ( "pushSpeed", getRootElement()) elseif (button == mouse_wheel_down) then triggerServerEvent ( "pullSpeed", getRootElement()) end end ) and i tried this: function key(key, keyState) if (key == mouse_wheel_up) then triggerServerEvent ( "pushSpeed", getRootElement()) elseif (key == mouse_wheel_down) then triggerServerEvent ( "pullSpeed", getRootElement()) end end bindKey ("mouse_wheel_up", "both", key) bindKey ("mouse_wheel_down", "both", key) edit: Updated some of the code
-
Wow gamelaster, you should have told us your script was clientsided... We couldnt help you then! Plus, your script is the really basic...
-
Ohk, how long do you want it running for?
-
Solution... Set these settings in the map meta if its race! "#respawntime" value="[ 5 ]"> "#respawn" value='[ "timelimit" ]'> Then if your not a beginner! setTimer ( setElementAlpha, 5500, 1, getPedOccupiedVehicle (thePlayer) , 120 ) Ex... function wasted() setTimer ( setElementAlpha, 5500, 1, getPedOccupiedVehicle (source) , 120 ) end addEventHandler("onPlayerWasted",getRootElement(),wasted)
-
RespawnVehicle never worked for me like this. So. This is an idea i thought of, never tested it... [url=https://wiki.multitheftauto.com/wiki/SetElementSpeed]https://wiki.multitheftauto.com/wiki/SetElementSpeed[/url] (Source Code) [url=https://wiki.multitheftauto.com/wiki/GetElementSpeed]https://wiki.multitheftauto.com/wiki/GetElementSpeed[/url] (Source Code) setElementData getElementData setTimer setElementAlpha onPlayerWasted
-
THANK YOU KENIX, Thanks alot. Your name will be in Credits, like: Credits: Kenix - For fixing my SUPER buggy script, it meant alot to me.
-
Almost kenix I keep relogging to get my total kills to 0... But Its not, so i think addEventHandler( "onPlayerLogin",root, function( thePreviousAccount, theCurrentAccount, autoLogin ) if not getAccountData( theCurrentAccount,"totalkillsdeaths.kills" ) and not getAccountData( theCurrentAccount,"totalkillsdeaths.deaths" ) then setAccountData( theCurrentAccount,"totalkillsdeaths.kills",0) setAccountData( theCurrentAccount,"totalkillsdeaths.deaths",0) end end ) function is preventing everything else... Its a theory. Cause nothing is appearing in scoreboard in those columns.
-
No ones is working and kenix I think u miss understand...! addEventHandler ( "onPlayerWasted", root, function( totalAmmo, killer, killerWeapon, bodypart, stealth ) local account = getPlayerAccount ( killer ) if account and isElement( killer ) then setAccountData( account,"totalkillsdeaths.kills",getAccountData( account,"totalkillsdeaths.kills" )+1 ) setAccountData( account,"totalkillsdeaths.Deaths",getAccountData(account,"totalkillsdeaths.Deaths")+1) setElementData( killer, "T/K", tonumber( getAccountData( account,"totalkillsdeaths.kills" ) or 0 ) ) setElementData( killer, "T/D", tonumber( getAccountData( account,"totalkillsdeaths.Deaths" ) or 0 ) ) end end ) Its meant to log kills and deaths separately, This adds 1 death and 1 kill. and it doesnt work
-
omg, im the biggest retard! I just checked the meta Well now i know it creates the columns. The only thing not working is the kill data. Do you see any issues with it? Ive changed it a bit more: function addTotalKill(totalAmmo, killer, killerWeapon, bodypart, stealth) local account = getPlayerAccount (killer) if (account) and (killer) then setAccountData(account,"totalkillsdeaths.kills",getAccountData(account,"totalkillsdeaths.kills")+1) setElementData(killer, "T/K", getAccountData(account,"totalkillsdeaths.kills")) end end addEventHandler ("onPlayerWasted", getRootElement(), addTotalKill) function addTotalDeath(totalAmmo, killer, killerWeapon, bodypart, stealth) local account = getPlayerAccount (source) if (account) then setAccountData(account,"totalkillsdeaths.Deaths",getAccountData(account,"totalkillsdeaths.deaths")+1) setElementData(source, "T/K", getAccountData(account,"totalkillsdeaths.deaths")+1) end end addEventHandler ("onPlayerWasted", getRootElement(), addTotalDeath) function checkAccountKillsDeaths(thePreviousAccount, theCurrentAccount, autoLogin) if (getAccountData(theCurrentAccount,"totalkillsdeaths.kills") == nil) and (getAccountData(theCurrentAccount,"totalkillsdeaths.deaths") == nil) then setAccountData(theCurrentAccount,"totalkillsdeaths.kills",0) setAccountData(theCurrentAccount,"totalkillsdeaths.deaths",0) end end addEventHandler("onPlayerLogin",getRootElement(),checkAccountKillsDeaths) function addScoreboardItems( ) outputDebugString( "add Total Kills to scoreboard Return: "..tostring( call( getResourceFromName("Scoreboard"), "addScoreboardColumn", "T/K",root,2, 0.035 ) ) ) outputDebugString( "add Total Deaths to scoreboard Return: "..tostring( call( getResourceFromName("Scoreboard"), "addScoreboardColumn", "T/D",root,3, 0.035 ) ) ) end addEventHandler( "onResourceStart",resourceRoot,addScoreboardItems ) this doesnt work function checkAccountKillsDeaths(thePreviousAccount, theCurrentAccount, autoLogin) if (getAccountData(theCurrentAccount,"totalkillsdeaths.kills") == nil) and (getAccountData(theCurrentAccount,"totalkillsdeaths.deaths") == nil) then setAccountData(theCurrentAccount,"totalkillsdeaths.kills",0) setAccountData(theCurrentAccount,"totalkillsdeaths.deaths",0) end end addEventHandler("onPlayerLogin",getRootElement(),checkAccountKillsDeaths) Ok AFK...
-
, Kenix, still nothing idk, and fatals doesnt work... omgz Whats up with it lol, mta bug? is this the same as deleteResource() bug (i should report that LOL!) So idk...
