Jump to content

myonlake

Members
  • Posts

    2,312
  • Joined

  • Days Won

    41

Everything posted by myonlake

  1. myonlake

    mta-paradise

    Place the mta_mysql into the deathmatch folder and into the 'server' folder in the very first root folders.
  2. Hold on, it doesn't work I just tested it and it didn't work on others.
  3. Works just fine, thanks If someone is interested, feel free to use the following code. -- Miniatures local url = "http://electroradio.ch/stream.m3u" local px, py, pz = 1296, -1411, 14 local volume = 1.0 local distance = 70 local model = 495 addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function() -- Vehicle Configuration vehicle = createVehicle(tonumber(model), tonumber(px), tonumber(py), tonumber(pz)) setVehicleColor(vehicle, 126, 126, 0, 0) setVehicleLocked(vehicle, true) setVehicleDoorsUndamageable(vehicle, false) setVehicleDamageProof(vehicle, true) setElementRotation(vehicle, 0, 0, 90) setElementFrozen(vehicle, true) setElementAlpha(vehicle, 0) -- Stream Configuration sound = playSound3D(tostring(url), tonumber(px), tonumber(py), tonumber(pz), false) setSoundVolume(sound, tonumber(volume)) setSoundMaxDistance(sound, tonumber(distance)) attachElements(sound, vehicle, 0, 0, 5) end ) function updatePosition() local x, y, z = getElementPosition(vehicle) setElementPosition(sound, x, y, z) end setTimer(updatePosition, 100, 0) addCommandHandler("electro", function(cmd) local x, y, z = getElementPosition(localPlayer) setElementPosition(vehicle, x, y, z + 5) end ) addCommandHandler("attachelectro", function(cmd) attachElements(vehicle, localPlayer, 0, 0, 5) end ) addCommandHandler("detachelectro", function(cmd) detachElements(vehicle, localPlayer) end )
  4. runcode -resource needs to be running to make /run work. Alternatives: /srun - server run /crun - client run
  5. Hello, I have created a script that attaches a radio channel to a vehicle, and when I do a specific command, the car gets attached to me, with z + 5. However, the music stays in the original position on all other connected clients, they cannot hear the music when we're away from the original position, and the song is connected to me, and only I am able to hear the music, but they can't. What's the problem? /electro - teleports the vehicle to you /attachelectro - attaches the vehicle to you /detachelectro - detaches the vehicle from you -- Miniatures local url = "http://electroradio.ch/stream.m3u" local px, py, pz = 1296, -1411, 14 local volume = 1.0 local distance = 70 local model = 495 addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function() -- Vehicle Configuration vehicle = createVehicle(tonumber(model), tonumber(px), tonumber(py), tonumber(pz)) setVehicleColor(vehicle, 126, 126, 0, 0) setVehicleLocked(vehicle, true) setVehicleDoorsUndamageable(vehicle, false) setVehicleDamageProof(vehicle, true) setElementRotation(vehicle, 0, 0, 90) setElementFrozen(vehicle, true) setElementAlpha(vehicle, 0) -- Stream Configuration sound = playSound3D(tostring(url), tonumber(px), tonumber(py), tonumber(pz), false) setSoundVolume(sound, tonumber(volume)) setSoundMaxDistance(sound, tonumber(distance)) attachElements(sound, vehicle, 0, 0, 5) end ) addCommandHandler("electro", function(cmd) local x, y, z = getElementPosition(localPlayer) setElementPosition(vehicle, x, y, z + 5) end ) addCommandHandler("attachelectro", function(cmd) attachElements(vehicle, localPlayer, 0, 0, 5) end ) addCommandHandler("detachelectro", function(cmd) detachElements(vehicle, localPlayer) end )
  6. Whole script works just fine.
  7. He's running mabako's Paradise:MTA gamemode obviously.
  8. But i'm sure the file is in the resource folder and in the meta.xml i inserted this line: <config src="locations.xml" type="server"/> You do not need to insert that XML file in any meta.xml or so.
  9. Problem is in the MySQL configuration.
  10. myonlake

    Disco help

    Disco lights are not synchronized so well in GTA/MTA.. you would need to use shaders to make them work better than a solid white light line going around the disco floor lol.
  11. local sqlHostname = "127.0.0.1" -- Hostname local sqlUsername = "pao13_dtr" -- Username local sqlPassword = "dtr4ever" -- Password local sqlDefaultDatabase = "pao13_dtr" -- Database local sqlDefaultTable = "userdata" -- Table -- Connect to the database function mySQLConnect() local server = dbConnect("sqlite", "file.db") end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), mySQLConnect) -- Make a new entry to the MySQL database function checkSQLData(player) local player = source local serial = getPlayerSerial(player) local entryCheck = dbQuery(mySQLConnect, "SELECT serial FROM " .. sqlDefaultTable .. " WHERE serial='" ..serial.. "'") if (entryCheck) then local result = dbPoll(entryCheck, 1, 1) if (result == "") or (result == nil) then outputDebugString("New entry added to the mySQL database!") dbQuery(mySQLConnect, "INSERT INTO " .. sqlDefaultTable.." (serial) VALUES ('"..serial.."')") dbExec(mySQLConnect, "UPDATE " .. sqlDefaultTable .. " SET playerName='".. string.gsub(getPlayerName(player), "#%x%x%x%x%x%x", "") .. "' WHERE serial='" .. serial .. "'") end else outputDebugString("New entry added to the mySQL database!") dbQuery(mySQLConnect,"INSERT INTO "..sqlDefaultTable.." (serial) VALUES ('"..serial.."')") dbExec(mySQLConnect,"UPDATE " .. sqlDefaultTable .. " SET playerName='" .. string.gsub(getPlayerName(player),"#%x%x%x%x%x%x", "") .. "' WHERE serial='" .. serial .. "'") end end addEventHandler("onPlayerJoin", getRootElement(), checkSQLData) addEventHandler("onResourceStart",getResourceRootElement(getThisResource()), function() for index, player in ipairs(getElementsByType("player")) do checkSQLData(player) end end ) -- Load data from the database function loadPlayerData(player, datatype) if (player) and (datatype) then local serial = getPlayerSerial(player) local findQuery = dbQuery(mySQLConnect, "SELECT " .. datatype .. " FROM " .. sqlDefaultTable .. " WHERE serial='" .. serial .. "'") if (findQuery) then local result = dbPoll(findQuery, 1, 1) if not (result == nil) then if not (result == "") then dbFree(findQuery) return result else dbFree(findQuery) return 0 end else return 0 end else --outputDebugString("Failed to get "..datatype.." for player "..getPlayerName(player).." @ findQuery") --outputDebugString("mysql_query failed: (" .. mysql_errno(sqlConnection) .. ") " .. mysql_error(sqlConnection)) end end end -- Save data to the database function savePlayerData (player, datatype, newvalue) if (player) and (datatype) and (newvalue) then local serial = getPlayerSerial(player) local saveData = dbExec(mySQLConnect, "UPDATE " .. sqlDefaultTable .. " SET " .. datatype .. "='" .. newvalue .. "' WHERE serial='" .. serial .. "'") if (saveData == nil) then outputDebugString("Error executing the save query: (" .. mysql_errno(sqlConnection) .. ") " .. mysql_error(sqlConnection)) end end end
  12. I still don't like that you're making it like that, of course we all have our own systems, however I prefer my one, it uses everything it should use. I am not leaving anything alone there.
  13. Copy my code again, saw something. @All: Why do you all need to reply here with your codes. It's better if you let the first helper help to the end. Not that everybody just strikes in.
  14. Try my script, it seems more systematic. addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function() music = guiCreateWindow(0.2988, 0.2317, 0.4238, 0.5617, "ppS Music Player", true) guiSetVisible(music, false) music_play = guiCreateLabel(0.3864, 0.1098, 0.236, 0.0445, "Now playing:", true, music) guiLabelSetHorizontalAlign(music_play, "center", false) guiLabelSetColor(music_play, 255, 20, 147, 255) guiSetFont(music_play,"default-bold-small") guiSetAlpha(music_play, 1) music_name = guiCreateLabel(0.1268, 0.1869, 0.7611, 0.0623, "", true, music) guiLabelSetHorizontalAlign(music_name, "center", false) music_grid = guiCreateGridList(0.0649, 0.2997, 0.8732, 0.6261, true, music) guiGridListSetSelectionMode(music_grid, 0) music_grid_column = guiGridListAddColumn(music_grid, "Playlist", 0.2) if (music_grid_column) then for name, dir in ipairs(musics) do local newRow = guiGridListAddRow(music_grid) guiGridListSetItemText(music_grid, newRow, music_grid_column, #musics, false, false) end end end ) function showWindow() if (guiGetVisible(music) == true) then guiSetVisible(music, false) showCursor(false) else guiSetVisible(music, true) showCursor(true) end end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function() bindKey("F3", "down", showWindow) end )
  15. Few missing ends there. Edited. function DestructionWin() local alivePlayers = getAlivePlayers() if #alivePlayers == 1 then local account = getPlayerAccount(alivePlayers[1]) if isGuestAccount(account) then return end local playername = getPlayerName(alivePlayers[1]) setAccountData(account,"Race Wins",tostring(raceWins)+1) outputChatBox("#FFA824The player " .. playername .. " won!", getRootElement(), 255, 255, 255, true) end end addEventHandler("onPlayerWasted", getRootElement(), function() local account = getPlayerAccount(alivePlayers[1]) if isGuestAccount(account) then return end setAccountData(account, "Race Loses", tostring(raceLoses) + 1) end) setTimer(function() if isGuestAccount(account) then return end local account = getPlayerAccount(source) local timePlayed = getAccountData(account, "Time played") if (not timePlayed) then setAccountData(account, "Time played", "0:0:0") end local hours, mins, secs = unpack(split(timePlayed, ":")) local hours = tonumber(hours) local mins = tonumber(mins) local secs = tonumber(secs) if (hours and mins and secs) then local newsec = secs + 1 if (newsec >= 60) then newsec = 0 mins = mins + 1 end if (mins >= 60) then mins = 0 hours = hours + 1 end setAccountData(account, "Time played", tostring(hours) .. ":" .. tostring(mins) .. ":" .. tostring(newsec)) end end, 1000, 1) function ratioCalculator() local KDR_DECIMAL_PLACES = 2 local account = getPlayerAccount(source) local raceLoses = getAccountData(account, "Race Loses") if raceLoses == 0 then setAccountData(account, "Ratio", "-") else local kdr = round(getAccountData(account, "Race Wins") / raceLoses, KDR_DECIMAL_PLACES) setAccountData(account, "Ratio", tostring(kdr)) end end 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) function publicstatsinfo() local account = getPlayerAccount(source) if isGuestAccount(account) then return end local askdname = getPlayerName(source) local wins = getAccountData(account, "Race Wins") local loses = getAccountData(account, "Race Loses") local ratio = getAccountData(account, "Ratio") local timePlayed = getAccountData(account, "Time played") if loses and wins then outputChatBox("#FFA824*" .. askdname .. " won " .. wins .. " times and he/she lost " .. loses .. " times, his/her ratio is " .. ratio .. " and the total time played he/she is: " .. timePlayed, getRootElement(), 255, 12, 15, true) else outputChatBox("*You don't losed or won" , getRootElement(), 255, 12, 15, true) end end addEvent("stats", true) addEventHandler("stats", getRootElement(), publicstatsinfo) function checkCommand(message, messageType) if (messageType == 0) then if (message == "!stats") then cancelEvent() setTimer(triggerEvent, 100, 1, "stats", source) end end end addEventHandler("onPlayerChat", getRootElement(), checkCommand)
  16. GanJa, actually it was an error. function DestructionWin() local alivePlayers = getAlivePlayers() if #alivePlayers == 1 then local account = getPlayerAccount(alivePlayers[1]) if isGuestAccount(account) then return end local playername = getPlayerName(alivePlayers[1]) setAccountData(account,"Race Wins",tostring(raceWins)+1) outputChatBox ( "#FFA824The player " .. playername .. " won!", getRootElement(), 255, 255, 255, true ) end addEventHandler("onPlayerWasted", getRootElement(), function() local account = getPlayerAccount(alivePlayers[1]) if isGuestAccount(account) then return end setAccountData(account,"Race Loses",tostring(raceLoses)+1) end) function updateTimePlayed() if isGuestAccount(account) then return end local account = getPlayerAccount(source) local timePlayed = getAccountData(account, "Time played") if (not timePlayed) then setAccountData(account, "Time played","0:0:0") end local hours, mins, secs = unpack(split(timePlayed, ":")) local hours = tonumber(hours) local mins = tonumber(mins) local secs = tonumber(secs) if (hours and mins and secs) then local newsec = secs + 1 if ( newsec >= 60 ) then newsec = 0 mins = mins + 1 end if ( mins >= 60 ) then mins = 0 hours = hours + 1 end setAccountData ( account, "Time played", tostring(hours) ..":".. tostring(mins) ..":".. tostring(newsec)) end end end setTimer(updateTimePlayed,1000,1) function ratioCalculator() local KDR_DECIMAL_PLACES = 2 local account = getPlayerAccount(source) local raceLoses = getAccountData(account,"Race Loses") if raceLoses == 0 then setAccountData(account, "Ratio", "-") else local kdr = round(getAccountData(account, "Race Wins") / raceLoses, KDR_DECIMAL_PLACES) setAccountData(account, "Ratio", tostring(kdr)) end end 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) function publicstatsinfo() local account = getPlayerAccount(source) if isGuestAccount(account) then return end local askdname = getPlayerName(source) local wins = getAccountData(account, "Race Wins") local loses = getAccountData(account, "Race Loses") local ratio = getAccountData(account, "Ratio") local timePlayed = getAccountData(account, "Time played") if loses and wins then outputChatBox("#FFA824*" .. askdname .. " won " .. wins .. " times and he/she lost " .. loses .. " times, his/her ratio is " .. ratio .. " and the total time played he/she is: " .. timePlayed, getRootElement(), 255, 12, 15, true) else outputChatBox("*You don't losed or won" , getRootElement(), 255, 12, 15, true) end end addEvent("stats", true) addEventHandler("stats", getRootElement(), publicstatsinfo) function checkCommand(message, messageType) if (messageType == 0) then if (message == "!stats") then cancelEvent() setTimer(triggerEvent, 100, 1, "stats", source) end end end addEventHandler("onPlayerChat", getRootElement(), checkCommand)
  17. How do I store info in my own gamemode? It's MySQL.
  18. myonlake

    2 question

    Commands /createcol - creates a colCuboid /deletecol - deletes a colCuboid that was created before function createCol(player, cmd) if getElementType(player) == "player" then if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(player)), aclGetGroup("Admin")) then if not g_base_col then g_base_col = createColCuboid(130.09884643555, -2079.8127441406, -10, 250, 300, 500) else outputChatBox("Error happened: collision shape is already created, delete it first.", player, 255, 0, 0, false) end end end end addCommandHandler("createcol", createCol) function deleteCol(player, cmd) if getElementType(player) == "player" then if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("Admin")) then if g_base_col then destroyElement(g_base_col) else outputChatBox("Error happened: collision shape is not created yet.", player, 255, 0, 0, false) end end end end addCommandHandler("deletecol", deleteCol)
  19. It is. As you know, upgrades are -objects- (at least as far as I know?). You need to replace the objects. And if I was wrong, you should make a script that attaches upgrades to your car (objects) and they're replaced with you .txd's.
  20. A small heads up -script for you. Things you need to do yourself: - Find the account from the XML file and save it to the same child. Do not let it always make a new child. - Give you information on player connect and fetch your money and houses/vehicles. Tested and working. Only thing you need to do is the above thing. local xml_file = "data.xml" function findPlayer(name, player) local matches = {} for i, v in ipairs(getElementsByType("player")) do if getPlayerName(v) == name then return v end local playerName = getPlayerName(v):gsub("#%x%x%x%x%x%x", "") playerName = playerName:lower() if playerName:find(name:lower(), 0) then table.insert(matches, v) end end if #matches == 1 then return matches[1] else outputChatBox("Found " .. #matches .. " players with that partial name.", player, 220, 220, 0, true) end return false end addCommandHandler("issuehouse", function(player, cmd, name, id) if hasObjectPermissionTo(player, "function.banPlayer") then if tostring(name) then if tonumber(id) then local target = findPlayer(name, player) if tostring(target) then setElementData(target, "temp.houseid", tonumber(id)) outputChatBox("House with ID " .. tonumber(id) .. " successfully issued to " .. tostring(target) .. ".", player, 0, 255, 0, false) outputChatBox(getPlayerName(player) .. " issued a house to you with ID " .. tonumber(id) .. ".", target, 0, 255, 0, false) else outputChatBox("No players found with name " .. tostring(name) .. ".", player, 255, 0, 0, false) end else outputChatBox("Syntax: /issuehouse [string: player] [number: id]", player, 220, 220, 0, false) end else outputChatBox("Syntax: /issuehouse [string: player] [number: id]", player, 220, 220, 0, false) end else outputChatBox("No sufficent privileges to execute this command.", player, 255, 0, 0, false) end end ) addCommandHandler("issuevehicle", function(player, cmd, name, id) if hasObjectPermissionTo(player, "function.banPlayer") then if tostring(name) then if tonumber(id) then local target = findPlayer(name, player) if tostring(target) then local vehicle = getPedOccupiedVehicle(target) if vehicle then setElementData(target, "temp.vehicleid", tonumber(id)) outputChatBox("Vehicle '" .. getVehicleName(vehicle) .. "' successfully issued to " .. tostring(getPlayerName(target)) .. " with ID " .. tonumber(id) .. ".", player, 0, 255, 0, false) outputChatBox(getPlayerName(player) .. " issued a vehicle '" .. getVehicleName(vehicle) .. "' to you with ID " .. tonumber(id) .. ".", target, 0, 255, 0, false) else outputChatBox(getPlayerName(target) .. " is not in a vehicle at the moment.", player, 255, 0, 0, false) end else outputChatBox("No players found with name " .. tostring(name) .. ".", player, 255, 0, 0, false) end else outputChatBox("Syntax: /issuevehicle [string: player] [number: id]", player, 220, 220, 0, false) end else outputChatBox("Syntax: /issuevehicle [string: player] [number: id]", player, 220, 220, 0, false) end else outputChatBox("No sufficent privileges to execute this command.", player, 255, 0, 0, false) end end ) addCommandHandler("saveme", function(player, cmd) local xml = xmlLoadFile(tostring(xml_file)) if xml then if getAccountName(getPlayerAccount(player)) then if getElementData(player, "temp.houseid") and getElementData(player, "temp.vehicleid") then local new = xmlCreateChild(xml, "data") xmlNodeSetAttribute(new, "account", getAccountName(getPlayerAccount(player))) xmlNodeSetAttribute(new, "houseid", getElementData(player, "temp.houseid")) xmlNodeSetAttribute(new, "vehicleid", getElementData(player, "temp.vehicleid")) xmlNodeSetAttribute(new, "money", getPlayerMoney(player)) xmlSaveFile(xml) xmlUnloadFile(xml) elseif not getElementData(player, "temp.vehicleid") and getElementData(player, "temp.houseid") then local new = xmlCreateChild(xml, "data") xmlNodeSetAttribute(new, "account", getAccountName(getPlayerAccount(player))) xmlNodeSetAttribute(new, "houseid", getElementData(player, "temp.houseid")) xmlNodeSetAttribute(new, "money", getPlayerMoney(player)) xmlSaveFile(xml) xmlUnloadFile(xml) elseif not getElementData(player, "temp.houseid") and getElementData(player, "temp.vehicleid") then local new = xmlCreateChild(xml, "data") xmlNodeSetAttribute(new, "account", getAccountName(getPlayerAccount(player))) xmlNodeSetAttribute(new, "vehicleid", getElementData(player, "temp.vehicleid")) xmlNodeSetAttribute(new, "money", getPlayerMoney(player)) xmlSaveFile(xml) xmlUnloadFile(xml) else local new = xmlCreateChild(xml, "data") xmlNodeSetAttribute(new, "account", getAccountName(getPlayerAccount(player))) xmlNodeSetAttribute(new, "money", getPlayerMoney(player)) xmlSaveFile(xml) xmlUnloadFile(xml) end outputChatBox("Your data was successfully saved.", player, 0, 255, 0, false) outputDebugString(getPlayerName(player) .. " saved his data to " .. tostring(xml_file) .. ".") else outputChatBox("Please log in first.", player, 255, 0, 0, false) end else outputChatBox("XML error happened, report to the administration.", player, 255, 0, 0, false) outputDebugString("Unable to read file " .. tostring(xml_file) .. ". " .. getPlayerName(player) .. "'s data was not saved. Make sure you have created the XML file.") end end ) addEventHandler("onPlayerQuit", root, function() local xml = xmlLoadFile(tostring(xml_file)) if xml then if getElementData(player, "temp.houseid") and getElementData(player, "temp.vehicleid") then local new = xmlCreateChild(xml, "data") xmlNodeSetAttribute(new, "account", getAccountName(getPlayerAccount(player))) xmlNodeSetAttribute(new, "houseid", getElementData(player, "temp.houseid")) xmlNodeSetAttribute(new, "vehicleid", getElementData(player, "temp.vehicleid")) xmlNodeSetAttribute(new, "money", getPlayerMoney(player)) xmlSaveFile(xml) xmlUnloadFile(xml) elseif not getElementData(player, "temp.vehicleid") and getElementData(player, "temp.houseid") then local new = xmlCreateChild(xml, "data") xmlNodeSetAttribute(new, "account", getAccountName(getPlayerAccount(player))) xmlNodeSetAttribute(new, "houseid", getElementData(player, "temp.houseid")) xmlNodeSetAttribute(new, "money", getPlayerMoney(player)) xmlSaveFile(xml) xmlUnloadFile(xml) elseif not getElementData(player, "temp.houseid") and getElementData(player, "temp.vehicleid") then local new = xmlCreateChild(xml, "data") xmlNodeSetAttribute(new, "account", getAccountName(getPlayerAccount(player))) xmlNodeSetAttribute(new, "vehicleid", getElementData(player, "temp.vehicleid")) xmlNodeSetAttribute(new, "money", getPlayerMoney(player)) xmlSaveFile(xml) xmlUnloadFile(xml) else local new = xmlCreateChild(xml, "data") xmlNodeSetAttribute(new, "account", getAccountName(getPlayerAccount(player))) xmlNodeSetAttribute(new, "money", getPlayerMoney(player)) xmlSaveFile(xml) xmlUnloadFile(xml) end outputDebugString(getPlayerName(source) .. " saved his data to " .. tostring(xml_file) .. ".") else outputDebugString("Unable to read file " .. tostring(xml_file) .. ". " .. getPlayerName(source) .. "'s data was not saved. Make sure you have created the XML file.") end end )
  21. Yes, it's possible. You need to use MySQL or SQLite for saving those stuff.
  22. No one will if you can't give us a proper introduction about your server.
  23. Hehe thanks for everybody's messages
  24. function publicstatsinfo() local account = getPlayerAccount(source) if isGuestAccount(account) then return end local askdname = getPlayerName(source) local wins = getAccountData(account, "Race Wins") local loses = getAccountData(account, "Race Loses") local ratio = getAccountData(account, "Ratio") local timePlayed = getAccountData(account, "Time played") if loses and wins then outputChatBox("#FFA824*" .. askdname .. " won " .. wins .. " times and he/she lost " .. loses .. " times, his/her ratio is " .. ratio .. " and the total time played he/she is: " .. timePlayed, getRootElement(), 255, 12, 15, true) else setAccountData(account, "RaceWins" , 0) setAccountData(account, "RaceLoses" , 0) end end addEvent("stats", true) addEventHandler("stats", getRootElement(), publicstatsinfo)
×
×
  • Create New...