-
Posts
1,411 -
Joined
-
Last visited
-
Days Won
2
Everything posted by WASSIm.
-
thank you its working. can you help me on this. sry i am new to SQL :104: Bad argument @ 'dbExec' [Expected db-connection at argument 1] function setPlayerZombieKill(thePlayer, theZKill) local handler = connection if (isElement(thePlayer) and getElementType(thePlayer) == "player") then account = getPlayerAccount(thePlayer) else account = thePlayer end if (not account or isGuestAccount(account)) then return false end local accountName = getAccountName(account) if dbExec( handler, "UPDATE zkills SET zkill = '" .. tonumber(theZKill) .. "' WHERE accountName = '" .. tostring(accountName) .."'" ) then return true else return false end end
-
i have other problem. he is show me this 84: dbExec failed; (1) near "turfColorG": syntax error function setTurfColor ( turfID, r, g, b ) if ( not doesTurfExist ( turfID ) ) then return false, "This turf does not exists." end local handler = connection if ( not handler ) then return false, "Couldn't connect to SQLite database." end return dbExec( handler, "UPDATE turfs SET turfColorR = '".. tostring ( r ) .."' turfColorG = '".. tostring ( g ) .."' turfColorB = '".. tostring ( b ) .."' WHERE turf = '" .. tostring ( turfID ) .."'" ) end
-
hi guys i have problem with sql its show me this. plis help 5: dbExec failed; (1) duplicate column name: turfid addEventHandler ( "onResourceStart", resourceRoot, function ( ) connection = dbConnect( "sqlite", "turfs.db" ) if ( connection )then dbExec ( connection, "CREATE TABLE IF NOT EXISTS turfs (turfID INTEGER PRIMARY KEY NOT NULL, turfid TEXT, turfowner INT, x INT, y INT, sizex INT, sizey INT, r INT, g INT, b INT)" ) outputDebugString ( "Successfully connected to turfs.db" ) else outputDebugString ( "Failed to connect to turfs.db", 3 ) end end )
-
but its working in swat tank shot minigun and i can kill players
-
i use like this. but its before i make script swat tank shot minigun and i lost that script Client Server
-
but weapon created and all player can see
-
storing the weapon elements ?
-
i testing script with functions weapons server side
-
hi guys i want make functions weapon server side like createWeapon and setWeaponOwner... but have problem Client Server this Test Exmple (Server side) function createMinigunWeapon(player) local x, y, z = getElementPosition(player) local weapon = createWeapon("minigun", x, y, z + 1) setWeaponClipAmmo ( weapon,99999) setWeaponState ( weapon,"firing") end addCommandHandler("createminigun", createMinigunWeapon) tell me in debug:
-
lol me too looking for a host but i don't get one : /
-
you want if click car id 523 or 598 or 596 or 597 or 599 and you in team police will give a weapon ? function onVehicleClick ( button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement ) if ( clickedElement ) and ( clickedElement == getElementType ( "vehicle" ) )then if ( getElementModel == (523 or 598 or 596 or 597 or 599) ) then local playerTeam = getPlayerTeam ( source ) if ( playerTeam ) and ( getTeamName ( playerTeam ) == "Police" ) then giveWeapon ( thePlayer, 23, 200 ) end end end end addEventHandler ( "onClientClick", getRootElement(), onVehicleClick )
-
function onVehicleClick ( button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement ) if ( clickedElement ) and ( clickedElement == getElementType ( "vehicle" ) )then end end addEventHandler ( "onClientClick", getRootElement(), onVehicleClick )
-
hi all. i have this radar but he is circle i want change it rectangle local sx,sy = guiGetScreenSize() local enablePlayerRadar = false local posx = sy * 0.05 local posy = sy * 0.725 local height = sy * 0.225 local centerleft = posx + height / 2 local centertop = posy + height / 2 local blipsize = height / 16 local lpsize = height / 8 local range = 100 local scale = (sx/1440)*0.9 local lp = getLocalPlayer() function findRotation(x1,y1,x2,y2) local t = -math.deg(math.atan2(x2-x1,y2-y1)) if t < 0 then t = t + 360 end return t end function getDistanceRotation(x, y, dist, angle) local a = math.rad(90 - angle) local dx = math.cos(a) * dist local dy = math.sin(a) * dist return x+dx, y+dy end addEventHandler( "onClientResourceStart", getResourceRootElement(getThisResource()), function ( ) setPlayerHudComponentVisible ( "radar", true ) end ) addEventHandler("onClientRender", getRootElement(), function() if ( enablePlayerRadar ) then local px, py, pz = getElementPosition(lp) local _,_,pr = getElementRotation(lp) local attach = getElementAttachedTo (lp) local cx,cy,_,tx,ty = getCameraMatrix() local north = findRotation(cx,cy,tx,ty) dxDrawImage(posx,posy,height,height, "north.png", north) dxDrawImage(posx,posy,height,height, "radar.png") for id, blip in ipairs(getElementsByType("blip")) do if blip then --not getAttachedElements( localPlayer ) == blip local bx, by, bz = getElementPosition(blip) local dist = getDistanceBetweenPoints2D(px,py,bx,by) if dist > range then dist = tonumber(range) end local angle = 180-north + findRotation(px,py,bx,by) local cblipx, cblipy = getDistanceRotation(0, 0, height*(dist/range)/2, angle) local blipx = centerleft+cblipx-blipsize/2 local blipy = centertop+cblipy-blipsize/2 local yoff = 0 local r,b,g,a = getBlipColor ( blip ) local id = getBlipIcon ( blip ) local size = getBlipSize ( blip ) local distb = getBlipVisibleDistance ( blip ) if dist < distb then if id == 0 then if (bz - pz) >= 5 then img = "0-up.png" elseif (bz - pz) <= -5 then img = "0-down.png" else img = "0.png" end else img = ""..id..".png" r,b,g,a = 255,255,255,255 end end dxDrawImage(blipx - size, blipy - size, blipsize + size, blipsize + size, ":server/images/hud/blips/"..img.."", 0, 0, 0, tocolor(r,b,g,a)) if not blipnorth then blipnorth = createBlip(0, 60000, 0, 4) end end end dxDrawImage(centerleft - lpsize/2, centertop - lpsize/2, lpsize,lpsize, ":server/images/hud/blips/2.png", north-pr, 0, 0, tocolor(255,255,255,255)) end end )
-
DxDrawImageSection read Optional Arguments