zixxonx
Members-
Posts
57 -
Joined
-
Last visited
Everything posted by zixxonx
-
Podaj pełne linki i powiedz o co Ci chodzi
-
Pytanie odnośnie niedziałającego skryptu
zixxonx replied to Archimonde's topic in Pomoc ze skryptami i programowaniem w Lua
Skrypt sigmar jest strasznie zbugowany, ps. jest za darmo. -
You should ask for the hostname of your ip database, databases can be on other server than 127.0.0.1 (dedi with your gameserver)
-
You got a MySQL database from MyServ? Also, you can try to input also port & socket in mysql: local handler = mysql_connect("127.0.0.1", "username", "password", "database", 3306, "/var/lib/libmysqlclient.so.15", "")
-
U started your home MySQL server & gave correct data in the configuration file?
-
Thats function i use: local gWeekDays = { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" } function FormatDate(format, escaper, timestamp) Check("FormatDate", "string", format, "format", {"nil","string"}, escaper, "escaper", {"nil","string"}, timestamp, "timestamp") escaper = (escaper or "'"):sub(1, 1) local time = getRealTime(timestamp) local formattedDate = "" local escaped = false time.year = time.year + 1900 time.month = time.month + 1 local datetime = { d = ("%02d"):format(time.monthday), h = ("%02d"):format(time.hour), i = ("%02d"):format(time.minute), m = ("%02d"):format(time.month), s = ("%02d"):format(time.second), w = gWeekDays[time.weekday+1]:sub(1, 2), W = gWeekDays[time.weekday+1], y = tostring(time.year):sub(-2), Y = time.year } for char in format:gmatch(".") do if (char == escaper) then escaped = not escaped else formattedDate = formattedDate..(not escaped and datetime[char] or char) end end return tostring(formattedDate) end firstplayed = tostring(mapinfo.map.firstplayed) firstplayed = FormatDate("d-m-Y-h-m", " ", firstplayed) lastplayed = tostring(mapinfo.map.lastplayed) lastplayed = FormatDate("d-m-Y-h-m", " ", lastplayed) outputChatBox(firstplayed) outputChatBox(lastplayed) It returns: (day).01.2014-(hour)-01 The minute is always 01! Whats the problem?
-
Now that local baxza = mysql_query(baza, "INSERT INTO `mapy` (map, author, firsplayed, lastplayed) VALUES ( map="..mapa..", \""..ktostworzyl.."\", "..timestamp..", "..timestamp..")") unknown column 'bandito' in field list bandito is map name... i did \""..map.."\" but instead of putting nam name it puts 0 in map column... the type of column is "TEXT", should it be varchar or something? I'll try and edit this post. edit: varchar isnt working... edit2: i did it: local baxza = mysql_query(baza, "INSERT INTO mapy (map, author, firsplayed, lastplayed) VALUES ( map=\""..mapa.."\", \""..ktostworzyl.."\", "..timestamp..", "..timestamp..")") and thats error [2014-01-05 07:04:56] INFO: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'the Dam, "Ransom", 1388905496, 1388905496)' at line 1
-
local query = mysql_query(baza, "SELECT * FROM mapy WHERE map="..mapName) if(result and mysql_num_rows( result ) > 0) then local rows = mysql_fetch_assoc(result) mapinfo.map.firstplayed = rows['firsplayed'] or timestamp mapinfo.map.played = rows['total'] or 0 mapinfo.map.rate = rows['rate'] or 0 mysql_query(baza, "UPDATE mapy SET lastplayed="..timestamp..",total=total+1 WHERE map="..mapName.."") else local mapa = mapName local autor = mapInfo.author local baxza = mysql_query(baza, "INSERT INTO `mapy` (map, author, firstplayed, lastplayed) VALUES ("..mapa..", "..autor..", "..timestamp..", "..timestamp..")") That's a piece of my code. It should work good for me but it wont, when this query is executed: local query = mysql_query(baza, "SELECT * FROM mapy WHERE map="..mapName Im getting a mysql error: unknown column (there is my map name) in where clause, i did adding the map but it wont add cuz this error. Any1 know how can i do it?
-
./debugscript 3 then show us errors (or in server.log)
-
Tworzenie ekwipunku
zixxonx replied to Ksantus12's topic in Pomoc ze skryptami i programowaniem w Lua
juz tak btw mysql to nie jest najlatwiejsze wyjscie, mozesz to tak samo dobrze zrobic na wbudowanym sqlite. -
Yeah it work correctly, idk how it can help but it helped. And i wont to create new thread so can i ask here? if messageType == 2 then cancelEvent() local r,g,b local druzyna = getPlayerTeam(source) r, g, b = getTeamColor ( druzyna ) --outputChatBox end I did it, but now how to get all players from current team? I have no idea how can i do it.
-
https://community.multitheftauto.com/index.php?p= ... ils&id=727 You mean that? That script is SQLite, i think it was just a mismatch of words. You need to convert it to MySQL.
-
Przecież ludzkie oko i tak nie zobaczy dobrze siedemdziesięciu klatek/s więc po co tyle?
-
to na pewno nie sa operatory?
-
Im muting player with this: mutedSerials [ getPlayerSerial ( target ) ] = 3000 (i put 3000 for testing ) and that's my checker function muteChecker() for id, player in ipairs(getElementsByType("player")) do if(anymute >= 1) then if(mutedSerials [ getPlayerSerial ( player ) ] == 0) then setElementData(player, "Muted", false) SkryptMsg(getPlayerName(player) .." has been unmuted by system!") anymute = anymute - 1 elseif(mutedSerials [ getPlayerSerial (player ) ] > 1000) then mutedSerials [ getPlayerSerial ( player ) ] = mutedSerials [ getPlayerSerial ( player ) ] - 1000 end end end end setTimer(muteChecker, 1000, 0) And i'm getting attempt to compare number with nil What's bad? Thats my script local mutedSerials = { } anymute = 0 function muteSomeone ( player, cmd, target, reason, czas ) if ( target and reason and czas ) then local target = getPlayerFromNamePart ( target ) if ( not isElement ( target ) ) then SkryptMsg ( "There is no player with this name", player) return end local czas = tonumber ( czas ) --local czas = mToMs ( czas ) if ( czas and czas >= 1 and not isPlayerMuted ( target ) ) then local milliseconds = math.floor ( czas * 60000 ) SkryptMsg ( getPlayerName ( target ) .." has been muted for ".. tostring ( czas ) .." minutes (".. reason ..") .") -- setPlayerMuted ( target, true ) --setTimer ( setPlayerMuted, milliseconds, 1, target, false ) mutedSerials [ getPlayerSerial ( target ) ] = 3000 setElementData(target, "Muted", true) anymute = anymute+1 end else SkryptMsg ( "Syntax: /mmute player reason time (in minutes)", player) end end addCommandHandler ( "dexmut", muteSomeone ) function muteChecker() for id, player in ipairs(getElementsByType("player")) do if(anymute >= 1) then if(mutedSerials [ getPlayerSerial ( player ) ] == 0) then setElementData(player, "Muted", false) SkryptMsg(getPlayerName(player) .." has been unmuted by system!") anymute = anymute - 1 elseif(mutedSerials [ getPlayerSerial (player ) ] > 1000) then mutedSerials [ getPlayerSerial ( player ) ] = mutedSerials [ getPlayerSerial ( player ) ] - 1000 end end end end setTimer(muteChecker, 1000, 0) function getPlayerFromNamePart(name) if name then for i, player in ipairs(getElementsByType("player")) do if string.find(getPlayerName(player):lower(), tostring(name):lower(), 1, true) then return player end end end return false end
-
https://www.youtube.com/watch?v=gSGRKZVC ... CD6E75BBDD Look at this video, at the minimap. How the scripter achieved rendering those objects (vgehshade_01) on minimap?
-
Im making a shader panel/scoreboard columns panel and thats my xml file: "true" carpaint="false" roadshine="false" killscol="true" deathscol="true" winscol="true"> That's good and it should work but i think those true and false are just strings, i did it local shaderwater = xmlNodeGetAttribute(xmlFile,"shaderwater") then outputChatBox(shaderwater) I should get error talking me about booleans but it shows the value also i must did it: xmlNodeSetAttribute(xmlFile,"shaderwater",tostring(getElementData(player, "shaderwater"))) To save it properly. Can i change those strings too booleans or is there any other function to save booleans properly?
-
Hi i have a small problem. Im drawing a 145px (it needs to be 145 to fit with my radar ;p) and the max veh health hp is 1000 ( i made it 100 by math), i made that bar: dxDrawRectangle(posx3,posy3,carhealth/10 , height3,tocolor(0,180,0,250) ,false) its just going to create 100px bar and when i do dxDrawRectangle(posx3,posy3,15*(carhealth/10) , height3,tocolor(0,180,0,250) ,false) The bar is showing good, but when my vehicle hp is very low (its firing) it still draw that 50px i added, is there any fix for that? I really want it!
-
Hi can someone help me with making vehicle collisions? I already got this addEventHandler("onClientVehicleCollision", root, function(collider) driver = getVehicleOccupant ( collider ) outputChatBox("You collided with " .. getPlayerName(driver), source) end ) But i want to know how to get this into server onPlayerWasted and make ** NICK(collider from onclientvehiclecollidtion) killed you ** Can someone help me?
-
Hi! I got about 600 maps on my server but they names are: [censured word] name... and i want to change it to [DD] name Is there any automatic way to do it?
-
i already did it but in still wont work
-
That's server side and i have that file in my meta
-
local function playerChat(message, messageType) if getElementData ( source, "tempdata.mute" ) == true then if messageType == 0 then cancelEvent() end end end addEventHandler("onPlayerChat", root, playerChat) it wont to hide the message, i tested and it should work. also this ownt work local function playerChat(message) cancelEvent() end addEventHandler("onPlayerChat", root, playerChat) why?