-
Posts
138 -
Joined
-
Last visited
Everything posted by Army@1
-
I heard, the limit for local variables is about 200. You can use the following approach to use even more local variables, if I am right. local localv = {} localv.myVariable = 1 localv.anotherVar = 123 localy.thirdVariable = "Hello MTA!" --and so on...
-
Note from createColRectangle: Attaching a rectangle colshape to another element may give unexpected results as the origin is not at the rectangle centre. Try using a collision circle for attaching instead. Anyway, also try the following code: vehicles = getElementsByType ("vehicle") for key,vehicle in ipairs(vehicles) do local x, y, z = getElementPosition(vehicle) w,h = 5,5 x,y = x+w/2,y+h/2 vehCol = createColRectangle(x, y, w, h) attachElements(vehCol, vehicle) end
-
@knightscript, anytime. You are cent percent right in saying lua is the easier language compare to others, if not easiest. Keep learning! @Tekken I did a simple test and got the below,somewhat strange, results. setTimer(outputChatBox, 6000, 0, tostring(unpack(mensajes[math.random(1, #mensajes)])), getRootElement(), 0, 0, 255, true); -- This [b]doesn't[/b] generate random numbers/messages Where as setTimer(function() outputChatBox(tostring(unpack(mensajes[math.random(1, #mensajes)])), getRootElement(), 0, 0, 255, true) end, 6000, 0); -- This [b]do[/b] generate random numbers/messages Looks like math.random() doesn't generate any new random when directly brought to setTimer. For example, as per the theory. setTimer(math.random, 1000, 0, 1, 100) -- will [b]not[/b] generate random numbers and setTimer(function() math.random(1,100) end, 1000, 0) -- [b]will[/b] generate random numbers strange...
-
Are you talking about createTheVehicle function arguments?
-
@1LoL1 That will indeed work. @ knightscript The reason why your code didn't work is simple, you are actually never overwrighting the first generated random number. local mensajes = { {"test"}, {"test2"} } local mensajes = mensajes[math.random( #mensajes)] -- lets say the random is 1 local elmensaje = unpack(mensajes) function map () outputChatBox(elmensaje,getRootElement(), 0, 0, 255, true) -- here you will get message number 1 end setTimer ( map, 6000, 0 ) -- Here you are repeating the function but not the random number as it is outside the function. So our random number will forever be equal to 1 and with it, our message will always be the same. By putting the math.random() function inside the function 'map', you will generate a new random number each time the function execute/run. local mensajes = { {"test"}, {"test2"} } function map () local mensajes = mensajes[math.random( #mensajes)] local elmensaje = unpack(mensajes) outputChatBox(elmensaje,getRootElement(), 0, 0, 255, true) end setTimer ( map, 6000, 0 ) Why I didn't notice it before....
-
Silly mistake... Alternatively, you can put resourceRoot. local rulesToFile = { ["English"] = "Rules/EN.xml", ["German"] = "Rules/GM.xml", ["Greece"] = "Rules/GR.xml", ["Hungarian"] = "Rules/HR.xml", ["Indonisian"] = "Rules/ID.xml", ["Dutch"] = "Rules/NL.xml", ["Portugese"] = "Rules/PT.xml", ["Russian"] = "Rules/RU.xml", ["Spanish"] = "Rules/SP.xml", ["Thai"] = "Rules/TI.xml", ["Tunisian"] = "Rules/TN.xml", ["Turkish"] = "Rules/TR.xml" } infotable = nil griditem = { {"Rules", "Rules/EN.xml"}, {"VIP", "Others/vip.xml"}, {"CnR", "Others/CnR.xml"}, {"PnR", "Others/PnR.xml"}, {"MW", "Others/MW.xml"}, {"Jobs n Ranks", "Others/jobs.xml"}, {"Commands", "Others/commands.xml"}, {"Donators", "Others/donate.xml"}, {"House System", "Others/house.xml"}, {"Groups", "Others/groups.xml"}, {"Companys", "Others/companys.xml"}, } local windowTitle = "CST Rules, Documentation and Answers" addEventHandler("onClientResourceStart", resourceRoot, function () local sx, sy = guiGetScreenSize() rule = guiCreateWindow((sx/2)-400, (sy/2)-300, 800, 600, tostring(windowTitle), false) guiWindowSetSizable(rule, false) guiSetAlpha (rule, 1) grid = guiCreateGridList(9, 64, 781, 164, false, rule) guiGridListSetSelectionMode(grid, 1) guiGridListSetSortingEnabled(grid, false) guiGridListAddColumn(grid, "Question", 0.9) for index, val in pairs(griditem) do local row = guiGridListAddRow(grid) guiGridListSetItemText(grid, row,1, val[1], false, false) end guiSetVisible( rule, false ) memo = guiCreateMemo(3, 238, 700, 350, "Select a Question above to learn about the game.", false, rule) guiMemoSetReadOnly(memo, true) ask = guiCreateButton(713, 238, 78, 89, "Ask a question that isn't answered here", false, rule) closebtn = guiCreateButton(713, 532, 78, 55, "Close", false, rule) search = guiCreateEdit(10, 24, 780, 35, "", false, rule) --combo = guiCreateComboBox(597, 100, 171, 29, "", false, rule) --for i, k in pairs ( rulesToFile ) do --guiComboBoxAddItem ( combo, i ) --end guiMemoSetReadOnly (memo, true) addEventHandler("onClientGUIClick", grid, clickedGridlist, false) addEventHandler("onClientGUIClick", closebtn, function () guiSetVisible(rule, false) showCursor(false) end, false) addEventHandler("onClientGUIClick", ask, showSupports, false) end) function clickedGridlist() if (guiGridListGetSelectedItem(grid) == -1) then return end local row = guiGridListGetSelectedItem(source) local info = guiGridListGetItemText(grid, row, 1) for index, val in pairs(griditem) do if (info == val[1]) then guiSetText(memo, xmlNodeGetValue( xmlLoadFile( val[2] ) ) or "Error while loading file" ) end end end -- F1 key bind to open the window bindKey( "F4", "down", function () if ( guiGetVisible( rule ) ) then guiSetVisible( rule, false ) showCursor( false ) else guiSetVisible( rule, true ) showCursor( true ) end end ) -- When a combo is selected addEventHandler ( "onClientGUIComboBoxAccepted", root, function ( theCombo ) if ( theCombo == combo ) then local theItem = guiComboBoxGetSelected ( theCombo ) local theLang = tostring ( guiComboBoxGetItemText ( theCombo , theItem ) ) if ( rulesToFile[theLang] ) then guiSetText( memo, xmlNodeGetValue( xmlLoadFile( rulesToFile[theLang] ) ) or "Error while loading file" ) end end end ) function showSupports() guiSetVisible(rule, false) showCursor(false) triggerEvent("showSupportChat", root) end addEventHandler("onClientGUIChanged", resourceRoot, function() local text = guiGetText(search) local sItems = { } for i, v in pairs(griditem) do if not (text == "" ) then if (string.find(string.upper(v[1]), string.upper(text), 1, true)) then table.insert(sItems, v[1]) end else table.insert(sItems, v[1]) end end guiGridListClear(grid) for i, v in pairs(sItems) do local row = guiGridListAddRow(grid) guiGridListSetItemText(grid, row, 1, v, false, false) end end
-
local rulesToFile = { ["English"] = "Rules/EN.xml", ["German"] = "Rules/GM.xml", ["Greece"] = "Rules/GR.xml", ["Hungarian"] = "Rules/HR.xml", ["Indonisian"] = "Rules/ID.xml", ["Dutch"] = "Rules/NL.xml", ["Portugese"] = "Rules/PT.xml", ["Russian"] = "Rules/RU.xml", ["Spanish"] = "Rules/SP.xml", ["Thai"] = "Rules/TI.xml", ["Tunisian"] = "Rules/TN.xml", ["Turkish"] = "Rules/TR.xml" } infotable = nil griditem = { {"Rules", "Rules/EN.xml"}, {"VIP", "Others/vip.xml"}, {"CnR", "Others/CnR.xml"}, {"PnR", "Others/PnR.xml"}, {"MW", "Others/MW.xml"}, {"Jobs n Ranks", "Others/jobs.xml"}, {"Commands", "Others/commands.xml"}, {"Donators", "Others/donate.xml"}, {"House System", "Others/house.xml"}, {"Groups", "Others/groups.xml"}, {"Companys", "Others/companys.xml"}, } colum local windowTitle = "CST Rules, Documentation and Answers" addEventHandler("onClientResourceStart", resourceRoot, function() local sx, sy = guiGetScreenSize() rule = guiCreateWindow((sx/2)-400, (sy/2)-300, 800, 600, tostring(windowTitle), false) guiWindowSetSizable(rule, false) guiSetAlpha (rule, 1) grid = guiCreateGridList(9, 64, 781, 164, false, rule) guiGridListSetSelectionMode(grid, 1) guiGridListSetSortingEnabled(grid, false) guiGridListAddColumn(grid, "Question", 0.9) for index, val in pairs(griditem) do local row = guiGridListAddRow(grid) guiGridListSetItemText(grid, row,1, val[1], false, false) end guiSetVisible( rule, false ) memo = guiCreateMemo(3, 238, 700, 350, "Select a Question above to learn about the game.", false, rule) guiMemoSetReadOnly(memo, true) ask = guiCreateButton(713, 238, 78, 89, "Ask a question that isn't answered here", false, rule) closebtn = guiCreateButton(713, 532, 78, 55, "Close", false, rule) search = guiCreateEdit(10, 24, 780, 35, "", false, rule) --combo = guiCreateComboBox(597, 100, 171, 29, "", false, rule) --for i, k in pairs ( rulesToFile ) do --guiComboBoxAddItem ( combo, i ) --end guiMemoSetReadOnly (memo, true) addEventHandler("onClientGUIClick", grid, clickedGridlist, false) addEventHandler("onClientGUIClick", closebtn, function () guiSetVisible(rule, false) showCursor(false) end, false) addEventHandler("onClientGUIClick", ask, showSupports, false) end) function searchFor() guiGridListClear(grid) local text = guiGetText(search) if (text ~= "" ) then for i, v in pairs(griditem) do local row = guiGridListAddRow(grid) if (string.find(string.upper(v), string.upper(text), 1, true)) then guiGridListSetItemText(grid, row, 1, tostring(v), false, false) end end end end addEventHandler("onClientGUIChanged", search,searchFor,false) function clickedGridlist() if (guiGridListGetSelectedItem(grid) == -1) then return end local row = guiGridListGetSelectedItem(source) local info = guiGridListGetItemText(grid, row, 1) for index, val in pairs(griditem) do if (info == val[1]) then guiSetText(memo, xmlNodeGetValue( xmlLoadFile( val[2] ) ) or "Error while loading file" ) end end end -- F1 key bind to open the window bindKey( "F1", "down", function () if ( guiGetVisible( rule ) ) then guiSetVisible( rule, false ) showCursor( false ) else guiSetVisible( rule, true ) showCursor( true ) end end ) -- When a combo is selected addEventHandler ( "onClientGUIComboBoxAccepted", root, function ( theCombo ) if ( theCombo == combo ) then local theItem = guiComboBoxGetSelected ( theCombo ) local theLang = tostring ( guiComboBoxGetItemText ( theCombo , theItem ) ) if ( rulesToFile[theLang] ) then guiSetText( memo, xmlNodeGetValue( xmlLoadFile( rulesToFile[theLang] ) ) or "Error while loading file" ) end end end ) function showSupports() guiSetVisible(rule, false) showCursor(false) triggerEvent("showSupportChat", root) end addEventHandler("onClientGUIChanged", search, function() local text = guiGetText(search) local sItems = { } for i, v in pairs(griditem) do if not (text == "" ) then if (string.find(string.upper(v[1]), string.upper(text), 1, true)) then table.insert(sItems, v[1]) end else table.insert(sItems, v[1]) end end guiGridListClear(grid) for i, v in pairs(sItems) do local row = guiGridListAddRow(grid) guiGridListSetItemText(grid, row, 1, v, false, false) end end If it didn't work, press f8 and type "debugscript 3". Either post what it says(at bottom of the screen) or take a screenshot.
-
Not working HELPP PLEASE Post WHOLE client side or at least the part where you store messages/strings.
-
Keep it up, MTA!! Thanks MTA Team and the community members who contribute. Good job!
-
local windowTitle = "CST Rules, Documentation and Answers" GUIEditor = { button = {} } addEventHandler("onClientResourceStart", resourceRoot, function() local sx, sy = guiGetScreenSize() rule = guiCreateWindow((sx/2)-400, (sy/2)-300, 800, 600, windowTitle, false) guiWindowSetSizable(rule, false) guiSetAlpha (rule, 1) grid = guiCreateGridList(9, 64, 781, 164, false, rule) guiGridListSetSelectionMode(grid, 1) guiGridListSetSortingEnabled(grid, false) colum = guiGridListAddColumn(grid, "Question", 0.9) for index, val in pairs(griditem) do local row = guiGridListAddRow(grid) guiGridListSetItemText(grid, row, colum, val[1], false, false) end guiSetVisible( rule, false ) memo = guiCreateMemo(3, 238, 700, 350, "Select a Question above to learn about the game.", false, rule) guiMemoSetReadOnly(memo, true) ask = guiCreateButton(713, 238, 78, 89, "Ask a question that isn't answered here", false, rule) close = guiCreateButton(713, 532, 78, 55, "Close", false, rule) search = guiCreateEdit(10, 24, 780, 35, "", false, rule) --combo = guiCreateComboBox(597, 100, 171, 29, "", false, rule) --for i, k in pairs ( rulesToFile ) do --guiComboBoxAddItem ( combo, i ) --end guiMemoSetReadOnly (memo, true) addEventHandler("onClientGUIClick", grid, clickedGridlist, false) addEventHandler("onClientGUIClick", close, function () guiSetVisible(rule, false) showCursor(false) end, false) addEventHandler("onClientGUIClick", ask, showSupports, false) end ) addEventHandler("onClientGUIChanged", search, function() local text = guiGetText(search) local sItems = { } for i, v in pairs(griditem) do if not (text == "" ) then if (string.find(string.upper(v[1]), string.upper(text), 1, true)) then table.insert(sItems, v[1]) end else table.insert(sItems, v[1]) end end guiGridListClear(grid) for i, v in pairs(sItems) do local row = guiGridListAddRow(grid) guiGridListSetItemText(grid, row, colum, tostring(v), false, false) end end
-
I just tested the code in lua IDE(ofcourse with math.randomseed()). And it seems math.random() indeed generate random number but sometimes, strangely, same message is outputted. However, the below code works fine(atleast in IDE). local mensajes = { {"test"}, {"test2"} } local mensajes = mensajes[math.random( #mensajes)][1] function map () outputChatBox(mensajes,getRootElement(), 0, 0, 255, true) end setTimer ( map, 6000, 0 ) And btw, there is no need to put messages in another table, it will work without it too. local mensajes = { "test", "test2" } local mensajes = mensajes[math.random( #mensajes)] function map () outputChatBox(mensajes,getRootElement(), 0, 0, 255, true) end setTimer ( map, 6000, 0 )
-
Who says recurrence of same number/message is not random?
-
Try this one: -- Remove all the below comments to add kills and deaths ratio. addEventHandler ( "onPlayerWasted", root, function ( totalAmmo, killer, killerWeapon, bodypart, stealth ) if ( killer ) then local accountKiller = getPlayerAccount ( killer ) if ( getElementType(killer) == "player" ) then setAccountData ( accountKiller,"kills",tonumber ( getAccountData ( accountKiller,"kills" ) or 0 ) + 1 ) setElementData ( killer, "kills", tonumber ( getAccountData ( accountKiller,"kills" ) ) ) end end local accountSource = getPlayerAccount ( source ) setAccountData ( accountSource, "Deaths",tonumber ( getAccountData ( accountSource, "Deaths" ) or 0 ) +1 ) setElementData ( source, "Deaths", tonumber ( getAccountData ( accountSource, "Deaths" ) ) ) end ) addEventHandler( "onPlayerLogin",root, function( thePreviousAccount, theCurrentAccount, autoLogin ) local account = getPlayerAccount ( source ) if not getAccountData( account,"Kills" ) and not getAccountData( account,"Deaths" ) then setAccountData( account,"Kills",0 ) setAccountData( account,"Deaths",0 ) end setElementData( source,"Deaths",tonumber( getAccountData( account,"Deaths" ) or 0 ) ) setElementData( source,"Kills",tonumber( getAccountData( account,"Kills" ) or 0 ) ) --setElementData( source, "Ratio", getElementData( source, "Kills" )/getElementData( source, "Deaths") ) end ) addEventHandler( "onResourceStart",resourceRoot, function( ) --outputDebugString( "add Total Kills to scoreboard Return: "..tostring( exports.scoreboard:addScoreboardColumn('Kills',getRootElement(),4,50) --) ) --outputDebugString( "add Total Deaths to scoreboard Return: "..tostring( exports.scoreboard:addScoreboardColumn('Deaths',getRootElement(),5,50) --) ) --outputDebugString( "add Kills Deaths Ratio to scoreboard Return: "..tostring( --exports.scoreboard:addScoreboardColumn('Ratio',getRootElement(),6,50) -- ) ) end )
-
Maybe something like this? addEventHandler( "onClientKey", root, function(button,press) if button == "F1" and getElementData ( thePlayer, "isJailed" ) then cancelEvent () outputChatBox("** You Can't Use The F1 ! ",root,255,0,0,true) end end )
-
Try this: local lottery = nil local winningNum = nil addEvent ( "SAEGLottery->onClientAttemptToBuyLotteryTicket", true ) addEventHandler ( "SAEGLottery->onClientAttemptToBuyLotteryTicket", root, function ( number ) local a = getPlayerAccount ( source ) if ( isGuestAccount ( a ) ) then return exports.SAEGMessages:sendClientMessage ( "Please login to use the lottery", source, 255, 0, 0 ) end if ( lottery [ getAccountName ( a ) ] ) then return exports.SAEGMessages:sendClientMessage ( "You already bought the lottery ticket \""..tostring(lottery[getAccountName(a)]).."\"", source, 255, 255, 0 ) end for i, v in pairs ( lottery ) do if ( v == number ) then return exports.SAEGMessages:sendClientMessage ( "This number has already been bought.", source, 255, 255, 0 ) end end if ( getPlayerMoney ( source ) < 100 ) then return exports.SAEGMessages:sendClientMessage ( "You don't have enough money to buy a lottery ticket", 255, 0, 0 ) end takePlayerMoney ( source, 100 ) exports.SAEGMessages:sendClientMessage ( "You have bought lottery ticket #"..tostring ( number ).."!", source, 0, 255, 0) lottery[getAccountName(a)] = number end ) function winLottery ( ) local winAccount = nil local winner = nil local num = getLotteryWinningNumber ( ) for i, v in pairs ( lottery ) do if ( v == num ) then winAccount = i end end if ( winAccount ) then for i, v in pairs ( getElementsByType ( "player" ) ) do local a = getPlayerAccount ( v ) if ( not isGuestAccount ( a ) and getAccountName ( a ) == winAccount ) then winner = v end end end if ( winAccount and not winner ) then winner = winaccount.." #ff0000(offline)" elseif ( not winAccount ) then winner = nil end exports.SAEGMessages:sendClientMessage("Lottery Winner is :"..tostring(winner or "Nobody")" Prize :"..tostring(prize), root, 0, 255, 0) if ( winner ~= nil and getElementType ( winner ) == "player" ) then exports.SAEGMessages:sendClientMessage("You won $"..tostring(prize).." from the lottery!", winner, 0, 255, 0) givePlayerMoney ( winner, prize ) end generateNextLottery ( ) getLastNumber () end function generateNextLottery ( ) lottery = { } winningNum = math.random ( 1, 30 ) prize = math.random ( 1, 2000000 ) if ( isTimer ( lotTImer ) ) then killTimer ( lotTImer ) lotTImer = nil end lotTImer = setTimer ( winLottery, 1800000, 1) end function getLotteryWinningNumber ( ) return winningNum end function getLotteryTimer ( ) return lotTImer end generateNextLottery ( ) function getLastNumber () triggerClientEvent ( source, "SAEGLottery->onClientRequestWinDetails", source, winningNum) end )
-
I don't know much about that stuff but the 'Timed out' message occur usually due to some network connection issue. Does it happens in all servers? What's the time difference between the message? Also, Windows XP is pretty much old but that doesn't mean it doesn't work with MTA. But I did recommended you to switch to some latest OS, anyway.
-
Try this. local lawTeam = {["Police"]=true, ["SWAT"]=true} ostimer = true function onShoot(target, posX, posY, posZ) if (getPlayerTeam(localPlayer) and lawTeam[getTeamName(getPlayerTeam(localPlayer))]) then local wanted = getPlayerWantedLevel() if (wanted > 0) then if (source == 23) and ostimer == true then -- your code.... ostimer = false setTimer(function() ostimer = true end,2000,1) end end end end addEventHandler("onClientWeaponFire", root, onShoot)
-
In above script, killing doesn't save when you kill your own self. Test this one. -- Remove all the below comments to add kills and deaths ratio. peds = getElementsByType("ped") players = getElementsByType("player") addEventHandler ( "onPlayerWasted", root, function( totalAmmo, killer, killerWeapon, bodypart, stealth ) if killer == players and killer ~= peds and source == players and source ~= peds then local account = getPlayerAccount ( killer ) setAccountData( account,"totalkillsdeaths.Kills",tonumber( getAccountData( account,"totalkillsdeaths.Kills" ) or 0 ) +1 ) setElementData( killer, "Kills", tonumber( getAccountData( account,"totalkillsdeaths.Kills" ) ) ) -- setElementData( killer, "Ratio", tonumber(getElementData( killer, "Kills" )/getElementData( source, "Deaths") ) ) else local accountSource = getPlayerAccount ( source ) setAccountData( accountSource,"totalkillsdeaths.Deaths",tonumber( getAccountData(accountSource,"totalkillsdeaths.Deaths") or 0 ) +1 ) setElementData( source, "Deaths", tonumber( getAccountData( accountSource,"totalkillsdeaths.Deaths" ) ) ) --setElementData( source, "Ratio", tonumber(getElementData( killer, "Kills" )/getElementData( source, "Deaths") ) ) end end ) addEventHandler( "onPlayerLogin",root, function( thePreviousAccount, theCurrentAccount, autoLogin ) local account = getPlayerAccount ( source ) if not getAccountData( account,"totalkillsdeaths.Kills" ) and not getAccountData( account,"totalkillsdeaths.Deaths" ) then setAccountData( account,"totalkillsdeaths.Kills",0 ) setAccountData( account,"totalkillsdeaths.Deaths",0 ) end setElementData( source,"Deaths",tonumber( getAccountData( account,"totalkillsdeaths.Deaths" ) or 0 ) ) setElementData( source,"Kills",tonumber( getAccountData( account,"totalkillsdeaths.Kills" ) or 0 ) ) --setElementData( source, "Ratio", getElementData( source, "Kills" )/getElementData( source, "Deaths") ) end ) addEventHandler( "onResourceStart",resourceRoot, function( ) --outputDebugString( "add Total Kills to scoreboard Return: "..tostring( exports.scoreboard:addScoreboardColumn('Kills',getRootElement(),4,50) --) ) --outputDebugString( "add Total Deaths to scoreboard Return: "..tostring( exports.scoreboard:addScoreboardColumn('Deaths',getRootElement(),5,50) --) ) --outputDebugString( "add Kills Deaths Ratio to scoreboard Return: "..tostring( --exports.scoreboard:addScoreboardColumn('Ratio',getRootElement(),6,50) -- ) ) end )
-
4. Make sure the name of the txd file is correct
-
I have modified the script a bit and it seems to work flawlessly. -- Remove all the below comments to add kills and deaths ratio. peds = getElementsByType("ped") players = getElementsByType("player") addEventHandler ( "onPlayerWasted", root, function( totalAmmo, killer, killerWeapon, bodypart, stealth ) if killer == players and killer ~= peds and source == players and source ~= peds then local account = getPlayerAccount ( killer ) if killer ~= source then setAccountData( account,"totalkillsdeaths.Kills",tonumber( getAccountData( account,"totalkillsdeaths.Kills" ) or 0 ) +1 ) setElementData( killer, "Kills", tonumber( getAccountData( account,"totalkillsdeaths.Kills" ) ) ) -- setElementData( killer, "Ratio", tonumber(getElementData( killer, "Kills" )/getElementData( source, "Deaths") ) ) end else local accountSource = getPlayerAccount ( source ) setAccountData( accountSource,"totalkillsdeaths.Deaths",tonumber( getAccountData(accountSource,"totalkillsdeaths.Deaths") or 0 ) +1 ) setElementData( source, "Deaths", tonumber( getAccountData( accountSource,"totalkillsdeaths.Deaths" ) ) ) --setElementData( source, "Ratio", tonumber(getElementData( killer, "Kills" )/getElementData( source, "Deaths") ) ) end end ) addEventHandler( "onPlayerLogin",root, function( thePreviousAccount, theCurrentAccount, autoLogin ) local account = getPlayerAccount ( source ) if not getAccountData( account,"totalkillsdeaths.Kills" ) and not getAccountData( account,"totalkillsdeaths.Deaths" ) then setAccountData( account,"totalkillsdeaths.Kills",0 ) setAccountData( account,"totalkillsdeaths.Deaths",0 ) end setElementData( source,"Deaths",tonumber( getAccountData( account,"totalkillsdeaths.Deaths" ) or 0 ) ) setElementData( source,"Kills",tonumber( getAccountData( account,"totalkillsdeaths.Kills" ) or 0 ) ) --setElementData( source, "Ratio", getElementData( source, "Kills" )/getElementData( source, "Deaths") ) end ) addEventHandler( "onResourceStart",resourceRoot, function( ) --outputDebugString( "add Total Kills to scoreboard Return: "..tostring( exports.scoreboard:addScoreboardColumn('Kills',getRootElement(),4,50) --) ) --outputDebugString( "add Total Deaths to scoreboard Return: "..tostring( exports.scoreboard:addScoreboardColumn('Deaths',getRootElement(),5,50) --) ) --outputDebugString( "add Kills Deaths Ratio to scoreboard Return: "..tostring( --exports.scoreboard:addScoreboardColumn('Ratio',getRootElement(),6,50) -- ) ) end )
-
What do you mean by table? scoreboard?
-
+ you will need to check if they shoot with silenced gun. Also it depends on how you're setting player's wanted levels. Functions: getPlayerTeam getTeamName getPlayerWantedLevel setPlayerWantedLevel getPedWeapon Events: onPlayerDamage
-
That's indeed a great Idea but simply rewriting the code may not help. Don't forgot gta sa is a single player game where as mta is a multiplayer. You have to check the code constantly and carefully trigger between client and server events. Good luck!
-
For anyone who is still looking for the answer. I talked with one of the moderators and it seems they do have some plans for the community page but lack time and manpower. And no, they don't accept any community member's help as far as I know but who knows, you could give a try, if you think you have the experience needed for it.