-
Posts
107 -
Joined
-
Last visited
Everything posted by #Madara
-
debugscript ? and try this : x1=-357.10000610352 y1=1588.0999755859 z1=2683 function gotoloja(thePlayer) if getElementData(thePlayer, "loja") == false then --check if is in loja local x, y, z = getElementPosition(thePlayer) setElementPosition(thePlayer, x1, y1, z1) setElementData(thePlayer, "loja", true) -- set true else setElementPosition(thePlayer, x, y ,z) setElementData(thePlayer , "loja", false) -- set false end end addCommandHandler("loja",gotoloja)
-
DebugScript : ERROR: Server triggered clientside event addLogs, but event is not added clientside Client : addEventHandler("onClientResourceStart", resourceRoot, function() Window = guiCreateWindow(373, 189, 519, 426, "..: [ Chat Log v1.0 ] :..", false) guiWindowSetSizable(Window, false) guiSetAlpha(Window, 1.00) guiSetVisible(Window,false) GridList = guiCreateGridList(9, 24, 500, 392, false, Window) plrName = guiGridListAddColumn(GridList, "# Player Name :", 0.4) plrMsg = guiGridListAddColumn(GridList, "# Chat Message :", 0.4) end ) addEvent("INSERT!",true) addEventHandler("INSERT!",root, function(name , msg) guiGridListSetItemText (GridList,guiGridListAddRow ( GridList ), plrName,tostring(name), false, false ) guiGridListSetItemText (GridList,guiGridListAddRow ( GridList ), plrMsg,tostring(msg), false, false ) end ) local Key = "F5" bindKey(Key,"down", function () guiSetVisible( Window , not guiGetVisible(Window)) showCursor(guiGetVisible(Window)) end ) function addLogs(logs) for i, v in ipairs(logs) do guiGridListSetItemText(GridList, guiGridListAddRow(GridList), plrName, v.name, false, false) guiGridListSetItemText(GridList, guiGridListAddRow(GridList), plrMsg, v.message, false, false) end end addEvent("addLogs", true) addEventHandler("addLogs", root, addLogs) Server : addEventHandler("onResourceStart",root, function() executeSQLQuery("CREATE TABLE IF NOT EXISTS logs (name TEXT, message TEXT)") Load() end ) addEventHandler("onPlayerChat",root, function(msg,_) if ( msg ~= "") or ( msg ~= " ") then local name = getPlayerName(source) triggerClientEvent(source,"INSERT!",source,name,msg) executeSQLQuery("INSERT INTO logs (name, message) VALUES(?, ?)", getPlayerName(source), msg) end end ) function Load() local logs = executeSQLQuery("SELECT * FROM logs") if #logs > 0 then triggerClientEvent("addLogs", root, logs) end end
-
like this ? Client : addEventHandler("onClientResourceStart", resourceRoot, function() Window = guiCreateWindow(373, 189, 519, 426, "..: [ Chat Log v1.0 ] :..", false) guiWindowSetSizable(Window, false) guiSetAlpha(Window, 1.00) guiSetVisible(Window,false) GridList = guiCreateGridList(9, 24, 500, 392, false, Window) plrName = guiGridListAddColumn(GridList, "# Player Name :", 0.4) plrMsg = guiGridListAddColumn(GridList, "# Chat Message :", 0.4) end ) addEvent("INSERT!",true) addEventHandler("INSERT!",root, function(name , msg) guiGridListSetItemText (GridList,guiGridListAddRow ( GridList ), plrName,tostring(name), false, false ) guiGridListSetItemText (GridList,guiGridListAddRow ( GridList ), plrMsg,tostring(msg), false, false ) end ) local Key = "F5" bindKey(Key,"down", function () guiSetVisible( Window , not guiGetVisible(Window)) showCursor(guiGetVisible(Window)) end ) addEvent("Send",true) addEventHandler("Send",root, function(sql) for k , v in pairs (sql) then guiGridListSetItemText (GridList,guiGridListAddRow ( GridList ), plrName,tostring(v), false, false ) guiGridListSetItemText (GridList,guiGridListAddRow ( GridList ), plrMsg,tostring(v), false, false ) end ) Server : addEventHandler("onResourceStart",root, function() executeSQLQuery("CREATE TABLE IF NOT EXISTS logs (name TEXT, message TEXT)") Save() end ) addEventHandler('onResourceStop',root, function() Update() end ) addEventHandler("onPlayerChat",root, function(msg,_) if ( msg ~= "") or ( msg ~= " ") then local name = getPlayerName(source) triggerClientEvent(source,"INSERT!",source,name,msg) executeSQLQuery("INSERT INTO logs (name, message) VALUES(?, ?)", getPlayerName(source), msg) end end ) function Save() local Save = executeSQLQuery("SELECT * FROM logs") triggerClientEvent(client,'Send'client,Save) end function Update() executeSQLQuery('UPDATE `logs` SET message =? WHERE name =?',msg,name) end
-
can u give me example please ?
-
i should create a new table ?
-
yes and put them in grid list
-
ok now how i put what i save in sql in grid list ? Client : addEventHandler("onClientResourceStart", resourceRoot, function() Window = guiCreateWindow(373, 189, 519, 426, "..: [ Chat Log v1.0 ] :..", false) guiWindowSetSizable(Window, false) guiSetAlpha(Window, 1.00) guiSetVisible(Window,false) GridList = guiCreateGridList(9, 24, 500, 392, false, Window) plrName = guiGridListAddColumn(GridList, "# Player Name :", 0.4) plrMsg = guiGridListAddColumn(GridList, "# Chat Message :", 0.4) end ) addEvent("INSERT!",true) addEventHandler("INSERT!",root, function(name , msg) guiGridListSetItemText (GridList,guiGridListAddRow ( GridList ), plrName,tostring(name), false, false ) guiGridListSetItemText (GridList,guiGridListAddRow ( GridList ), plrMsg,tostring(msg), false, false ) end ) local Key = "F5" bindKey(Key,"down", function () guiSetVisible( Window , not guiGetVisible(Window)) showCursor(guiGetVisible(Window)) end ) Server : addEventHandler("onResourceStart",root, function() executeSQLQuery("CREATE TABLE IF NOT EXISTS logs (name TEXT, message TEXT)") end ) addEventHandler("onPlayerChat",root, function(msg,_) if ( msg ~= "") or ( msg ~= " ") then local name = getPlayerName(source) triggerClientEvent(source,"INSERT!",source,name,msg) executeSQLQuery("INSERT INTO logs (name, message) VALUES(?, ?)", getPlayerName(source), msg) end end )
-
Anyone can explain to me how i save the log with sql ?
-
Hi guys , Today I made Chat Log and i want to save the Log ( Text ) in the grid list when resource start or stop how i save that with using executeSQLQuery ? i need examples please because i want to learn how to connect sql with gridlist .
-
it's not work, marker not created you put position x,y,z ? in local Marker[1] = createMarker (x,y,x,"cylinder",255,0, 0,255)
-
Try This : Marker {} local Marker[1] = createMarker (x,y,x,"cylinder",255,0, 0,255) Veh {} function spawmvehicle(thePlayer) if isElement(Veh[thePlayer]) then return end local px,py,pz = getElementPosition(thePlayer) Veh[thePlayer] = createVehicle(id, px, py, pz) end addEventHandler("onMarkerHit", Marker[1], spawmvehicle) addEventHandler("onVehicleExit",root, function() if ( source == Veh[thePlayer] ) then setTimer(destroyElement,10000,1,Veh[thePlayer]) end end )
-
but i want to make new because i can't edit this anyone can give me functions ?
-
How i make if anyone click image he play gamemode race and if anyone click the anthore image he play deathmatch gamemode ?
-
السلام عليكم ورحمة الله وبركاته أنا ناوي اشتري خادم من أستضافة حق افتح لي عليه سيرفرات ام تي اي فيه استضافات كثيرة تبيع خوادم , أي استضافة تنصحوني أخد منها ؟
-
حذف الرتبة : "onClientGUIClick" triggerServerEvent aclGetGroup aclGroupRemoveObject استرجاع الرتبة : addCommandHandler aclGetGroup aclGroupAddObject
-
this is command but i want from Admin panel
-
Hi guys How i make this script ? if anyone will ban a anyone in Console ACL the who will ban get ban and if anyone will kick anyone in Console ACL the who will kick get kick