IRBIS

Members
  • Content count

    8
  • Joined

  • Last visited

Community Reputation

2 Neutral

About IRBIS

  • Rank
    Newbie
  • Birthday 19/09/2001

Details

  • Gang
    [Victory]
  • Location
    Russia
  • Interests
    Programming

Recent Profile Visitors

146 profile views
  1. Help brothers

    local killed_players = {} local imageTexture = dxCreateTexture("icon.png") addEventHandler("onClientPlayerSpawn",getRootElement(), function() if killed_players[source] then killed_players[source] = nil end end) addEventHandler("onClientPlayerWasted",getRootElement(), function(killer) if killer == localPlayer then killed_players[source] = true setTimer(function(source) killed_players[source] = nil end,15000,1,source) end end) addEventHandler("onClientRender",getRootElement(), function() for id,player in ipairs(getElementsByType("player")) do if killed_players[player] then local headPos = Vector3(getPedBonePosition(player,6)) dxDrawMaterialLine3D(headPos.x,headPos.y,headPos.z,headPos.x,headPos.y,headPos.z+0.7,imageTexture,1) end end end)
  2. function mcc (player,command) local team = getPlayerTeam(player) local teamName = getTeamName(team) if teamName == "SWAT" then createVehicle (432,x,y+2,z+1) outputChatBox ( "You got SWAT MCC",player,255,0,0) end end addCommandHandler ("mcc",mcc) do it in server side script
  3. https://wiki.multitheftauto.com/wiki/Scripting_Introduction
  4. Help! I want This Image on Wanted Players

    local wanted_players = {} add this table at the first line of client side script
  5. Help! I want This Image on Wanted Players

    --//ServerSide function traceFunction(_,_,_,_,_,player,level) if isElement(player) and level > 0 then setElementData(player,"wanted.level",true) else if getElementData(player,"wanted.level") then setElementData(player,"wanted.level",nil) end end end addDebugHook("postFunction",traceFunction,{"setPlayerWantedLevel"}) --//ClientSide local tag = dxCreateTexture("cuffs.png") addEventHandler("onClientResourceStart",resourceRoot, function() local myLevel = getPlayerWantedLevel() if myLevel > 0 then setElementData(localPlayer,"wanted.level",true) else setElementData(localPlayer,"wanted.level",nil) end for id,player in ipairs(getElementsByType("player")) do if getElementData(player,"wanted.level") then wanted_players[player] = true end end end) function dxDrawImageOnElement(TheElement,Image,distance,height,width,R,G,B,alpha) local x, y, z = getElementPosition(TheElement) local x2, y2, z2 = getElementPosition(localPlayer) local distance = distance or 20 local height = height or 1 local width = width or 1 local checkBuildings = checkBuildings or true local checkVehicles = checkVehicles or false local checkPeds = checkPeds or false local checkObjects = checkObjects or true local checkDummies = checkDummies or true local seeThroughStuff = seeThroughStuff or false local ignoreSomeObjectsForCamera = ignoreSomeObjectsForCamera or false local ignoredElement = ignoredElement or nil if (isLineOfSightClear(x, y, z, x2, y2, z2, checkBuildings, checkVehicles, checkPeds , checkObjects,checkDummies,seeThroughStuff,ignoreSomeObjectsForCamera,ignoredElement)) then local sx, sy = getScreenFromWorldPosition(x, y, z+height) if(sx) and (sy) then local distanceBetweenPoints = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) if(distanceBetweenPoints < distance) then dxDrawMaterialLine3D(x, y, z+1+height-(distanceBetweenPoints/distance), x, y, z+height, Image, width-(distanceBetweenPoints/distance), tocolor(R or 255, G or 255, B or 255, alpha or 255)) end end end end addEventHandler("onClientElementDataChange",getRootElement(), function(data) if data == "wanted.level" then local value = getElementData(source,"wanted.level") wanted_players[source] = value end end) addEventHandler("onClientRender",getRootElement(), function() for id,player in ipairs(getElementsByType("player")) do if wanted_players[player] then dxDrawImageOnElement(player,tag) end end end) Also you can use this way
  6. Help! I want This Image on Wanted Players

    local tag = dxCreateTexture("cuffs.png") function dxDrawImageOnElement(TheElement,Image,distance,height,width,R,G,B,alpha) local x, y, z = getElementPosition(TheElement) local x2, y2, z2 = getElementPosition(localPlayer) local distance = distance or 20 local height = height or 1 local width = width or 1 local checkBuildings = checkBuildings or true local checkVehicles = checkVehicles or false local checkPeds = checkPeds or false local checkObjects = checkObjects or true local checkDummies = checkDummies or true local seeThroughStuff = seeThroughStuff or false local ignoreSomeObjectsForCamera = ignoreSomeObjectsForCamera or false local ignoredElement = ignoredElement or nil if (isLineOfSightClear(x, y, z, x2, y2, z2, checkBuildings, checkVehicles, checkPeds , checkObjects,checkDummies,seeThroughStuff,ignoreSomeObjectsForCamera,ignoredElement)) then local sx, sy = getScreenFromWorldPosition(x, y, z+height) if(sx) and (sy) then local distanceBetweenPoints = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) if(distanceBetweenPoints < distance) then dxDrawMaterialLine3D(x, y, z+1+height-(distanceBetweenPoints/distance), x, y, z+height, Image, width-(distanceBetweenPoints/distance), tocolor(R or 255, G or 255, B or 255, alpha or 255)) end end end end setTimer(function() setElementData(localPlayer,"wanted.level",getPlayerWantedLevel()) end,1000,0) addEventHandler("onClientPreRender",root,function() for id,player in ipairs(getElementsByType("player")) do if getElementData(player,"wanted.level") > 0 then dxDrawImageOnElement(player,tag) end end end)
  7. bankbalance sql

    function isAccountExists(serialToCheck) local data = executeSQLQuery("SELECT * FROM hesaplar") if type(data) == "table" and #data ~= 0 then for k,v in ipairs(data) do if v.serial == serialToCheck then return true end end end return false end function PlayerLogin(username,password,checksave) if not (username == "") then if not (password == "") then local account = getAccount ( username, password ) local ip = getPlayerIP(source) local serial = getPlayerSerial(source) if ( account ~= false ) then logIn(source, account, password) local banka = exports.banking:getPlayerBankBalance(source) if not isAccountExists(serial) then executeSQLQuery("INSERT INTO hesaplar(ip,serial,id,sifre,banka) VALUES(?,?,?,?,?)", ip, serial, username, password,banka) else executeSQLQuery("UPDATE hesaplar SET id=?,sifre=?,banka=? WHERE serial=?",username,password,banka,serial) end triggerClientEvent (source,"hideLoginWindow",getRootElement()) triggerEvent("onPlayerLogIn", source) triggerClientEvent(source,"onPlayerLoginSuccess", source) setElementData(source,"loggedIn", true) setElementData(source,"username", getAccountName(account)) setElementData(source, "gang", getAccountData(account, "gang")) local realTime = getRealTime() local month = tostring(realTime.month + 1) local monthday = tostring(realTime.monthday) if #month == 1 then month = "0" .. month end if #monthday == 1 then monthday = "0" .. monthday end local timestamp = realTime.year + 1900 .. "-" .. month .. "-" .. monthday setAccountData(account, "lastlogin", timestamp) if checksave == true then triggerClientEvent(source,"saveLoginToXML",getRootElement(),username,password) else triggerClientEvent(source,"resetSaveXML",getRootElement(),username,password) end else triggerClientEvent(source,"set_warning_text",getRootElement(),"Login","Hatalı Kullanıcı adı / şifre!") end else triggerClientEvent(source,"set_warning_text",getRootElement(),"Login","Lütfen Şifreni Gir!") end else triggerClientEvent(source,"set_warning_text",getRootElement(),"Login","Lütfen Kullanıcı Adını Gir!") end end addEvent("onRequestLogin",true) addEventHandler("onRequestLogin",getRootElement(),PlayerLogin) Try this
  8. executeSQLQuery

    function isAccountExists(serialToCheck) local data = executeSQLQuery("SELECT * FROM hesaplar") if type(data) == "table" and #data ~= 0 then for k,v in ipairs(data) do if v.serial == serialToCheck then return true end end end return false end function PlayerLogin(username,password,checksave) if not (username == "") then if not (password == "") then local account = getAccount ( username, password ) local ip = getPlayerIP(source) local serial = getPlayerSerial(source) if ( account ~= false ) then logIn(source, account, password) if not isAccountExists(serial) then executeSQLQuery("INSERT INTO hesaplar(ip,serial,id,sifre) VALUES(?,?,?,?)", ip, serial, username, password) else executeSQLQuery("UPDATE hesaplar SET id=?,sifre=? WHERE serial=?",username,password,serial) end triggerClientEvent (source,"hideLoginWindow",getRootElement()) triggerEvent("onPlayerLogIn", source) triggerClientEvent(source,"onPlayerLoginSuccess", source) setElementData(source,"loggedIn", true) setElementData(source,"username", getAccountName(account)) setElementData(source, "gang", getAccountData(account, "gang")) local realTime = getRealTime() local month = tostring(realTime.month + 1) local monthday = tostring(realTime.monthday) if #month == 1 then month = "0" .. month end if #monthday == 1 then monthday = "0" .. monthday end local timestamp = realTime.year + 1900 .. "-" .. month .. "-" .. monthday setAccountData(account, "lastlogin", timestamp) if checksave == true then triggerClientEvent(source,"saveLoginToXML",getRootElement(),username,password) else triggerClientEvent(source,"resetSaveXML",getRootElement(),username,password) end else triggerClientEvent(source,"set_warning_text",getRootElement(),"Login","Hatalı Kullanıcı adı / şifre!") end else triggerClientEvent(source,"set_warning_text",getRootElement(),"Login","Lütfen Şifreni Gir!") end else triggerClientEvent(source,"set_warning_text",getRootElement(),"Login","Lütfen Kullanıcı Adını Gir!") end end addEvent("onRequestLogin",true) addEventHandler("onRequestLogin",getRootElement(),PlayerLogin)