freudo Posted April 28, 2015 Posted April 28, 2015 This is team create function function clanKur(isim,tag,renk,r,g,b) local acc = getPlayerAccount(source) local cash = tonumber(getAccountData(acc,"cash")) local clan = getAccountData(acc,"clan") if clan ~= "0" then outputChatBox("Clandan ayrilmadan clan kuramazsiniz.",source,255,0,0,true) else local ic = 0 local tc = 0 for _,v in ipairs(clans) do if tostring(v.isim) == tostring(isim) then ic=1 end if tostring(v.tag) == tostring(tag) then tc=1 end end if ic == 1 then triggerClientEvent(source,"addNotification",getRootElement(),"Böyle bir clan ismi kullanılmakta!", 2) elseif tc==1 then triggerClientEvent(source,"addNotification",getRootElement(),"Böyle bir clan tagı kullanılmakta!", 2) else if cash >= ClanParaAlc then local xml = xmlLoadFile("clans.xml") local node = xmlCreateChild(xml,"clan") xmlNodeSetAttribute(node,"isim",isim) xmlNodeSetAttribute(node,"tag",tag) xmlNodeSetAttribute(node,"r",r) xmlNodeSetAttribute(node,"g",g) xmlNodeSetAttribute(node,"b",b) xmlNodeSetAttribute(node,"color",renk) setAccountData(acc, "money", cash-ClanParaAlc) setAccountData(acc,"clan",tag) setAccountData(acc,"clankurucu","1") setAccountData(acc,"clanyetkili","1") xmlSaveFile(xml) outputChatBox("#31cccc* "..getPlayerName(source).." #31ccccadlı oyuncu #ff3333"..tag.." "..isim.." #31ccccclanını kurdu.",getRootElement(),0,255,0,true) triggerClientEvent(source,"addNotification",getRootElement(),isim.. " adlı klan başarıyla kuruldu!", 1) triggerClientEvent(source,"clanKapat",source) local team = createTeam(tostring(isim),tonumber(r),tonumber(g),tonumber(b)) table.insert ( clans,{["tag"]=tostring(tag),["isim"]=tostring(isim),["r"]=tonumber(r),["g"]=tonumber(g),["b"]=tonumber(b),["team"]=team}) setPlayerTeam(source,team) else outputChatBox("You dont have money",source,255,0,0,true) end end end end addEvent("clanKur",true) addEventHandler("clanKur",getRootElement(),clanKur) How to I add team color changer function? Can you help me?
xXMADEXx Posted April 30, 2015 Posted April 30, 2015 Do you mean something to change the team color from in-game?
freudo Posted April 30, 2015 Author Posted April 30, 2015 Yes, I want to change out of the game. I add guiEdit and button. function coDevamRenk(btn) if btn == "left" then local renk = guiGetText(renkedit) local r,g,b = getColorFromString(renk) triggerServerEvent("clanColor",getLocalPlayer(),renk,tostring(r),tostring(g),tostring(b)) -- I cant create color changer function. end end
ALw7sH Posted May 2, 2015 Posted May 2, 2015 you mean change it when player click on button after it have been created already?
freudo Posted May 2, 2015 Author Posted May 2, 2015 Look this pictures; Please click pictures right click and open new tab
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now