Jump to content

laserlaser

Members
  • Posts

    92
  • Joined

  • Last visited

Everything posted by laserlaser

  1. Why, i use this.and it work.
  2. Try; chat_range=100 addEventHandler("onPlayerJoin",getRootElement(), function () bindKey(source,"L","down","chatbox","Local") end) addEventHandler("onResourceStart",getResourceRootElement(getThisResource()), function () for index, player in pairs(getElementsByType("player")) do bindKey(player,"L","down","chatbox","Local") end end) function isPlayerInRangeOfPoint(player,x,y,z,range) local px,py,pz=getElementPosition(player) return ((x-px)^2+(y-py)^2+(z-pz)^2)^0.5<=range end function onChat(player,_,...) local args = { ... } local message = "" for _,arg in ipairs(args) do if message == "" then message = arg else message = message .. " " .. arg end local px,py,pz=getElementPosition(player) local nick=getPlayerName(player) for _,v in ipairs(getElementsByType("player")) do if isPlayerInRangeOfPoint(v,px,py,pz,chat_range) then outputChatBox("[LOCAL]"..nick..": #ffffff"..message,v,30,30,200,true) end end end addCommandHandler("Local",onChat)
  3. laserlaser

    Clan Tags

    Try; local lowerBound,upperBound = unpack(get("color_range")) g_Root = getRootElement () g_ResourceRoot = getResourceRootElement ( getThisResource () ) getPlayerColor = getPlayerNametagColor getPlayerColour = getPlayerNametagColor addEventHandler ( "onResourceStart", g_ResourceRoot, function() for i,player in ipairs(getElementsByType"player") do processPlayer ( player ) end end ) function processPlayer ( player ) local r, g, b = math.random(lowerBound, upperBound), math.random(lowerBound, upperBound), math.random(lowerBound, upperBound) setPlayerNametagColor(player, r, g, b) end addEventHandler ( "onPlayerJoin", g_Root, processPlayer ) function chatMyBox (msg, type) if type == 0 then cancelEvent() local account = getPlayerAccount(source) local r, g, b = getPlayerColor(source) local name = getPlayerName(source) local msg = msg:gsub('#%x%x%x%x%x%x', '') if isObjectInACLGroup( 'user.'..getAccountName( account ), aclGetGroup( 'Admin' ) ) then outputChatBox( "#FF0000[TestTag]" .. name .. ': #FFFFFF' .. msg, g_Root, r, g, b, true) elseif isObjectInACLGroup( 'user.'..getAccountName( account ), aclGetGroup( 'Moderator' ) ) then outputChatBox( "#FF8000[TestTag]" .. name .. ': #FFFFFF' .. msg, g_Root, r, g, b, true) elseif isObjectInACLGroup( 'user.'..getAccountName( account ), aclGetGroup( 'Member' ) ) then outputChatBox( "#00FF00[TestTag]" .. name .. ': #FFFFFF' .. msg, g_Root, r, g, b, true) elseif isObjectInACLGroup( 'user.'..getAccountName( account ), aclGetGroup( 'V.I.P' ) ) then outputChatBox( "#0000FF[TestTag]" .. name .. ': #FFFFFF' .. msg, g_Root, r, g, b, true) elseif isObjectInACLGroup( 'user.'..getAccountName( account ), aclGetGroup( 'Scripter' ) ) then outputChatBox( "#00FFFF[TestTag]" .. name .. ': #FFFFFF' .. msg, g_Root, r, g, b, true) else outputChatBox( name .. ': #FFFFFF' .. msg, g_Root, r, g, b, true) end end end addEventHandler('onPlayerChat', g_Root, chatMyBox)
  4. laserlaser

    Clan Tags

    Change local lowerBound,upperBound = unpack(get"color_range") g_Root = getRootElement () g_ResourceRoot = getResourceRootElement ( getThisResource () ) getPlayerColor = getPlayerNametagColor getPlayerColour = getPlayerNametagColor addEventHandler ( "onResourceStart", g_ResourceRoot, function() for i,player in ipairs(getElementsByType"player") do processPlayer ( player ) end end ) function processPlayer ( player ) player = player or source local r, g, b = math.random(lowerBound, upperBound), math.random(lowerBound, upperBound), math.random(lowerBound, upperBound) setPlayerNametagColor(player, r, g, b) end addEventHandler ( "onPlayerJoin", g_Root, processPlayer ) function chatMyBox (msg, type) if type == 0 then cancelEvent() local account = getPlayerAccount(source) local r, g, b = getPlayerColor(source) local name = getPlayerName(source) local msg = msg:gsub('#%x%x%x%x%x%x', '') if isObjectInACLGroup( 'user.'..getAccountName( account ), aclGetGroup( 'Admin' ) ) then outputChatBox( "#FF0000[TestTag]" .. name .. ': #FFFFFF' .. msg, g_Root, r, g, b, true) elseif isObjectInACLGroup( 'user.'..getAccountName( account ), aclGetGroup( 'Moderator' ) ) then outputChatBox( "#FF8000[TestTag]" .. name .. ': #FFFFFF' .. msg, g_Root, r, g, b, true) elseif isObjectInACLGroup( 'user.'..getAccountName( account ), aclGetGroup( 'Member' ) ) then outputChatBox( "#00FF00[TestTag]" .. name .. ': #FFFFFF' .. msg, g_Root, r, g, b, true) elseif isObjectInACLGroup( 'user.'..getAccountName( account ), aclGetGroup( 'V.I.P' ) ) then outputChatBox( "#0000FF[TestTag]" .. name .. ': #FFFFFF' .. msg, g_Root, r, g, b, true) elseif isObjectInACLGroup( 'user.'..getAccountName( account ), aclGetGroup( 'Scripter' ) ) then outputChatBox( "#00FFFF[TestTag]" .. name .. ': #FFFFFF' .. msg, g_Root, r, g, b, true) else outputChatBox( name .. ': #FFFFFF' .. msg, g_Root, r, g, b, true) end end end addEventHandler('onPlayerChat', g_Root, chatMyBox)
  5. Use This; function AbsoluteToRelative( X, Y ) local rX, rY = guiGetScreenSize() local x = X/rX local y = Y/rY return x, y end And RelativeToAbsolute; function RelativeToAbsolute( X, Y ) local rX, rY = guiGetScreenSize() local x = X*rX local y = Y*rY return x, y end
  6. Hello mates, Obviously can not say the new.I write old year. Functions: --[[ Created by Ozan Tartar Cooker-X a.k.a laserlaser -| Bikers! War Of Empire LUA Team File Read System v1.0 ]] -- file_Create function file_Create(filename) return fileCreate(filename) end -- file_Open function file_Open(filename) return fileOpen(filename) end -- file_Write function file_Write(filename,string1,...) local args = {...} local file = file_Open(filename) if file then if args then fileWrite(file,string1,unpack(args)) else fileWrite(file,string1) end fileClose(file) end end -- file_Read function file_Read(filename) local file = file_Open(filename) local buffer = nil if (file) then buffer ='' while not fileIsEOF(file) do buffer = buffer..fileRead(file, 500) end fileClose(file) end return buffer end -- file_Get function file_Get(filename,param) local myBuffer = file_Read(filename) local myValue = nil if ( myBuffer ~= nil ) then for k, v in string.gmatch(myBuffer, "([%w]+)=([%w]+)") do if k==param then myValue=v end end if (myValue ~= nil) then return myValue else return nil end else return nil end end -- file_Set function file_Set(filename,param,value) local myBuffer = file_Read(filename) local isEOF = true local myBuffer1={} if myBuffer ~= nil then local count=1 for k, v in string.gmatch(myBuffer, "(%w+)=(%w+)") do if k==param then myBuffer1[count]=k.."="..value.."\n" isEOF=false else myBuffer1[count]=k.."="..v.."\n" end count = count+1 end if isEOF==true then myBuffer1[count]=param.."="..value.."\n" end local file = file_Open(filename) if file then fileWrite(file,unpack(myBuffer1)) fileClose(file) else return nil end else return nil end end -- file_IsEOF function file_IsEOF(filename) local file = file_Open(filename) if file then local iseof = fileIsEOF(file) fileClose(file) return iseof else return nil end end -- file_Delete function file_Delete(filename) return fileDelete(filename) end -- file_Close function file_Close(fileHandler) return fileClose(fileHandler) end -- file_Exists function file_Exists(filename) return fileExists(filename) end -- file_Size function file_Size(filename) local file=file_Open(filename) if file then local size = fileGetSize(file) file_Close(file) return size else return 0 end end -- file_Flush function file_Flush(fileHandler) return file_Flush(fileHandler) end -- Short fcreate = file_Create fopen = file_Open fwrite = file_Write fread = file_Read fget = file_Get fset = file_Set fisEOF = file_IsEOF fdelete = file_Delete fclose = file_Close fexists = file_Exists fsize = file_Size fflush = file_Flush Fonksiyon Açıklamaları: çoğu fonksiyon aynı. fread = Dosyanın tüm içeriğini dönderir.While döngüsüne gerek kalmaz ;direk local bufferString=fread("a.txt"); yazarsanız bufferString'e a.txt'nin içeriğini aktaracaktır. fget(filename,key) == örneğin a.txt'mizin içi Password=aaaa olsun eğer bu fonksiyonu fget("a.txt","Password") yazarsak bize "aaaa" sonucunu döndürecektir. fset(filename,key,value) == fset(filename,"Password","a1"); yaparsak Password=a1 olacaktır. War OF Empire Lua Team... Alıntı Değildir.
  7. The files in the .zip? If files in the .zip, extract files. ((( Sorry for bad english, I'm Turk )))
  8. Arkadaşlar mysql ile kodladığım yeni giriş / kayıt panelinden görüntüler.Script'i paylaşmayacağım tanıtım amaçlıdır.Yavaş yavaş bu panele uygun kullanıcı paneli kodlamaya başladım.İyi kötü yorumlarınızı esirgemeyin.İşte görüntüler: Hello friends, this is my new script.I write with mysql.I don't share this script.This topic for identification purposes only.Screen Shots: Client Config File;
  9. I started to learn a few Turks.
  10. I know lua.I want to be a lua teacher but my english is very bad.
  11. Account Functions at client FROM VERSION 1.1 ONWARDS.Please...
  12. Merhaba arkadaşlar, War Of Empire takımı için yaptığım yeni bir "LUA" compiler.Eski compiler single olarak oluyordu, ancak bu compilerde istediğiniz kadar lua dosyası ekliyosunuz, silebiliyosunuz işlemler bittikten sonra, bir buton ile tüm dosyalar derleniyor.Ayrıca derleme çıktıları bir mesaj penceresinde size gösteriliyor.Uzatmadan linki vereyim; Hello friends, War Of The Empire did for the team a new "LUA" compiler.Other compiler as a single happening, but until the lua file that you want to add this compiler and can be deleted. Transactions completed after the process of compiling all files with a button you başlıyor.Compile outputs is shown in the message window. ( Sorry guys, It's google fail ) http://solidfiles.com/d/53118/ [War Of Empire Lua Team] Edit: Derlenen dosyalar CompileFiles dizinine eklenir. Derlendikten sonra lütfen dosyalarınızı alınız.Sonraki derlemede silinebilir. Ayrıca derlenmeyen dosyalar yerinde sabit kalır.'.lua' dosyalarını dizine taşımak zorunda değilsiniz
  13. Hello,this my new function.Really good,and easy.Something useful. Ex use: spawnAllPlayers(x,y,z,"Bikers","laserlaser") ((( Here, it just does not respawn player "Bikers" and player "laserlaser" ))) spawnAllPlayers(x,y,z,[string playerNames ...]) The Function: function spawnAllPlayer(x,y,z,...) local ex = {...} local players = getElementsByType("player") local exPlayer = 0 for k,v in ipairs(players) do exPlayer = 0 for a,c in ipairs(ex) do if tostring(getPlayerName(v)) == tostring(c) then exPlayer=1 end end if exPlayer ~=1 then spawnPlayer(v,x,y,z) end end end - War Of Empire LUA Team -
  14. Hello,this my new function respawnAllVehicles with exceptions... Ex use: v1 = createVehicle(...) respawnAllVehicles(v1) ((( Here, it just does not respawn vehicle "v1" ))) or v1 = createVehicle(...) v2 = createVehicle(...) v3 = createVehicle(...) respawnAllVehicles(v1,v3) ((( Here, it just does respawn vehicle "v2" ))) The Function : function respawnAllVehicles(...) local ex = {...} local cars = getElementsByType("vehicle") for k,v in ipairs(cars) do local carEx=0 for a,c in ipairs(ex) do if c == ex then carEx=1 end end if carEx~=1 then respawnVehicle(v) end end end - War Of Empire LUA Team -
  15. Hello, Again,I'm.This my new function.Really good.This have exception account Ex use: removeAllAccounts("|OS|Bikers!") ((( Here, it just does not delete account "|OS|Bikers!" ))) or removeAllAccounts("bikers","laserlaser",...) -- removeAllAccounts(string exceptionAccountName1,string exceptionAccountName2,...) The Function : function removeAllAccounts(...) local ex = {...} local accs = getAccounts() for k,v in ipairs(accs) do local accex = 0 for a,c in ipairs(ex) do if c==getAccountName(v) then accex=1 end end if accex~=1 then removeAccount(v) end end end - War of Empire LUA Team -
  16. Hello,this my new function.Easy but good ! Example use: local handler = mysql_connect(...) mysqlUpdateParam(handler,"users","money",getPlayerMoney(source),"userid",1) mysqlUpdateParam ( mysqlHandler handler,string tablename,string rowname,string/int/float/double/bool rowvalue,string idrow,string id) The Function : function mysqlUpdateParam(handler,tablename,paramname,paramvalue,idrow,id) if handler and paramname and paramvalue then local query = mysql_query(handler,"UPDATE "..tablename.." SET "..paramname.."='"..tostring(paramvalue).."' WHERE "..idrow.."="..id) if query then return true else return false end end end Note : I did not test. Bug may be. Tell me if you find the bug. War OF Empire LUA Team
  17. yes pls i don't understand nothing Ok,but sorry for bad english.Google translate fail
×
×
  • Create New...