-
Posts
582 -
Joined
-
Last visited
Everything posted by darhal
-
Wassim kifeh wala serverk actif stp 3awni ?
-
hhhhhhhhhh Markeloff
-
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 )
-
Can i get the link of those textures ?
-
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 ?
-
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)
-
] 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)
-
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
-
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 --
-
yes it get the hole table
-
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)
-
No it do lag and fps drops to arround 1 or 2 FPS but the first code that i post result in fame freeze
-
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
-
This wrong section ! Post here : viewforum.php?f=177
-
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 ?
-
You can edit it or just ask moderator for move
-
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
-
Exactly !, It fail to create Textures but what u mean by "creating too many of those once ?"
-
what u need exactly I didnt understand the problem ?