Jump to content

#Al-Ha[J]aRii

Members
  • Posts

    482
  • Joined

  • Last visited

Everything posted by #Al-Ha[J]aRii

  1. Client : ------------------------------------------------------- addEventHandler("onClientGUIClick",root, function() if ( source == vote) then triggerServerEvent("gResults",gPlayer) --- i make it gPlayer for i made ( local gPlayer == getLocalPlayer() ) end end ) --------------------------------------------------------- local Key = "F5" bindKey(Key,"down", function () guiSetVisible( wnd , not guiGetVisible(wnd)) showCursor(guiGetVisible(wnd)) triggerServerEvent("AreYouOpen?",gPlayer) end end ) ------------------------------------------------------------- addEvent ( "returnTableContent", true ) addEventHandler ( "returnTableContent", root, function ( content ) for _, text in ipairs ( content ) do -- Loop the items from the 'content' table sent from the server side. guiGridListSetItemText ( GridList, guiGridListAddRow ( GridList ), 1, text, false, false ) -- Add it to the gridlist. end end ) Server : name = { "Alone", "BH", "KSA" } addEvent ( "getTableContent", true ) addEventHandler ( "getTableContent", root, function ( ) triggerClientEvent ( client, "returnTableContent", client, name ) -- Send the 'myTable' content to the client side. end ) local root = getRootElement() addEventHandler('onResourceStart',resourceRoot, function () local Tabel = executeSQLQuery("CREATE TABLE IF NOT EXISTS xAlhajarii ( name )") if ( Tabel ) then outputDebugString( "Create Table xAlhajarii done") end end end ) ------------------------------------------------------------------------------------------------------------ function Results() local Results = executeSQLQuery("SELECT * FROM `xAlhajarii` WHERE PlayerName=?",getPlayerName ( name ) ) if ( Results == "table" and #Results == 0 or not Results ) then executeSQLQuery ( "INSERT INTO `xAlhajarii` ( PlayerName ) VALUES(?,?,?,?)",getPlayerName(name)) else executeSQLQuery('UPDATE `xAlhajarii` SET PlayerName =?',getPlayerName(name)) end end addEvent("gResults",true) addEventHandler("gResults",root,Results) ------------------------------------------------------------------------------------------------------------------ addEvent("AreYouOpen?",true) addEventHandler("AreYouOpen?",root, function() Results() end) ?
  2. so I wil put results in event PlayerJoin ? and take it when player open the gui window with the bindkey trigger to results ? Insert the results when a player press the button and get the results when a player show a gui . Server : function Results() local Results = executeSQLQuery("SELECT * FROM `xAlhajarii` WHERE PlayerName=?",getPlayerName ( name ) ) if ( Results == "table" and #Results == 0 or not Results ) then executeSQLQuery ( "INSERT INTO `xAlhajarii` ( PlayerName ) VALUES(?,?,?,?)",getPlayerName(name)) else executeSQLQuery('UPDATE `xAlhajarii` SET PlayerName =?',getPlayerName(name)) end end addEvent("gResults",true) addEventHandler("gResults",root,Results) ------------------------------------------------------------------------------------------------------------------ addEvent("AreYouOpen?",true) addEventHandler("AreYouOpen?",root, function() Results() end Client : name = { "Alone", "BH", "KSA" } addEventHandler("onClientGUIClick",root, function() if ( source == vote) then triggerServerEvent("gResults",gPlayer) --- i make it gPlayer for i made ( local gPlayer == getLocalPlayer() ) end end ) --------------------------------------------------------- bindKey(Key,"down", function () guiSetVisible( wnd , not guiGetVisible(wnd)) showCursor(guiGetVisible(wnd)) triggerServerEvent("AreYouOpen?",gPlayer) end end ) ? how I wil trigger table name from client to server ?
  3. so I wil put results in event PlayerJoin ? and take it when player open the gui window with the bindkey trigger to results ?
  4. is getPlayerName work because I want name put in grid list thos name's in table name = { "Alone", "BH", "KSA" } addEventHandler('onResourceStart',resourceRoot, function () local Tabel = executeSQLQuery("CREATE TABLE IF NOT EXISTS xAlhajarii ( name)") if ( Tabel ) then outputDebugString( "Create Table xAlhajarii done") local Results = executeSQLQuery("SELECT * FROM `xAlhajarii` WHERE PlayerName=?",name ) if ( Results == "table" and #Results == 0 or not Results ) then executeSQLQuery ( "INSERT INTO `xAlhajarii` ( PlayerName ) VALUES(?,?,?,?)",name) else executeSQLQuery('UPDATE `xAlhajarii` SET PlayerName =?',name) triggerClientEvent ("CallSQLPUT", getRootElement()) end end end )
  5. yea I know . put my proplem how wil put the table sql into grid list . triggerClientEvent guiGridListSetItemText it's be with xml folder when I put name in him ??
  6. yea I know . put my proplem how wil put the table sql into grid list .
  7. how I wil use this with sql lite im suck with gridlist this is Image for the mode im trying to make it's help please. ------------------------------------- how did I wil put the player name that's one I want to know it's !
  8. كيف تبي القيم مود بعطيك الي تحتاجهم
  9. PrestegeDB = dbConnect( "sqlite", ":aResource/PrestegeDB.db" ) انشاء ملف اسمه PrestegeDB.db ?
  10. يسلمو شرح وافي وكافي ~ بس ويش كل وحده من هذلين MY SQL يسوون dbConnect dbExec dbQuery dbPoll dbFree
  11. طيب بعدين شلون بسوي هذلين كود ممكن مثال
  12. قصدك function(playerAccount,playerPassword,playerSerial) executeSQLQuery("CREATE TABLE IF NOT EXISTS Alhajarii (Column1 TEXT, Column2 TEXT, Column3 TEXT)") executeSQLQuery("INSERT INTO Alhajarii(acc,pass,serial) VALUES(?,?,?)", playerAccount, playerPassword, playerSerial )
  13. طيب صح اسوي كذا لحفظ حساب executeSQLQuery("INSERT INTO `Alhajarii`(`Account`,`Password`,`Serial`) VALUES(?,?,?)", AlhajariiAccount, AlhajariiPassword, AlhajariiSerial )
  14. ذذ قصدي لين اسوي جدول في السكل executeSQLQuery("CREATE TABLE IF NOT EXISTS Alhajarii (Column1 TEXT, Column2 TEXT,Column3 TEXT)") مايقول يبي playerName + يحتاج اسوي فوقها كذا ذذ { { colname1=value1, colname2=value2, ... }, { colname1=value3, colname2=value4, ... }, ... }
  15. شرط اسويهم لان لين اسوي جدول في السكل لايت مايطلب هذه الاشياء
  16. ليش بعض SQL Lite executeSQLQuery("INSERT INTO `players`(`name`,`color`,`sound`) VALUES(?,?,?)", playerName, colorName, soundName ) اشوف حاط playerName , colorName , soundName أنا فهمت شرح تيتي لاكن هذه الي مافهمتها في الاسكل لايت
  17. ah ..... thank you bro . I was saw in the code setElementSpeed there was getElementSpeed speed = tonumber(speed) local acSpeed = getElementSpeed(element, unit)
  18. hi guys ...... what the damn wrong with this code im trying to take a vehicle move alone with speed 60 function setElementSpeed(element, unit, speed) -- only work if element is moving! if (unit == nil) then unit = 0 end if (speed == nil) then speed = 0 end speed = tonumber(speed) local acSpeed = getElementSpeed(element, unit) if (acSpeed~=false) then -- if true - element is valid, no need to check again local diff = speed/acSpeed local x,y,z = getElementVelocity(element) setElementVelocity(element,x*diff,y*diff,z*diff) return true end return false end -------------- let's make car move alone function M() local veh = getPedOccupiedVehicle(localPlayer) local acSpeed = getElementSpeed(veh, tonumber(0)) if (veh) and (acSpeed) then setElementSpeed(veh,"kph",tonumber(60)) ---- set speed 60 end end addEventHandler("onClientRender",getRootElement(),M) addEventHandler("onClientVehicleEnter",root,M)
  19. كنت آفــــــكره يبي كذآ ذذ ~~
  20. تم شوف وتئكد انها صح او خطئ bool outputChatBox () bool cancelEvent () int getPlayerWantedLevel ( ) local chatRadius = 20 function sendMessageToNearbyPlayers( message, messageType ) if messageType == 0 then local posX, posY, posZ = getElementPosition( source ) local nearbyPlayers = getElementsWithinColShape( chatSphere, "player" ) destroyElement( chatSphere ) for index, nearbyPlayer in ipairs( nearbyPlayers ) do outputChatBox( message, nearbyPlayer ) end end end local players = getElementsByType ( "player" for theKey,thePlayer in ipairs(players) do local level = getPlayerWantedLevel ( thePlayer ) if ( level > 0 ) then end end addEventHandler ( "onClientPlayerDamage", getRootElement(), cancelEvent ) كـودك ماليه أي معنى ! Edit : Server : local root = getRootElement() function chatbox( text, msgtype) local name = getPlayerName(source) local players = getElementsByType ( "player" ) for _,v in ipairs(players) do local Wanted = getPlayerWantedLevel(v) cancelEvent(true) outputChatBox("[ " ..Wanted.." ] " .. name .. ":#FFFFFF " .. text, root, 255, 255, 255, true) end end addEventHandler("onPlayerChat",root,chatbox)
×
×
  • Create New...