![](https://forum.multitheftauto.com/uploads/set_resources_22/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
SuleymanM
-
Posts
306 -
Joined
-
Last visited
Posts posted by SuleymanM
-
-
Hi all,
An guy help to me with country ... and succesful add Country flag | Names no function , why?
-- show_country.lua
exports.scoreboard:addScoreboardColumn('Country') function showcountry() local flag = exports.admin:getPlayerCountry ( source ) if flag then setElementData(source,"Country",":admin/client/images/flags/"..flag..".png") else setElementData(source,"Country",":admin/client/images/flags/za.png") end end addEventHandler("onPlayerJoin",getRootElement(),showcountry)
-- Pls help me , idon't know how to proceed.
I want country like : ( Flag + Country ) in one collumn
My Country :
I want like :
-
Hi all,
I have "Huntertimes" by Jake .
And i solved problem with save toptimes & database
New problem:
- Why when join the game not start automatically to new map (need to /restart toptimy - to can see all, and when reconnect no see .. need again restart)
TopTime :
--Server.LUA
--[[ Developer: Jake Resource: Toptimes ]]-- function startConnection() ttHandler = dbConnect("mysql","dbname=arena;host=localhost","root","") if ttHandler then outputDebugString("Toptimes Connection to database successfull") else ttHandler = nil outputDebugString("Toptimes can't connect to database") end end startConnection() g_MapName = "-" function loadTimes(map) local tts = {} local query = dbQuery(ttHandler,"SELECT * FROM `toptimes` WHERE `mapname` = '"..tostring(map).."' LIMIT 0,1;") if query then local result, row = dbPoll(query,-1) if result and row > 0 then for id, res in ipairs(result) do --outputChatBox("Works till here") tts = fromJSON(res['toptimes']) end end end dbFree(query) return tts end function saveTimes(time,map) local query = dbQuery(ttHandler,"SELECT * FROM `toptimes` WHERE `mapname` = '"..tostring(map).."'") local result = dbPoll( query, 10 ) if query and #result > 0 then outputDebugString("Succesfully Loaded TopTime") local exec = dbQuery(ttHandler,"UPDATE `toptimes` SET `toptimes` = '"..toJSON(time).."' WHERE `mapname` = '"..tostring(map).."'") if exec ~= false then outputDebugString("Updating Toptimes for '"..tostring(map)) end else local querryb = dbQuery(ttHandler, "INSERT INTO toptimes (mapname,toptimes) VALUES (?,?)", tostring(map),toJSON(time)) local resulbt = dbPoll( querryb, 10 ) if resulbt ~= false then outputDebugString("Added Toptimes for '"..tostring(map)) end end dbFree(query) end function sortToptimes(tabl) local oldT = tabl[12] table.sort(tabl, function(a,b) return a.time < b.time end) local newT = tabl[12] triggerClientEvent(root,"updateToptimesTable",root,tabl) return tabl end function addNewToptime(ttable, accname, ttime, date, country) for i,v in ipairs(ttable) do if v.name == accname then if v.time > ttime then if v.date and v.country then v.time = ttime v.date = date v.country = country sortToptimes(ttable) return true end end return false end end local playertable = {} playertable.name = accname playertable.time = ttime playertable.date = date playertable.country = country ttable[#ttable+1] = playertable sortToptimes(ttable) return true end function getPlayerTopTime(tts, player) for id, v in ipairs(tts) do if v.name == getPlayerName(player) then local rtts = {} rtts.name = v.name rtts.i = id rtts.time = msToTimeStr(v.time) return rtts end end end gToptimes = false addEvent("onMapStarting") addEventHandler("onMapStarting", root, function(mapInfo) local OldMap = g_MapName if OldMap ~= mapInfo.name then if gToptimes ~= false then --outputChatBox(#gToptimes) saveTimes(gToptimes,g_MapName) end gToptimes = false end g_MapName = mapInfo.name if string.find(mapInfo.name,"[DM]") or string.find(mapInfo.name,"race-[DM]") then for id, player in ipairs(getElementsByType("player")) do if OldMap ~= mapInfo.name then gToptimes = loadTimes(g_MapName) triggerClientEvent(player,"doSendClientToptimes",root,player,gToptimes,g_MapName) end end end end) addEvent("onPlayerPickUpRacePickup") addEventHandler("onPlayerPickUpRacePickup",root,function(id,sort,model) if sort == "vehiclechange" then if (model == 425) then --if (getElementModel(getPedOccupiedVehicle(source))~= 425 ) then local time = exports['race']:getTimePassed() local name = getPlayerNametagText(source) local t = getRealTime() local ct --outputChatBox(time) local date = t.monthday.."."..(t.month+1).."."..(t.year+1900) local country = exports['admin']:getPlayerCountry(source) if country then ct = ':admin/client/images/flags/'..country..'.png' else ct = "N/A" end addNewToptime(gToptimes,name,time,date,ct) local t = getPlayerTopTime(gToptimes,source) outputChatBox("#0087FF[HUNTER] #ffffff"..getPlayerName(source).." #ffffffmade a new toptime #0087FF"..t.time.." #ffffffand got position #0087FF"..t.i, getRootElement(), 255, 255, 255, true) --end end end end) function removeToptime(player, cmd, i) if tonumber(getElementData(player,"team")) >= 3 then if not tonumber(i) or i == nil then outputChatBox("#0087FF[HUNTER] #ffffffThis was not a valid number", player, 255, 255, 255, true) return end i = tonumber(i) if gToptimes[i] then table.remove(gToptimes,i) sortToptimes(gToptimes) outputChatBox("#0087FF[HUNTER] #ffffffYou deleted Toptime 0087FF#"..i, player, 255, 255, 255, true) end end end addCommandHandler("deletetime", removeToptime) function msToTimeStr(ms) if not ms then return '' end local centiseconds = tostring(math.floor(math.fmod(ms, 1000)/10)) if #centiseconds == 1 then centiseconds = '0' .. centiseconds end local s = math.floor(ms / 1000) local seconds = tostring(math.fmod(s, 60)) if #seconds == 1 then seconds = '0' .. seconds end local minutes = tostring(math.floor(s / 60)) return minutes .. ':' .. seconds .. ':' .. centiseconds end
-
//solved
-
i no have password ... how write?
-
pls help me...
-
[2013-06-05 16:53:44] ERROR: [gamemodes]\[race]\[addons]\toptimy\toptime\t_server.lua:7: dbConnect failed; Can't connect to MySQL server on 'localhost' (10061)
[2013-06-05 16:53:44] INFO: Toptimes can't connect to database
-
replaced :
--[[ Developer: Jake Resource: Toptimes ]]-- function startConnection() ttHandler = dbConnect("mysql","dbname=(DB Name);host=localhost","root","(password)") if ttHandler then outputDebugString("Toptimes Connection to database successfull") else ttHandler = nil outputDebugString("Toptimes can't connect to database") end end startConnection() g_MapName = "-" function loadTimes(map) local tts = {} local query = dbQuery(ttHandler,"SELECT * FROM `toptimes` WHERE `mapname` = '"..tostring(map).."' LIMIT 0,1;") if query then local result, row = dbPoll(query,-1) if result and row > 0 then for id, res in ipairs(result) do --outputChatBox("Works till here") tts = fromJSON(res['toptimes']) end end end dbFree(query) return tts end function saveTimes(time,map) local query = dbQuery(ttHandler,"SELECT * FROM `toptimes` WHERE `mapname` = '"..tostring(map).."'") local result = dbPoll( query, 10 ) if query and #result > 0 then outputDebugString("Succesfully Loaded TopTime") local exec = dbQuery(ttHandler,"UPDATE `toptimes` SET `toptimes` = '"..toJSON(time).."' WHERE `mapname` = '"..tostring(map).."'") if exec ~= false then outputDebugString("Updating Toptimes for '"..tostring(map)) end else local querryb = dbQuery(ttHandler, "INSERT INTO toptimes (mapname,toptimes) VALUES (?,?)", tostring(map),toJSON(time)) local resulbt = dbPoll( querryb, 10 ) if resulbt ~= false then outputDebugString("Added Toptimes for '"..tostring(map)) end end dbFree(query) end function sortToptimes(tabl) local oldT = tabl[12] table.sort(tabl, function(a,b) return a.time < b.time end) local newT = tabl[12] triggerClientEvent(root,"updateToptimesTable",root,tabl) return tabl end function addNewToptime(ttable, accname, ttime, date, country) for i,v in ipairs(ttable) do if v.name == accname then if v.time > ttime then if v.date and v.country then v.time = ttime v.date = date v.country = country sortToptimes(ttable) return true end end return false end end local playertable = {} playertable.name = accname playertable.time = ttime playertable.date = date playertable.country = country ttable[#ttable+1] = playertable sortToptimes(ttable) return true end function getPlayerTopTime(tts, player) for id, v in ipairs(tts) do if v.name == getPlayerName(player) then local rtts = {} rtts.name = v.name rtts.i = id rtts.time = msToTimeStr(v.time) return rtts end end end gToptimes = false addEvent("onMapStarting") addEventHandler("onMapStarting", root, function(mapInfo) local OldMap = g_MapName if OldMap ~= mapInfo.name then if gToptimes ~= false then --outputChatBox(#gToptimes) saveTimes(gToptimes,g_MapName) end gToptimes = false end g_MapName = mapInfo.name if string.find(mapInfo.name,"[DM]") or string.find(mapInfo.name,"race-[DM]") then for id, player in ipairs(getElementsByType("player")) do if OldMap ~= mapInfo.name then gToptimes = loadTimes(g_MapName) triggerClientEvent(player,"doSendClientToptimes",root,player,gToptimes,g_MapName) end end end end) addEvent("onPlayerPickUpRacePickup") addEventHandler("onPlayerPickUpRacePickup",root,function(id,sort,model) if sort == "vehiclechange" then if (model == 425) then --if (getElementModel(getPedOccupiedVehicle(source))~= 425 ) then local time = exports['race']:getTimePassed() local name = getPlayerNametagText(source) local t = getRealTime() local ct --outputChatBox(time) local date = t.monthday.."."..(t.month+1).."."..(t.year+1900) local country = exports['admin']:getPlayerCountry(source) if country then ct = ':admin/client/images/flags/'..country..'.png' else ct = "N/A" end addNewToptime(gToptimes,name,time,date,ct) local t = getPlayerTopTime(gToptimes,source) outputChatBox("#0087FF[HUNTER] #ffffff"..getPlayerName(source).." #ffffffmade a new toptime #0087FF"..t.time.." #ffffffand got position #0087FF"..t.i, getRootElement(), 255, 255, 255, true) --end end end end) function removeToptime(player, cmd, i) if tonumber(getElementData(player,"team")) >= 3 then if not tonumber(i) or i == nil then outputChatBox("#0087FF[HUNTER] #ffffffThis was not a valid number", player, 255, 255, 255, true) return end i = tonumber(i) if gToptimes[i] then table.remove(gToptimes,i) sortToptimes(gToptimes) outputChatBox("#0087FF[HUNTER] #ffffffYou deleted Toptime 0087FF#"..i, player, 255, 255, 255, true) end end end addCommandHandler("deletetime", removeToptime) function msToTimeStr(ms) if not ms then return '' end local centiseconds = tostring(math.floor(math.fmod(ms, 1000)/10)) if #centiseconds == 1 then centiseconds = '0' .. centiseconds end local s = math.floor(ms / 1000) local seconds = tostring(math.fmod(s, 60)) if #seconds == 1 then seconds = '0' .. seconds end local minutes = tostring(math.floor(s / 60)) return minutes .. ':' .. seconds .. ':' .. centiseconds end
-
-- t_server.lua
(Need to create an xampp database . phpmyadmin ? )
--[[ Developer: Jake Resource: Toptimes ]]-- function startConnection() ttHandler = dbConnect("mysql","dbname=;host=","","") if ttHandler then outputDebugString("Toptimes Connection to database successfull") else ttHandler = nil outputDebugString("Toptimes can't connect to database") end end startConnection() g_MapName = "-" function loadTimes(map) local tts = {} local query = dbQuery(ttHandler,"SELECT * FROM `toptimes` WHERE `mapname` = '"..tostring(map).."' LIMIT 0,1;") if query then local result, row = dbPoll(query,-1) if result and row > 0 then for id, res in ipairs(result) do --outputChatBox("Works till here") tts = fromJSON(res['toptimes']) end end end dbFree(query) return tts end function saveTimes(time,map) local query = dbQuery(ttHandler,"SELECT * FROM `toptimes` WHERE `mapname` = '"..tostring(map).."'") local result = dbPoll( query, 10 ) if query and #result > 0 then outputDebugString("Succesfully Loaded TopTime") local exec = dbQuery(ttHandler,"UPDATE `toptimes` SET `toptimes` = '"..toJSON(time).."' WHERE `mapname` = '"..tostring(map).."'") if exec ~= false then outputDebugString("Updating Toptimes for '"..tostring(map)) end else local querryb = dbQuery(ttHandler, "INSERT INTO toptimes (mapname,toptimes) VALUES (?,?)", tostring(map),toJSON(time)) local resulbt = dbPoll( querryb, 10 ) if resulbt ~= false then outputDebugString("Added Toptimes for '"..tostring(map)) end end dbFree(query) end function sortToptimes(tabl) local oldT = tabl[12] table.sort(tabl, function(a,b) return a.time < b.time end) local newT = tabl[12] triggerClientEvent(root,"updateToptimesTable",root,tabl) return tabl end function addNewToptime(ttable, accname, ttime, date, country) for i,v in ipairs(ttable) do if v.name == accname then if v.time > ttime then if v.date and v.country then v.time = ttime v.date = date v.country = country sortToptimes(ttable) return true end end return false end end local playertable = {} playertable.name = accname playertable.time = ttime playertable.date = date playertable.country = country ttable[#ttable+1] = playertable sortToptimes(ttable) return true end function getPlayerTopTime(tts, player) for id, v in ipairs(tts) do if v.name == getPlayerName(player) then local rtts = {} rtts.name = v.name rtts.i = id rtts.time = msToTimeStr(v.time) return rtts end end end gToptimes = false addEvent("onMapStarting") addEventHandler("onMapStarting", root, function(mapInfo) local OldMap = g_MapName if OldMap ~= mapInfo.name then if gToptimes ~= false then --outputChatBox(#gToptimes) saveTimes(gToptimes,g_MapName) end gToptimes = false end g_MapName = mapInfo.name if string.find(mapInfo.name,"[DM]") or string.find(mapInfo.name,"race-[DM]") then for id, player in ipairs(getElementsByType("player")) do if OldMap ~= mapInfo.name then gToptimes = loadTimes(g_MapName) triggerClientEvent(player,"doSendClientToptimes",root,player,gToptimes,g_MapName) end end end end) addEvent("onPlayerPickUpRacePickup") addEventHandler("onPlayerPickUpRacePickup",root,function(id,sort,model) if sort == "vehiclechange" then if (model == 425) then --if (getElementModel(getPedOccupiedVehicle(source))~= 425 ) then local time = exports['race']:getTimePassed() local name = getPlayerNametagText(source) local t = getRealTime() local ct --outputChatBox(time) local date = t.monthday.."."..(t.month+1).."."..(t.year+1900) local country = exports['admin']:getPlayerCountry(source) if country then ct = ':admin/client/images/flags/'..country..'.png' else ct = "N/A" end addNewToptime(gToptimes,name,time,date,ct) local t = getPlayerTopTime(gToptimes,source) outputChatBox("#0087FF[HUNTER] #ffffff"..getPlayerName(source).." #ffffffmade a new toptime #0087FF"..t.time.." #ffffffand got position #0087FF"..t.i, getRootElement(), 255, 255, 255, true) --end end end end) function removeToptime(player, cmd, i) if tonumber(getElementData(player,"team")) >= 3 then if not tonumber(i) or i == nil then outputChatBox("#0087FF[HUNTER] #ffffffThis was not a valid number", player, 255, 255, 255, true) return end i = tonumber(i) if gToptimes[i] then table.remove(gToptimes,i) sortToptimes(gToptimes) outputChatBox("#0087FF[HUNTER] #ffffffYou deleted Toptime 0087FF#"..i, player, 255, 255, 255, true) end end end addCommandHandler("deletetime", removeToptime) function msToTimeStr(ms) if not ms then return '' end local centiseconds = tostring(math.floor(math.fmod(ms, 1000)/10)) if #centiseconds == 1 then centiseconds = '0' .. centiseconds end local s = math.floor(ms / 1000) local seconds = tostring(math.fmod(s, 60)) if #seconds == 1 then seconds = '0' .. seconds end local minutes = tostring(math.floor(s / 60)) return minutes .. ':' .. seconds .. ':' .. centiseconds end
-
Ok what script ?
- t_client (complied)
- t_server
- util
-
Hi all,
I have an question and pls help me
-- I have an toptimes ...other tt ... and this tt need to have database .. is with name,time,flag,and date.
Problems:
-- Not save TT when close server ...
-- Not start automatically when player join
-- Not see when start an map
Look at console :
[2013-06-05 16:02:34] WARNING: [gamemodes]\[race]\[addons]\toptimy\toptime\t_server.lua:36: Bad argument @ 'dbQuery' [Expected db-connection at argument 1, got nil][2013-06-05 16:02:34] WARNING: [gamemodes]\[race]\[addons]\toptimy\toptime\t_server.lua:37: Bad argument @ 'dbPoll' [Expected db-query at argument 1, got boolean]
[2013-06-05 16:02:34] WARNING: [gamemodes]\[race]\[addons]\toptimy\toptime\t_server.lua:45: Bad argument @ 'dbQuery' [Expected db-connection at argument 1, got nil]
[2013-06-05 16:02:34] WARNING: [gamemodes]\[race]\[addons]\toptimy\toptime\t_server.lua:46: Bad argument @ 'dbPoll' [Expected db-query at argument 1, got boolean]
[2013-06-05 16:02:34] WARNING: [gamemodes]\[race]\[addons]\toptimy\toptime\t_server.lua:51: Bad argument @ 'dbFree' [Expected db-query at argument 1, got boolean]
[2013-06-05 16:02:34] WARNING: [gamemodes]\[race]\[addons]\toptimy\toptime\t_server.lua:21: Bad argument @ 'dbQuery' [Expected db-connection at argument 1, got nil]
[2013-06-05 16:02:34] WARNING: [gamemodes]\[race]\[addons]\toptimy\toptime\t_server.lua:31: Bad argument @ 'dbFree' [Expected db-query at argument 1, got boolean]
[2013-06-05 16:02:34] WARNING: [gamemodes]\[race]\[addons]\toptimy\toptime\t_server.lua:21: Bad argument @ 'dbQuery' [Expected db-connection at argument 1, got nil]
[2013-06-05 16:02:34] WARNING: [gamemodes]\[race]\[addons]\toptimy\toptime\t_server.lua:31: Bad argument @ 'dbFree' [Expected db-query at argument 1, got boolean]
[2013-06-05 16:02:34] WARNING: [gamemodes]\[race]\[addons]\toptimy\toptime\t_server.lua:21: Bad argument @ 'dbQuery' [Expected db-connection at argument 1, got nil]
[2013-06-05 16:02:34] WARNING: [gamemodes]\[race]\[addons]\toptimy\toptime\t_server.lua:31: Bad argument @ 'dbFree' [Expected db-query at argument 1, got boolean]
[2013-06-05 16:02:34] WARNING: [gamemodes]\[race]\[addons]\toptimy\toptime\t_server.lua:21: Bad argument @ 'dbQuery' [Expected db-connection at argument 1, got nil]
[2013-06-05 16:02:34] WARNING: [gamemodes]\[race]\[addons]\toptimy\toptime\t_server.lua:31: Bad argument @ 'dbFree' [Expected db-query at argument 1, got boolean]
TopTime image (toptimy) :
-- and in t_server.lua exists this line:
function startConnection() ttHandler = dbConnect("mysql","dbname=;host=","","")
pls help me in this last problem
-
pls help me
-
server side is all files on resource? =))
Where add that functions ?
Pls edit for me :
-- meta.xml
"Toptimes" description="Toptimes addon for Race" author="ccw" type="script" addon="race" version="0.0.3" build="r472 02Oct09"/>
-
where add this?
what is this 'serverside'?
-
what code?
-
Hi all,
Today an guy give to me an TopTimes panel : 'race_toptimes' .
- I added to admin right
- resource is unzipped.
-Console Problem:
[2013-06-02 10:40:24] ERROR: Client triggered serverside event onLoadedAtClient_tt, but event is not added serverside[2013-06-02 10:40:25] ERROR: Client triggered serverside event onClientRequestToptimesUpdates, but event is not added serverside
[2013-06-02 10:40:27] ERROR: Client triggered serverside event onClientRequestToptimesUpdates, but event is not added serverside
Problem in server:
- Not load TopTimes
- Not add top in panel when make...
Photo:
pls help me
-
not function 'debugscript 3' and 'debugscript race' ... its
i replace an new 'helpmanager' and in 'help.xml' is other text than in F9
-
Is not empty...
Probably problem is gamemode....
-
Hi all,
This is bug?
-- All know 'F9' KEY for HELP
-
This is FFS Resource ...
Look to an multi-language-chat ... its soo good..
https://community.multitheftauto.com/in ... ls&id=6380
---MCvarial
This is an improved chat resource for mta.Features include
- multiple chatboxes
- multiple tabs
- smileys
- multilingual chat
- multifunctional input box
- automatic nick completion & chat history (mIRC like)
- private messages (even between multiple servers)
- alot of exported functions
- ...
Required rights:
- function.executeCommandHandler
- function.callRemote
Contact:
This resource is pretty new so it might still have a few bugs, you can always contact me on GTANet's irc.
-
not function
-
Hi all,
All know "SUport SYstem" -> viewtopic.php?f=108&t=41565
How to create an bindKey to this resource (not /bind...) i want when press F2 to appear the system.
-------
bindKey ("F2"...??? or other function?
-
when use /bm he buy nextmap and function ... when press 'Buy Map' in panel can't function
-
An guy give to me 'dashboard' user panel .
- Added to admin rights
- resource is unzipped
And have 2 problems(and last problems):
1) When buy an map no travelling to what map i buy...
2) Bugged? Function only : Author , money , stats , rank.
i need some files?
1)
2)
-
you added resource to the admin rights?
country flag & name
in Scripting
Posted
not function.... empty space...
Man , this is other problem .... i want all in one .... ( flags & country -> in one collumn)
I do not understand any of those topics