-
Posts
476 -
Joined
-
Last visited
-
Days Won
1
Everything posted by iiv03
-
in meta you can't use file with html <html src="filename.html" /> https://wiki.multitheftauto.com/wiki/Resource_Web_Access
-
CLOSED a problem has been solved
-
bro everything work but only when join server didn't warp me into team team = {} addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), function(startedRes) team.syncElement = createElement("clanwar_syncElement", "clanwar_syncElement") setElementData(source,"16091976AntiStealScriptbyShimu01022009ReadingSecretCode","Passed") if getResourceName(getThisResource()) == getResourceName(startedRes) then team[3] = createTeam ( "Spectators", 255, 255, 255 ) --etc end end )
-
i try with this when player join didn't work it's tell me Failed in chat where problem? function checkjoin() local players = getElementType("player") setPlayerTeam(players, team[3]) if not players then outputChatBox("Failed") end end addEventHandler("onPlayerJoin",getRootElement(), checkjoin) btw when i use addCommandHandler in this a function and worked get me in the team but why that doesn't worked when join player? and x2 try function checkjoin(player) setPlayerTeam(player, team[3]) if not player then outputChatBox("Failed") end end addEventHandler("onPlayerJoin",getRootElement(), checkjoin) i think problem ("I did not use getTeamName?")
-
I just did normal like that dxDrawText("Alpha 1.0.2 still work on Developer",450,250,150,150,tocolor(255,255,255,230),tables.fontSize,tables.font,"center","center",false) and didn't work what is the reason?
-
hey everyone i make that code and it didn't work with me function checkjoin() local players = getElementsByType("players") for k,v in ipairs(players) do if getElementData(v, "state") =="alive" then setElementHealth(v,0) end end end addEventHandler("onPlayerJoin",getRootElement(), checkjoin) addEventHandler("onRaceStateChanging",getRootElement(), checkjoin)
-
hey the text not showing when map start why where problem here? sX, sY = guiGetScreenSize() tables = { moveY = sY+sY*0.5, moveX = sX*0.5-sX*0, fontSize = 1.00, font = dxCreateFont("font/font.ttf",17) or "default-bold" } function render() local x = tables.moveX local y = tables.moveY local width = sX*0.01 + tables.moveX local height = sY*0.05 dxDrawText("Alpha 1.0.2 still work on Developer",x,y,width,height,tocolor(255,255,255,230),tables.fontSize,tables.font,"center","center",false) setTimer(function () removeEventHandler("onClientRender",root,render) end,5000,1) end addEventHandler("onClientMapStarting",root,function () addEventHandler("onClientRender",root,render) end) lol i used that event onClientScreenFadedIn and worked i don't know what happen have another question how can i check command? in function like /random use this? https://wiki.multitheftauto.com/wiki/GetCommandHandlers i wanna something if he type /random == then removeEventHandler
-
it's done thank you
-
hey I used it onPlayerWasted because I am work on Server side After I tried it and didn't give any points yet if I want to ask if should be players on another team and team? because did not work with me and I am in one team and there is no one in a second team because there is a Loop?
-
hey it still takes two points players if they die in the two teams I want the last player in one team only takes a point is not two teams taking themselves what caused the problem? function pointsauto() local homeTeamPoint = false local enemyTeamPoint = false -- LOOP FOR HOME TEAM local playersHomeTeam = getPlayersInTeam(team[1]) --Assuming that homeName varaible is the team already created previously for id, player in pairs(playersHomeTeam) do if getElementData(player, "state") == "alive" then homeTeamPoint = true -- Here we say that there are alive players in home team and "MIGHT" the point foes for them break -- Here we stop the loop because there is already a player alive --setElementData(team[2], "points", 0) + 1 end end -- LOOP FOR ENEMY TEAM local playersEnemyTeam = getPlayersInTeam(team[2]) --Assuming that enemyName varaible is the team already created previously for id, player in pairs(playersEnemyTeam) do if getElementData(player, "state") == "alive" then enemyTeamPoint = true -- Here we say that there are alive players in home team and "MIGHT" the point foes for them break -- Here we stop the loop because there is already a player alive --setElementData(team[2], "points", 0) + 1 end end if homeTeamPoint ~= enemyTeamPoint then if homeTeamPoint then local pointE = tonumber(getElementData(team[2], "points") or 0) + 1 setElementData(team[2], "points", pointE) elseif enemyTeamPoint then local pointH = tonumber(getElementData(team[1], "points") or 0) + 1 setElementData(team[1], "points", pointH) end end end addEventHandler("onResourceStart", getRootElement(), pointsauto)
-
hello @Overkillz i make that line can you tell me is there wrong ? function pointsauto() local homeTeam = getPlayersInTeam(homeName) local players = getElementsByType(homeTeam) for id, player in pairs(players) do if isPedDead(player) and getElementData(player, "state") == "dead" then local pointE = tonumber(getElementData(team[2], "points") or 0) + 1 setElementData(team[2], "points", pointE) end local enemyTeam = getPlayersInTeam(enemyName) local players = getElementsByType(enemyName) for id, player in pairs(players) do if isPedDead(player) and getElementData(player, "state") == "dead" then local pointH = tonumber(getElementData(team[1], "points") or 0) + 1 setElementData(team[1], "points", pointH) end end end end addEventHandler("onResourceStart", getRootElement(), pointsauto) that's my try function pointsauto() local homeTeam = getPlayersInTeam(team[1]) if isPedDead(homeTeam) and getElementData(homeTeam, "state") == "dead" then local pointE = tonumber(getElementData(team[2], "points") or 0) + 1 setElementData(team[2], "points", pointE) end --[[local enemyTeam = getPlayersInTeam(enemyName) local players = getElementsByType(enemyName) for id, player in pairs(players) do if isPedDead(player) and getElementData(player, "state") == "dead" then local pointH = tonumber(getElementData(team[1], "points") or 0) + 1 setElementData(team[1], "points", pointH) end end]] end addEventHandler("onResourceStart", getRootElement(), pointsauto) this my try second i got error table in isPedDead what wrong ? EDIT:: function pointsauto() local homeTeam = getPlayersInTeam(team[1]) for k,v in ipairs(homeTeam) do local thePlayer = v if isPedDead(v) and getElementData(v, "state") == "dead" then local pointE = tonumber(getElementData(team[2], "points") or 0) + 1 setElementData(team[2], "points", pointE) end --[[local enemyTeam = getPlayersInTeam(enemyName) local players = getElementsByType(enemyName) for id, player in pairs(players) do if isPedDead(player) and getElementData(player, "state") == "dead" then local pointH = tonumber(getElementData(team[1], "points") or 0) + 1 setElementData(team[1], "points", pointH) end end]] end end addEventHandler("onResourceStart", getRootElement(), pointsauto) here i fixed but i want it through the last player of the team if he remains alive gets a point how?i wanna only last player
-
THANKKS A LOT
-
I want to ask about knowing how this is If team1 players died and the 2 team left one player gives a number how? do i have to check the state? please i need an example
-
i haven't found a solution yet please helppp
-
like this not work ? function updateTeamColour() setTeamColor ( team[2], colour.r, colour.g, colour.b ) end addEvent("updateTeamColour", true) addEventHandler("updateTeamColour", resourceRoot, updateTeamColour) addEventHandler("onPlayerJoin", getRootElement(), updateTeamColour) server side
-
not work local tagColor = rgbToHex(colour.r,colour.g,colour.b) or "#FFFFFF" function updateTeamSettings(cmd,R,G,B) if not tonumber(R) or not tonumber(G) or not tonumber(B) then return end R,G,B = tonumber(R),tonumber(G),tonumber(B) if R <= 50 and G <= 50 and B <= 50 then colour.r = 255 colour.g = 255 colour.b = 255 else colour.r = R colour.g = G colour.b = B end tagColor = rgbToHex(colour.r,colour.g,colour.b) or "#FFFFFF" local enemyTeam = getTeamFromName(enemyName) if enemyTeam then team[2] = enemyTeam TeamColor() else if team[2] then TeamColor() end end end addCommandHandler("color",updateTeamSettings) function TeamColor() triggerServerEvent ( "updateTeamColour", resourceRoot,team[2], colour.r, colour.g, colour.b ) end
-
hey there is not fix yet can u help me it's still not updating color when i reconnect or join server Client Side colour = {} colour.r = 255 colour.g = 85 colour.b = 85 function rgbToHex ( nR, nG, nB ) local sColor = "#" nR = string.format ( "%X", nR or 255 ) sColor = sColor .. ( ( string.len ( nR ) == 1 ) and ( "0" .. nR ) or nR ) nG = string.format ( "%X", nG or 255 ) sColor = sColor .. ( ( string.len ( nG ) == 1 ) and ( "0" .. nG ) or nG ) nB = string.format ( "%X", nB or 255 ) sColor = sColor .. ( ( string.len ( nB ) == 1 ) and ( "0" .. nB ) or nB ) return sColor end local tagColor = rgbToHex(colour.r,colour.g,colour.b) or "#FFFFFF" function updateTeamSettings(cmd,R,G,B) if not tonumber(R) or not tonumber(G) or not tonumber(B) then return end R,G,B = tonumber(R),tonumber(G),tonumber(B) if R <= 50 and G <= 50 and B <= 50 then colour.r = 255 colour.g = 255 colour.b = 255 else colour.r = R colour.g = G colour.b = B end tagColor = rgbToHex(colour.r,colour.g,colour.b) or "#FFFFFF" if enemyTeam then team[2] = enemyTeam TeamColor() else --team[2] = createTeam ( enemyName, colour.r,colour.g,colour.b) if team[2] then TeamColor() end end end addCommandHandler("color",updateTeamSettings) addEventHandler("onClientPlayerJoin", getRootElement(), updateTeamSettings) function TeamColor() triggerServerEvent ( "updateTeamColour", resourceRoot,team[2], colour.r, colour.g, colour.b ) end addEventHandler("onClientPlayerJoin", getRootElement(), TeamColor) function text() dxDrawText("Alive Players[#334455"..home_alive.."#ffffff/"..tagColor..enemy_team.."#ffffff]",sX,sY*0.03,sX*0.2,sY*0,tocolor(255,255,255,generalAlpha),clanwar_data_fontSize*1.2,clanwar_data_font,"center","center",false,false,false,true) end addEventHandler("onClientRender", root, text) Server Side team = {} colour = {} colour.r = 255 colour.g = 85 colour.b = 85 function rgbToHex ( nR, nG, nB ) local sColor = "#" nR = string.format ( "%X", nR or 255 ) sColor = sColor .. ( ( string.len ( nR ) == 1 ) and ( "0" .. nR ) or nR ) nG = string.format ( "%X", nG or 255 ) sColor = sColor .. ( ( string.len ( nG ) == 1 ) and ( "0" .. nG ) or nG ) nB = string.format ( "%X", nB or 255 ) sColor = sColor .. ( ( string.len ( nB ) == 1 ) and ( "0" .. nB ) or nB ) return sColor end local tagColor = rgbToHex(colour.r,colour.g,colour.b) or "#FFFFFF" function updateTeamSettings(playerSource,cmd,R,G,B) local playerName = getPlayerName(playerSource) local account = getPlayerAccount (playerSource) local account_name = getAccountName(account) if isObjectInACLGroup ( "user." .. account_name, aclGetGroup ( "Admin" )) then if not tonumber(R) or not tonumber(G) or not tonumber(B) then outputChatBox("#313131こコBOT#ffffff| #ffffffWrong Syntax #abcdef/color R G B",playerSource,255,255,255,true) return end R,G,B = tonumber(R),tonumber(G),tonumber(B) if R <= 50 and G <= 50 and B <= 50 then--R,G,B = ,tonumber(G),tonumber(B) colour.r = 255 colour.g = 255 colour.b = 255 else colour.r = R colour.g = G colour.b = B end tagColor = rgbToHex(colour.r,colour.g,colour.b) or "#FFFFFF" triggerClientEvent(getRootElement(), "updateName", getRootElement(), homeName, homeTag, enemyName, enemyTag,colour.r,colour.g,colour.b) outputChatBox("#313131こコBOT#ffffff| #ffffffTeam Colour successfully changed",playerSource,255,255,255,true) local enemyTeam = getTeamFromName(enemyName) if enemyTeam then team[2] = enemyTeam updateTeamColour() else team[2] = createTeam ( enemyName, colour.r,colour.g,colour.b) if team[2] then updateTeamColour() end end end end addCommandHandler("color",updateTeamSettings) function updateTeamColour() setTeamColor ( team[2], colour.r, colour.g, colour.b ) end addEvent("updateTeamColour", true) addEventHandler("updateTeamColour", resourceRoot, updateTeamColour) btw in server side work updatecolor when i reconnect but in client not work please help i'm so confused
-
hey everyone have bug here and i don't know how fix that colour = {} colour.r = 255 colour.g = 85 colour.b = 85 function rgbToHex ( nR, nG, nB ) local sColor = "#" nR = string.format ( "%X", nR or 255 ) sColor = sColor .. ( ( string.len ( nR ) == 1 ) and ( "0" .. nR ) or nR ) nG = string.format ( "%X", nG or 255 ) sColor = sColor .. ( ( string.len ( nG ) == 1 ) and ( "0" .. nG ) or nG ) nB = string.format ( "%X", nB or 255 ) sColor = sColor .. ( ( string.len ( nB ) == 1 ) and ( "0" .. nB ) or nB ) return sColor end local tagColor = rgbToHex(colour.r,colour.g,colour.b) or "#FFFFFF" function updateTeamSettings(cmd,R,G,B) if not tonumber(R) or not tonumber(G) or not tonumber(B) then return end R,G,B = tonumber(R),tonumber(G),tonumber(B) if R <= 50 and G <= 50 and B <= 50 then colour.r = 255 colour.g = 255 colour.b = 255 else colour.r = R colour.g = G colour.b = B end tagColor = rgbToHex(colour.r,colour.g,colour.b) or "#FFFFFF" if enemyTeam then team[2] = enemyTeam updateTeamColour() else --team[2] = createTeam ( enemyName, colour.r,colour.g,colour.b) if team[2] then updateTeamColour() end end end addCommandHandler("color",updateTeamSettings) addEventHandler("onClientPlayerJoin", getRootElement(), updateTeamSettings) function updateTeamColour() setTeamColor ( team[2], colour.r, colour.g, colour.b ) end addEventHandler("onClientPlayerJoin", getRootElement(), updateTeamColour) function text() dxDrawText("Alive Players[#334455"..home_alive.."#ffffff/"..tagColor..enemy_team.."#ffffff]",sX,sY*0.03,sX*0.2,sY*0,tocolor(255,255,255,255),clanwar_data_fontSize*1.2,clanwar_data_font,"center","center",false,false,false,true) end addEventHandler("onClientRender", root, text) after i change the colors team and i do reconnect the color is due to the same thing and I want it to save the colors in server work .. but in didn't work client not work?
-
what troube here why no event triggerEvent connect to nextmap? function updatePosition (mapinfo) g_MapInfo = mapinfo if g_MapInfo.nextmap then setNextmap(g_MapInfo.nextmap) triggerEvent("radar:setOffset", localPlayer, nextDisplay.posY*0.2) end end i wanna set triggerEvent connect when i set nextmap it didn't work
-
Oh i forgot but this is very simple. Thank you
-
hey, i got error attempt to compare string with number in this line if R <= 50 and G <= 50 and B <= 50 then
-
مو كذا قصدي ذا لما يبدا الحركه توصل وتوقف هناك. مشكور والله هذا الي كان أقصده ممكن سؤال؟ وش سويت غلط عشان اسلوبي مو كويس