Jump to content

darhal

Members
  • Posts

    582
  • Joined

  • Last visited

Everything posted by darhal

  1. Wassim kifeh wala serverk actif stp 3awni ?
  2. darhal

    Group types

    elseif ( name == 'Police' ) then create3DText ( 'Police', { x, y, z }, { 0, 100, 255 }, { nil, true } ) local p = createElement ( "GodmodePed" ) setElementData ( p, "Model", 281 ) setElementData ( p, "Position", { x, y, z, rz } ) createBlip ( x, y, z, 61, 2, 255, 255, 255, 255, 0, 450 ) addEventHandler ( 'onMarkerHit', createMarker ( x, y, z - 1, 'cylinder', 2, 0, 0, 0, 0 ), function ( p ) if ( getElementType ( p ) == 'player' and not isPedInVehicle ( p ) and not isPedDead ( p ) ) then if ( getPlayerWantedLevel ( p ) > max_wanted.law ) then return exports['NGMessages']:sendClientMessage ( "The max wanted level for this job is "..tostring ( max_wanted.law )..".", p, 255, 0, 0 ) end if gang ~= "Gang" then outputChatBox ("hHAHAHA you're in gang group nab", source ) return end end )
  3. Can i get the link of those textures ?
  4. Hi I m trying to create those object : http://farm8.staticflickr.com/7120/6989 ... 83d9_b.jpg in mta but it show invalid object id bad usage @createObject why ? I think they are objects add by samp but I see servers in mta using those objects why invalid ID ?
  5. local connect = dbConnect ("sqlite", "file.db") function saveP () local x,y,z = getElementPosition (source) local pos = dbQuery (connect, "CREATE TABLE IF NOT EXISTS `position` (`x` float, `y` float, `z` float)") local query = dbQuery ( connect, "SELECT * FROM position") local result = dbPoll (query, -1) if (#result == 0) or not result or type(result) ~= "table" then local q = dbQuery (connect, "INSERT INTO `position` VALUES (?, ?, ?)", x, y, z) else local qq = dbQuery (connect, "UPDATE `position` SET `x`="..x..", `y`="..y..", `z`="..z) end end addEventHandler ("onPlayerQuit", getRootElement(), saveP) function loadP () local query = dbQuery ( connect, "SELECT * FROM position") local result = dbPoll (query, -1) for i,v in pairs (result) do setElementPosition (source, v.x, v.y, v.z) outputChatBox ("You have been wrapped to your last position.", soure, 255, 255, 255) end end addEventHandler ("onPlayerJoin", getRootElement(), loadP)
  6. ] local connect = dbConnect ("sqlite", "file.db") function saveP () local x,y,z = getElementPosition (source) local pos = dbQuery (connect, "CREATE TABLE IF NOT EXISTS `position` (`x` float, `y` float, `z` float)") local qres = dbPoll (pos, -1) if (#qres == 0) or not qres or type(qres) ~= "table" then local q = dbQuery (connect, "INSERT INTO `position` VALUES (?, ?, ?)", x, y, z) else local qq = dbQuery (connect, "UPDATE `position` SET `x`="..x..", `y`="..y..", `z`="..z) end end addEventHandler ("onPlayerQuit", getRootElement(), saveP) function loadP () local query = dbQuery ( connect, "SELECT * FROM position") local result = dbPoll (query, -1) for i,v in pairs (result) do setElementPosition (source, v.x, v.y, v.z) outputChatBox ("You have been wrapped to your last position.", soure, 255, 255, 255) end end addEventHandler ("onPlayerJoin", getRootElement(), loadP)
  7. You should connect the database and get the table result then you calculate it lenght using # if the lenght is 0 then there is no row aalso you can check if the table is nil or not if it s nil then there is no table in database
  8. This depend how you call the function and how is it the first argument which is thePlayer in your case anyway make sure that the passed argument is not number/table/string/number by doing this function(thePlayer) if type(thePlayer) == "string" or type(thePlayer) == "number" or type(thePlayer) == "table" or type(thePlayer) == "boolean" then return end if (getElementType(thePlayer)=="player") then --
  9. darhal

    delete

    function wh1() if source == GUIEditor_Button[20] then triggerServerEvent("wh1", localPlayer) end end addEventHandler ( "onClientGUIClick", root, wh1 ) Like this
  10. local connect = dbConnect ("sqlite", "file.db") function saveP () local x,y,z = getElementPosition (source) local pos = dbExec (connect, "CREATE TABLE IF NOT EXISTS `position` (`x` float, `y` float, `z` float)") if pos then local q = dbQuery (connect, "INSERT INTO `position` VALUES (?, ?, ?)", x, y, z) else local qq = dbQuery (connect, "UPDATE `position` SET x = "..x..", y = "..y..", z = "..z) end end addEventHandler ("onPlayerQuit", getRootElement(), saveP) function loadP () local query = dbQuery ( connect, "SELECT * FROM position") local result = dbPoll (query, - 1 ) for i , v in pairs(result) do setElementPosition (source, v.x, v.y, v.z) outputChatBox ("SUCCEEED") end end addEventHandler ("onPlayerJoin", getRootElement(), loadP)
  11. No it do lag and fps drops to arround 1 or 2 FPS but the first code that i post result in fame freeze
  12. OMG OMG i found the problem : why the texture load create inside a loop of table that conaint more than 300 index ? the solution is to load all textures one time ! the lag reduced and the problem solved thx all
  13. This wrong section ! Post here : viewforum.php?f=177
  14. Well thanks I edited my code and it works fine and the game freeze is massive lag now but I didint understand this part I use phooshop to edit textures is this function in photoshop ?
  15. darhal

    request

    viewtopic.php?f=108&t=87563
  16. You can edit it or just ask moderator for move
  17. The block that contain those functions is realy huge this is a part of it for k, v in pairs(zoneTable.objectsPositions) do if area then createdObjectAfterSave = createObject(v.model, v.x, v.y, v.z, v.rx, v.ry, v.rz) setElementCollisionsEnabled (createdObjectAfterSave, true) table.insert(currentZoneObjects, createdObjectAfterSave) --createdObjectAfterSave = currentZoneObjects[k] setObjectScale(createdObjectAfterSave, 1)--v.scale) setElementData(createdObjectAfterSave, "objectArea", area) if v.texture and getObjectTextureName(createdObjectAfterSave) then local myshader = dxCreateShader("material/effect.fx") local mytexture = dxCreateTexture(v.texture, "dxt3") dxSetShaderValue( myshader,"gTexture", mytexture) engineApplyShaderToWorldTexture( myshader, getObjectTextureName(createdObjectAfterSave), createdObjectAfterSave) texture[createdObjectAfterSave] = v.texture end if area then
  18. Only english here ?
  19. Exactly !, It fail to create Textures but what u mean by "creating too many of those once ?"
  20. Any pro in shaders ?
  21. darhal

    Help me!

    what u need exactly I didnt understand the problem ?
×
×
  • Create New...