Stranger
Members-
Posts
710 -
Joined
-
Last visited
Everything posted by Stranger
-
but there is a problem, why in the database if i change the colors of the vehicle, like: 255, 0, 0 it shows on the database like this 3, 0, 0, and if i change it to 0, 255, 0 it shows like: 65, 0, 0 i don't know why !!!
-
hello , i'm working on vehicle shop so i'm trying to make when the vehicle get destroyed the color of the vehicle saved on the sql when i do the UPDATE in the sql so it shows on the database in the color's column the price of the vehicle at each one of the column i've tried so many ways but not one of those ways works with me, so help here is the code: executeSQLQuery ("UPDATE `Vehs` SET `ColorR` = ?, `ColorG` = ?, `ColorB` = ?, `cost` = ? WHERE `Account` = ? AND `Model` = ?", r, g, b, cost, getPlayerAccount (source), id) i guess the problem only here so,
-
try this: local x,y = guiGetScreenSize () addEventHandler ("onClientRender", root, function (source) local pVehicle = getPedOccupiedVehicle (localPlayer) if pVehicle then local vHealth = (getElementHealth (pVehicle)-250)/10 if vHealth >= 0 then dxDrawLine (x/1.05, y/2.1, x/1.05, y/4, tocolor (255, 255, 255)) -- HOR dxDrawLine (x/1.125, y/2.1, x/1.125, y/4, tocolor (255, 255, 255)) -- HOR dxDrawLine (x/1.05, y/2.1, x/1.125, y/2.1, tocolor (255, 255, 255)) -- VER dxDrawLine (x/1.05, y/3.5, x/1.125, y/3.5, tocolor (255, 255, 255)) -- VER dxDrawRectangle (x/1.124, y/2.1,x/15.795, y/-3.97*vHealth/100, tocolor (0, 255, 0, 200)) -- GREEN ARENA end end end )
-
solved. i used this -- By hassan.ksa function toboolean(str) if ( str and type(str) == "string" ) then if ( str == "true" ) then return true else return false end end end really useful.
-
hi there, i'm tring to make when someone click on the checkbox, if it's true it saves in the xml 'true' if it's false it saves in the xml 'false' but i got this error: client.lua:154: Bad argument @ 'guiCheckBoxSetSelected' [Expected bool at argument 2, got string 'true'] this error shows when i start the mode. addEventHandler("onClientResourceStart",resourceRoot, function ( ) local state = loadSettingsFromXML() guiCheckBoxSetSelected (save2, state) end ) so help please.
-
oh thanks, but i've seen some meta have a protect option on it, why is that ?
-
thanks, but there is an option named 'cache' this make it unable to be downloaded, so the protect option is using for another thing which i don't know what is it. thank you for answering. so , any other answers ?
-
Hi guyes i have a question which is, what does 'download="true"' do ? and what does 'protected="true"' do ?
-
hi, i have a little problem, i have make it a grid list and make it save the text on it so, it's work fine but i want to make it save the player name too, but no it's only save the text but the name shows like this 'userdata: 0x1119b' i don't know what is the problem. Server side: -- export function function addLog (plrName, text) setSQL_Data (plrName, text) for k,v in ipairs (getElementsByType ("player")) do triggerClientEvent (v, "addServerLog", v, plrName, text) end end Client side: addEvent ( "addTheLog", true ) addEventHandler ( "addTheLog", root,function ( onClientSqlList ) guiGridListClear ( grid ) for _, v in ipairs ( onClientSqlList ) do row = guiGridListAddRow ( grid ) guiGridListSetItemText (grid, row, 1, "" .. tostring(v.plr) .. " " .. tostring ( v.log ), false, false ) guiGridListSetItemColor (grid, row, 1, 0, 255, 0) end end ) so help please.
-
this is solidsnake's code, and he already put it but not working.
-
Help please. NOTE: the save system is work but if zombie killed me all the weapon gone, i don't know why. i've tried anything but nothing change.
-
hey i have a question, why when i mute player, and restart the admin panel the mute will be gone ? i don't know why.
-
try this: blips = { } function createBlips() local players = getElementsByType ( "player" ) for k,v in ipairs(players) do if isElement (blips[v]) then destroyElement (blips[v]) blips[v] = nil end local r,g,b,a = getTeamColor(getPlayerTeam(v)) blips[v] = createBlipAttachedTo(v,0,2,r,g,b,a,0,99999.0, root) end end setTimer(createBlips,500,0) function destroyer() if isElement (blips[source]) then destroyElement (blips[source]) blips[source] = nil end end addEventHandler("onPlayerQuit",root,destroyer)
-
yea now it's work, but still not save after the restart.
-
i got this error: 28: dbExec failed; (1) no such column: value
-
no problem. ------------ any help please.
-
Thank you Anubhav. so i have a problem here Client side: local screenW, screenH = guiGetScreenSize() win = guiCreateWindow((screenW - 363) / 2, (screenH - 336) / 2, 363, 336, "Save Text", false) guiWindowSetSizable(win, false) guiSetAlpha(win, 1.00) guiSetVisible (win, false) txt = guiCreateMemo(9, 26, 344, 261, "", false, win) sv = guiCreateButton(9, 294, 173, 32, "Save", false, win) guiSetProperty(sv, "NormalTextColour", "FFAAAAAA") cl = guiCreateButton(182, 294, 172, 32, "Close", false, win) guiSetProperty(cl, "NormalTextColour", "FFAAAAAA") bindKey ("o", "down", function () if getPlayerSerial (localPlayer) == "------------" then guiSetVisible (win, not guiGetVisible (win)) showCursor (guiGetVisible (win)) guiSetInputEnabled (guiGetVisible (win)) triggerServerEvent ("checkIt", localPlayer) end end) function sendDetails() local text = guiGetText(txt) triggerServerEvent("onSaveTheText",localPlayer,text) end addEventHandler ("onClientResourceStart", resourceRoot, function () triggerServerEvent ("makeIt", localPlayer) end) addEvent("savedData",true) function savedDatae(queryer, poll, answer) guiSetText(txt,answer) end addEventHandler("savedData",root,savedDatae) addEventHandler ("onClientGUIClick", root, function () if (source == sv) then sendDetails () end if (source == cl) then guiSetVisible (win, false) showCursor (guiGetVisible (win)) guiSetInputEnabled (guiGetVisible (win)) end end) addEvent ("onStartAddIt", true) addEventHandler ("onStartAddIt", root, function (answer) guiSetText(txt,tostring(answer)) end ) Server side: local data = {} con = dbConnect("sqlite",":/saver.db") local tableSaver = {} addEvent ("makeIt", true) addEventHandler("makeIt",root, function () dbExec(con,"CREATE TABLE IF NOT EXISTS data(text)") local queryer = dbQuery(con,"SELECT * FROM data") local poll = dbPoll(queryer,-1) if poll and queryer then local answer = tostring(poll[1]) if getPlayerSerial (source) == "-------------" then triggerClientEvent(source, "savedData", source, queryer, poll, answer) end end end ) addEvent("onSaveTheText",true) addEventHandler("onSaveTheText", root, function(text) tableSaver[1] = text dbExec(con,"UPDATE data SET text=?",text) end ) addEvent ("checkIt", true) addEventHandler ("checkIt", root, function () local answer = tableSaver[1] dbExec(con,"UPDATE data SET text=?",tostring(answer)) triggerClientEvent (source, "onStartAddIt", source,answer) end ) it's saves, but if i restart the resource the message in the memo change to "nil" i don't know where is the problem, so help.