Jump to content

laserlaser

Members
  • Posts

    92
  • Joined

  • Last visited

Everything posted by laserlaser

  1. sorry, handler=mysql_connect(string hostname, string username, string password, string database) mysql_query(handler, SaveQuery)
  2. Merhaba arkadaşlar yine ben Bu sefer bir program yazdım.Ahmet'in programı türkçe karakterleri çevirmiyordu.Bu çeviriyor Tamamen bana aittir.LUA dosyalarınızı okunamaz hale getirir.Yani işlemci diline çevirir.VB.NET 2008 ile yazılmıştır.Kullanmanız için en az net framework 3.5'iniz olmalı.Özelliklerinden biri,compile ettiğiniz lua dosyası kendi adında "LUA" dosyasına,compile edilmemiş hali ise "NoCompiles" dosyasına gönderilir.Ahmet'inkinin Türkçe karakterleri çevirmemesinin nedeni,ahmet'in "-s" parametresini kullanmasından kaynaklanıyor.Ancak normalde compile için -l parametresi kullanıyor luac5.1.exe Bu yüzden benimki türkçe karakterleride çevirebiliyor.Uzatmadan linki vereyim English : This software is to compile lua files (it makes your scripts unreadable - you can protect they agains thieves). Compiled LUA files will be send to the "lua" folder - original ones will be send to the NoCompiles folder. Lua file must be in the same folder with the software files. This application is written in VisualBasic.NET 2008. It will run only if you have .NET Framework 3.5 installed. Download Compiler.zip |- War Of Empire LUA -|
  3. lol where mysql_query mysql_query(SaveQuery)
  4. if there isn't any value return "" else return node value if there isn't any attr then return table hasn't attr
  5. Arkadaşlar bir kayıt ve giriş res'i yazdım.Serial'inize göre kayıt yapar.Yani bir bilgisayardan sadece 1 kere kayıt olabilirsiniz.Seriailiniz aynı zamanda user name'nizdir.Serialinizi girmeniz gerekmez otomatik gelir.Read only özelliği ile text'de ayarlama yapamassınız.Sadece şifreniz girebilir ve register veya login olabilirsiniz. Kodlar: Client-SIDE Kısmı: GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Grid = {} function onRegisterButton(button,buttonState) if button=="left" then triggerServerEvent("onRegisterClick",getLocalPlayer(),guiGetText(sifreEdit)) end end function onLoginBt(button,buttonState) if button=="left" then triggerServerEvent("onLoginClick",getLocalPlayer(),guiGetText(sifreEdit)) end end function onPlayerRegister() showCursor(false) toggleAllControls(true) guiSetVisible(GUIEditor_Window[2],false) end addEvent("onPlayerRegister",true) addEventHandler("onPlayerRegister",getRootElement(),onPlayerRegister) -- function postSerial(serial) guiSetText(serialEdit,serial) end addEvent("postSerial",true) addEventHandler("postSerial",getRootElement(),postSerial) function onClientResourceStart(res) GUIEditor_Window[2] = guiCreateWindow(264,247,273,108,"Bikers Race's Scripts - Register Login!",false) guiWindowSetSizable(GUIEditor_Window[2],false) GUIEditor_Label[1] = guiCreateLabel(10,25,35,14,"Serial :",false,GUIEditor_Window[2]) guiLabelSetColor(GUIEditor_Label[1],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[1],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[1],"left",false) GUIEditor_Grid[1] = guiCreateGridList(134,-1014,5,600,false,GUIEditor_Window[2]) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) serialEdit = guiCreateEdit(50,21,214,24,tostring(getElementData(getLocalPlayer(),"Serial")),false,GUIEditor_Window[2]) guiEditSetReadOnly(serialEdit,true) GUIEditor_Label[2] = guiCreateLabel(9,56,41,15,"Password:",false,GUIEditor_Window[2]) guiLabelSetColor(GUIEditor_Label[2],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[2],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[2],"left",false) guiSetProperty(GUIEditor_Label[2],"Text","Sifreniz:") sifreEdit = guiCreateEdit(51,51,213,24,"",false,GUIEditor_Window[2]) guiEditSetMaxLength(sifreEdit,15) registerBt = guiCreateButton(52,79,55,19,"Register",false,GUIEditor_Window[2]) loginBt = guiCreateButton(194,80,51,17,"Login",false,GUIEditor_Window[2]) triggerServerEvent("returnSerial",getLocalPlayer()) showCursor(true) guiSetVisible(GUIEditor_Window[2],true) toggleAllControls(false) addEventHandler("onClientGUIClick",registerBt,onRegisterButton,false) addEventHandler("onClientGUIClick",loginBt,onLoginBt,false) end addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),onClientResourceStart) function onClientPlayerJoin() addEventHandler("onClientGUIClick",registerBt,onRegisterButton,false) addEventHandler("onClientGUIClick",loginBt,onLoginBt,false) end addEventHandler("onClientPlayerJoin",getRootElement(),onClientPlayerJoin) -- Server SIDE Kısmı: function onResourceStart(res) for k,v in ipairs( getElementsByType("player" ) ) do if isGuestAccount(getPlayerAccount(v)) then setElementData(source,"Money",0) setElementData(source,"Point",0) else setElementData(source,"Money",tonumber(getAccountData(getPlayerAccount(v),"Money"))) setElementData(source,"Point",tonumber(getAccountData(getPlayerAccount(v),"Point"))) end end end addEventHandler("onResourceStart",getResourceRootElement(getThisResource()),onResourceStart) function returnSerial() triggerClientEvent(source,"postSerial",getRootElement(),getPlayerSerial(source)) end addEvent("returnSerial",true) addEventHandler("returnSerial",getRootElement(),returnSerial) function onRegisterClick(sifre) if string.len(tostring(sifre)) < 6 or string.len(tostring(sifre))>15 then outputChatBox("Sifreniz 6'dan büyük,15'den küçük olmalıdır...",source,255,0,0,true) else if getAccount(getPlayerSerial(source)) then outputChatBox("Zaten Bu Serial'de Kayıtlı Biri Bulunmakta!!",source,255,0,0,true) else local acc=addAccount(getPlayerSerial(source),sifre) if not acc then outputChatBox("Kayıt Esnasında Bir Hata Oluştu...",source,255,0,0,true) else if logIn(source,acc,sifre) then outputChatBox("Başarıyla Register ve Log-in oldunuz...",0,255,0,true) setAccountData(acc,"Point",0) setAccountData(acc,"Money",0) triggerClientEvent(source,"onPlayerRegister",getRootElement()) else outputChatBox("Log-in İşleminde Hata Oluştu",source,255,0,0,true) end end end end end addEvent("onRegisterClick",true) addEventHandler("onRegisterClick",getRootElement(),onRegisterClick) -- function onLoginClick(sifre) if not isGuestAccount(getPlayerAccount(source)) then logOut(source) end if string.len(tostring(sifre)) < 6 or string.len(tostring(sifre))>15 then outputChatBox("Sifreniz 6'dan büyük,15'den küçük olmalıdır...",source,255,0,0,true) else if not getAccount(getPlayerSerial(source)) then outputChatBox("Böyle Bir Hesap Bulunmamakta...",source,255,0,0,true) else local acc=getAccount(getPlayerSerial(source)) if logIn(source,acc,sifre) then outputChatBox("Başarıyla Giriş Yaptınız...",source,0,255,0,true) setElementData(source,"Money",getAccountData(acc,"Money")) setElementData(source,"Point",getAccountData(acc,"Point")) triggerClientEvent(source,"onPlayerRegister",getRootElement()) else outputChatBox("Yanlış Bir Şifre Girdiniz...",source,255,0,0,true) end end end end addEvent("onLoginClick",true) addEventHandler("onLoginClick",getRootElement(),onLoginClick) -- function onPlayerQuit() if not isGuestAccount(getPlayerAccount(source)) then setAccountData(getPlayerAccount(source),"Money",tonumber(getElementData(source,"Money"))) setAccountData(getPlayerAccount(source),"Point",tonumber(getElementData(source,"Point"))) end end addEventHandler("onPlayerQuit",getRootElement(),onPlayerQuit) -- function onResourceStop(res) for k,v in ipairs(getElementsByType("player")) do setAccountData(getPlayerAccount(v),"Money",tonumber(getElementData(v,"Money"))) setAccountData(getPlayerAccount(v),"Point",tonumber(getElementData(v,"Point"))) end end addEventHandler("onResourceStop",getResourceRootElement(getThisResource()),onResourceStop) En kısa zamanda resource haline getircem!! -- | War Of Empire LUA Team | --
  6. Hello mates,again me The my new script!! but i write old days This is server-side : function refreshTeams() local xml = xmlLoadFile("teams.xml") local teamCount=0 local name local tag local r local g local b local tm while xmlFindChild(xml,"team",teamCount) do local child = xmlFindChild(xml,"team",teamCount) name = xmlNodeGetAttribute(child,"name") tag = xmlNodeGetAttribute(child,"tag") r = xmlNodeGetAttribute(child,"r") g = xmlNodeGetAttribute(child,"g") b = xmlNodeGetAttribute(child,"b") if not getTeamFromName(name) then table.insert(teams,name) table.insert(teamsTag,tag) tm=createTeam(tostring(name),tonumber(r),tonumber(g),tonumber(b)) for k,v in ipairs( getElementsByType("player") ) do if string.find(getPlayerName(v),tag) then setPlayerTeam(v,tm) end end end teamCount=teamCount+1 end end function addTeam(name,tag,r,g,b) local xml = xmlLoadFile("teams.xml") local newTeam = xmlCreateChild(xml,"team") xmlNodeSetAttribute(newTeam,"name",name) xmlNodeSetAttribute(newTeam,"tag",tag) xmlNodeSetAttribute(newTeam,"r",tostring(r)) xmlNodeSetAttribute(newTeam,"g",tostring(g)) xmlNodeSetAttribute(newTeam,"b",tostring(b)) xmlSaveFile(xml) table.insert(teams,name) table.insert(teamsTag,tag) local tm = createTeam(tostring(name),tonumber(r),tonumber(g),tonumber(b)) if tm then outputChatBox(name .. " Adlı Takım Eklendi,TAG:"..tag.."...") end for k,v in ipairs (getElementsByType("player")) do if string.find(getPlayerName(v),tag) then setPlayerTeam(v,tm) end end end function onResourceStart(res) refreshTeams() for _,z in ipairs(getElementsByType("player")) do, for k,v in ipairs(teamsTag) do if string.find(getPlayerName(z),tostring(v)) then setPlayerTeam(z,getTeamFromName(teams[k])) break end end end local team for k,v in ipairs( teams ) do team = getTeamFromName(v) if isElement(team) then if countPlayersInTeam( team ) == 0 then destroyElement(team) end end end end addEventHandler("onResourceStart",getResourceRootElement(getThisResource()),onResourceStart) -- function onPlayerJoin() refreshTeams() for k,v in ipairs(teamsTag) do if string.find(getPlayerName(source),tostring(v)) then setPlayerTeam(source,getTeamFromName(teams[k])) break end end local team for k,v in ipairs( teams ) do team = getTeamFromName(v) if isElement(team) then if countPlayersInTeam( team ) == 0 then destroyElement(team) end end end end addEventHandler("onPlayerJoin",getRootElement(),onPlayerJoin) -- function onPlayerChangeNick(old,new) local count=0 refreshTeams() for k,v in ipairs(teamsTag) do if string.find(new,tostring(v)) then setPlayerTeam(source,getTeamFromName(teams[k])) count=1 break end end if count==0 then setPlayerTeam(source,nil) end local team for k,v in ipairs( teams ) do team = getTeamFromName(v) if isElement(team) then if countPlayersInTeam( team ) == 0 then destroyElement(team) end end end end addEventHandler("onPlayerChangeNick",getRootElement(),onPlayerChangeNick) function cmdAddTeam(player,cmd,tag,r,g,b,...) local e = { ... } local name = "none" if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)),aclGetGroup("Admin")) then for k,v in ipairs(e) do if name=="none" then name=v else name=name.." "..v end end addTeam(name,tag,r,g,b) end end addCommandHandler("addteam",cmdAddTeam) /addteam özelliğini sadece adminler kullanabilir. /addteam tag r g b name örnek kullanım : /addteam |OS| 255 0 0 Old Soldiers <teams> <team name="Old Soldiers" tag="|OS|" r="255" g="0" b="0" /> <!-- <team name="Team Name" tag="Team Tag" r="Color R" g="Color G" b="Color B" --> </teams> Made in TURKEY -War OF Empire-
  7. Hello,this my new script I write script at old days The Code: local isMapDM local isMapRace function gmActive( gmactv ) if gmactv==1 then for k,v in ipairs(getElementsByType("player")) do setElementData( v, "overrideCollide.uniqueblah", 0, false ) outputChatBox("Ghostmode Enabled by Server",v,0,255,0,true) set("*ghostmode",true) end else for k,v in ipairs(getElementsByType("player")) do setElementData( v, "overrideCollide.uniqueblah", nil, false ) set("*ghostmode",false) outputChatBox("Ghostmode Disabled by Server",v,255,0,0,true) end end end function onMapStarting(mapInfo, mapOptions, gameOptions) local isRace = 0 local isDM = 0 if #getElementsByType("checkpoint")>=1 then isRace=1 isMapDM=0 isMapRace=1 end if isRace==1 then gmActive(1) else for a,c in ipairs(getElementsByType("racepickup")) do if getElementData(c,"type")=="vehiclechange" then if tonumber(getElementData(c,"vehicle")) == 425 then isDM=1 isMapDM=1 isMapRace=0 end end end if isDM==1 then gmActive(1) else gmActive(0) end end end addEvent("onMapStarting",true) addEventHandler("onMapStarting",getRootElement(),onMapStarting) MADE in TURKEY |-War Of Empire -> Lua Team
  8. Hello,i'm write a new resource.This name is Countdown!! The Codes : countDown=0 countDownSecond=0 function countDownX() local display --for k,v in ipairs(getElementsByType("player")) do --textDisplayAddObserver ( display, getRootElement() ) --end --[[if tonumber(countDownSecond)>=1 then local text = textCreateTextItem ( tostring(countDownSecond), 0.5, 0.5, "low", 255, 0, 0, 0, 1.0 ) textDisplayAddText ( display, text ) setTimer ( textDisplayRemoveText, 500, 1, display, text ) countDownSecond=countDownSecond-1 else local text = textCreateTextItem ( "GO GO GO!!", 0.5, 0.5, "low", 255, 0, 0, 0, 1.0 ) textDisplayAddText ( display, text ) setTimer ( textDisplayRemoveText, 500, 1, display, text ) countDown=0 countDownSecond=0 end]] if tonumber(countDownSecond) ~=0 then for k,v in ipairs( getElementsByType("player") ) do display = textCreateDisplay() -- create a text display textDisplayAddObserver ( display, v ) -- make it visible to a player myTextItem = textCreateTextItem ( tostring(countDownSecond), 0.5, 0.5,"medium",255,255,255,150,6.0 ) -- create a text item for the display textDisplayAddText ( display, myTextItem ) setTimer ( textDisplayRemoveText, 500, 1, display, myTextItem ) end countDownSecond=countDownSecond-1 else for k,v in ipairs( getElementsByType("player") ) do display = textCreateDisplay() -- create a text display textDisplayAddObserver ( display, v ) -- make it visible to a player myTextItem = textCreateTextItem ( "GO! GO! GO!", 0.2, 0.5,"medium",0,255,0,130,7.3 ) -- create a text item for the display textDisplayAddText ( display, myTextItem ) setTimer ( textDisplayRemoveText, 1000, 1, display, myTextItem ) countDownSecond=0 countDown=0 end end --[[if countDownSecond ~= 0 then outputChatBox(countDownSecond,getRootElement(),255,0,0,true) countDownSecond=countDownSecond-1 else outputChatBox("GO GO GO!!",getRootElement(),0,255,0,true) countDownSecond=0 countDown=0 end]] end function cmdCountDown(player,cmd,countRecord) if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)),aclGetGroup("Admin")) then if countDown==1 then outputChatBox("Zaten bir sayım işlemi sürüyor...",player,255,0,0,true) else if tonumber(countRecord) > 10 or tonumber(countRecord)<1 then outputChatBox("Record süresi 10 ve 1 arasında olmalıdır...",player,255,0,0,true) else setTimer(countDownX,1000,countRecord+1) countDown=1 countDownSecond=countRecord end end end end addCommandHandler("countdown",cmdCountDown) The commands use admins /countdown record ( 1-10) -- Made in TURKEY! War Of Empire LUA TEAM
  9. Time to good use,More quickly...There is no unnecessary code Ty for reply my topic
  10. laserlaser

    MoveObject

    SetTimer Replace it : moveObject(ufo1,10000,-353.2197265625,2187.2331542969,86.91221618523) setTimer(moveObject,timeto_oldposition(milisecond),1,ufo1,oldPositionX,oldPositionY,oldPositionZ) Good LUCK
  11. Hello,i write a new useful function.This name is getXMLNodes,good! My name is |OS|Bikers! in MTA! The Codes: function getXMLNodes(xmlfile,nodename) local xml = xmlLoadFile(xmlfile) if xml then local ntable={} local a = 0 while xmlFindChild(xml,nodename,a) do table.insert(ntable,a+1) ntable[a+1]={} local attrs = xmlNodeGetAttributes ( xmlFindChild(xml,nodename,a) ) for name,value in pairs ( attrs ) do table.insert(ntable[a+1],name) ntable[a+1][name]=value end ntable[a+1]["nodevalue"]=xmlNodeGetValue(xmlFindChild(xml,nodename,a)) a=a+1 end return ntable else return {} end end Example USE: local aTeam = getXMLNodes("teams.xml","team") for ka,vc in ipairs(aTeam) do outputDebugString(vc.tag) end Made in Turkey! War of Empire LUA TEAM!
×
×
  • Create New...