Jump to content

Cadu12

Retired Staff
  • Posts

    827
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Cadu12

  1. I did it for you function StringMoreThanMore(str, number) local morethanmore = 0 local morethanmore2 = 0 for i=1, #str do morethanmore = morethanmore + 1 if string.sub(str, morethanmore, morethanmore) == " " then morethanmore2 = morethanmore2 + 1 end end if number == morethanmore2 then return true end return false end function testing(player, command, ...) local Spaces = { ... } local String = table.concat( Spaces, " " ) if StringMoreThanMore(String, 4) then outputChatBox("TRUE: " .. String) else outputChatBox("FALSE: " .. String) end end addCommandHandler("helps", testing) To use this: if StringMoreThanMore("Como vai?", 1) then: return true if StringMoreThanMore("Test test", 3) then: return false if StringMoreThanMore("Test test test test", 3) then: return true
  2. https://forum.multitheftauto.com/viewtop ... 0e#p346554 Edit: If you mean invite player from others server? if yes then you cant
  3. go away, its realy steal, noboyt will help you.
  4. Cadu12

    Problems

    Look at line 10. Change to bindKey( player, "u", "down",locl )
  5. Cadu12

    Black screen 1.1

    I have this problem too.... I hate black screen
  6. You're welcome. Good race gamemode
  7. 1. Stop running old autoteams 2. Put your Tag variables 3. Add admin in ACL
  8. Yes and, What do you mean? if you mean chat tag "[FG]Capy"? if yes then yes if you have any ideas, viewtopic.php?f=108&t=35477
  9. Edit: Fixed, it was string.find bugged, copy again my post Edit2: WTF IS THAT BUGGED, I did pressed "Edit" then he made post
  10. @SnoopCat Its server side @Capy: [FG] -> %[FG%] Tags = { {"%=FoX%=", "=FoX= Members", "#770000", nil}, {"%|T%|", "Testing Members", "#555555", nil} {"%[FG%]", "[FG] Members", "#770000", nil}, }
  11. I did created myself it toady and works https://community.multitheftauto.com/index.php?p= ... ls&id=2855 Server-side: Tags = { {"YCN%|", "Your clan name", "#00bb9b", nil} } ATCarcolor = true ATNormalColor = {255, 255, 255} ATFixspam = {} function onResourceStartAutoteams() for name, data in ipairs(Tags) do for id, player in ipairs(getElementsByType("player")) do table.insert(ATFixspam, {source, false}) if string.find(getPlayerName(player), data[1]) then if not isElement(data[2]) or getElementType(data[2]) ~= "team" then creatingTeam = createTeam(data[2], getColorFromString (data[3])) if creatingTeam then outputDebugString("Autoteams: Added team '" .. data[2] .. "'.") data[4] = creatingTeam end end setTimer(function() local int = {} for name, data in ipairs(Tags) do for id, player in ipairs(getElementsByType("player")) do if string.find(getPlayerName(player), data[1]) then movedteam = setPlayerTeam(player, data[4]) if not movedteam then MoveToTeam = getTeamFromName(data[2]) if getPlayerTeam(player) and getFixspam(player) == false then outputDebugString("Autoteams: Set '" .. getPlayerName(player) .. "' to team as '" .. data[2] .. "'.") setFixspam(player, true) end setPlayerTeam(player, MoveToTeam) elseif getPlayerTeam(player) and getFixspam(player) == false then outputDebugString("Autoteams: Set '" .. getPlayerName(player) .. "' to team as '" .. data[2] .. "'.") setFixspam(player, true) end end end end end, 2000, 1) end end end end addEventHandler( "onResourceStart", getResourceRootElement(getThisResource()), onResourceStartAutoteams ) function onPlayerChangeNickAutoteams() setTimer(checkPlayerTeam, 1000, 1, source) end addEventHandler("onPlayerChangeNick", getRootElement(), onPlayerChangeNickAutoteams) function onPlayerJoinAutoteams() setTimer(checkPlayerTeam, 1000, 1, source) table.insert(ATFixspam, {source, false}) end addEventHandler("onPlayerJoin", getRootElement(), onPlayerJoinAutoteams) function onPlayerQuitAutoteams() -- Remove teams if players are not team for i, v in ipairs(ATFixspam) do if v[1] == source then table.remove(ATFixspam, i) end end returnPlayerTeam = getPlayerTeam(source) if returnPlayerTeam then outputDebugString("Autoteams: Removed '" .. getPlayerName(source) .. "' from team as '" .. getTeamName(returnPlayerTeam) .. "'.") if countPlayersInTeam(returnPlayerTeam) == 0 then outputDebugString("Autoteams: Removed team '" .. returnPlayerTeam .. "'.") destroyElement(returnPlayerTeam) end end end addEventHandler("onPlayerQuit", getRootElement(), onPlayerQuitAutoteams) function checkPlayerTeam(player) local publicplayer = player for name, data in ipairs(Tags) do if string.find(getPlayerName(player), data[1]) then if not isElement(data[4]) or getElementType(data[4]) ~= "team" then creatingTeam = createTeam(data[2], getColorFromString(data[3])) if creatingTeam then outputDebugString("Autoteams: Added team '" .. data[2] .. "'.") data[4] = creatingTeam end end setTimer(function() for name, data in ipairs(Tags) do if string.find(getPlayerName(publicplayer), data[1]) then movedteam = setPlayerTeam(publicplayer, data[4]) if not movedteam then MoveToTeam = getTeamFromName(data[2]) setPlayerTeam(player, MoveToTeam) if getPlayerTeam(player) and getFixspam(player) == false then outputDebugString("Autoteams: Set '" .. getPlayerName(player) .. "' to team as '" .. data[2] .. "'.") setFixspam(player, true) end elseif getPlayerTeam(player) and getFixspam(player) == false then outputDebugString("Autoteams: Set '" .. getPlayerName(player) .. "' to team as '" .. data[2] .. "'.") setFixspam(player, true) end end end end, 2000, 1) else -- Remove teams if players are not team returnPlayerTeam = getPlayerTeam(player) if returnPlayerTeam then outputDebugString("Autoteams: Removed '" .. getPlayerName(player) .. "' from team as '" .. getTeamName(returnPlayerTeam) .. "'.") setPlayerTeam(player, nil) setFixspam(player, false) if countPlayersInTeam(returnPlayerTeam) == 0 then outputDebugString("Autoteams: Removed team '" .. getTeamName(returnPlayerTeam) .. "'.") destroyElement(returnPlayerTeam) end end end end end function setFixspam(player, boolean) for i, v in ipairs(ATFixspam) do if v[1] == player then v[2] = boolean end end end function getFixspam(player) if not ATFixspam then return end for i, v in ipairs(ATFixspam) do if v[1] == player then return v[2] end end end For whos wants blips for race, add line: function onRaceEveryTime() for _,player in ipairs(getElementsByType("player")) do if not getPlayerTeam(player) then checkPlayerTeam(player) end if ATCarcolor == true then local r,g,b = ATNormalColor[1], ATNormalColor[2], ATNormalColor[3] local team = getPlayerTeam(player) if team then r,g,b = getTeamColor(team) end local PedIsInVehicle = getPedOccupiedVehicle(player) if PedIsInVehicle then setVehicleHeadLightColor(PedIsInVehicle, tonumber(r), tonumber(g), tonumber(b)) setVehicleColor(PedIsInVehicle, tonumber(r), tonumber(g), tonumber(b)) end local attachElement = getAttachedElements(player) if attachElement and #attachElement > 0 then for k, v in ipairs(attachElement) do if getElementType(v) and getElementType(v) == "blip" then setBlipColor(v, tonumber(r), tonumber(g), tonumber(b), 255) end end end end end end setTimer(onRaceEveryTime, 250, 0) Changelogs: 1.0: First public release 1.1: Fixed bugged 1.2: Fixed bugged. Added team color for blips 1.3: Fixed bugged for blips 1.4: Added event for race 1.5: • Fixed bugs 1.6 • Fixed bugs 2.0 • Fixed bugs • Fixed spammer on debugscript Add credis if you used
  12. I did created myself it toady and works Tags = { {"%=FoX%=", "=FoX= Members", "#770000", nil}, {"%|T%|", "Testing Members", "#555555", nil}, {"%[FG%]", "[FG] Members", "#770000", nil} } function onResourceStartAutoteams() for name, data in ipairs(Tags) do --outputChatBox(" TEST: " .. name .. " " .. data[1] .. " " .. data[2] ) -- This is only for Test for id, player in ipairs(getElementsByType("player")) do if string.find(getPlayerName(player), data[1]) then --outputChatBox( "Founded: " .. getPlayerName(players) .. " as " .. data[2]) -- This is only for Test if not isElement(data[2]) or getElementType(data[2]) ~= "team" then creatingTeam = createTeam( data[2], getColorFromString ( data[3] ) ) if creatingTeam then outputDebugString( "Autoteams: Added team '" .. data[2] .. "'." ) data[4] = creatingTeam end end setTimer(function() for name, data in ipairs(Tags) do for id, player in ipairs(getElementsByType("player")) do if string.find(getPlayerName(player), data[1]) then movedteam = setPlayerTeam ( player, data[4] ) if not movedteam then MoveToTeam = getTeamFromName( data[2] ) outputDebugString( "Autoteams: Set '" .. getPlayerName(player) .. "' to team as '" .. data[2] .. "'." ) setPlayerTeam ( player, MoveToTeam ) return end outputDebugString( "Autoteams: Set '" .. getPlayerName(player) .. "' to team as '" .. data[2] .. "'." ) end end end end, 1000, 1) end end end end addEventHandler( "onResourceStart", getResourceRootElement(getThisResource()), onResourceStartAutoteams ) function onPlayerChangeNickAutoteams() setTimer(checkPlayerTeam, 1000, 1, source) end addEventHandler("onPlayerChangeNick", getRootElement(), onPlayerChangeNickAutoteams) function onPlayerJoinAutoteams() setTimer(checkPlayerTeam, 1000, 1, source) end addEventHandler( "onPlayerJoin", getRootElement(), onPlayerJoinAutoteams ) function onPlayerQuitAutoteams() -- Remove teams if players are not team returnPlayerTeam = getPlayerTeam( source ) if returnPlayerTeam then setPlayerTeam( source, nil ) if countPlayersInTeam(returnPlayerTeam) == 0 then destroyElement(returnPlayerTeam) end end end addEventHandler( "onPlayerQuit", getRootElement(), onPlayerQuitAutoteams ) function checkPlayerTeam(player) local publicplayer = player for name, data in ipairs(Tags) do if string.find(getPlayerName(player), data[1]) then if not isElement(data[4]) or getElementType(data[4]) ~= "team" then creatingTeam = createTeam( data[2], getColorFromString ( data[3] ) ) if creatingTeam then outputDebugString( "Autoteams: Added team '" .. data[2] .. "'." ) data[4] = creatingTeam end end setTimer(function() for name, data in ipairs(Tags) do if string.find(getPlayerName(player), data[1]) then movedteam = setPlayerTeam ( publicplayer, data[4] ) if not movedteam then MoveToTeam = getTeamFromName( data[2] ) outputDebugString( "Autoteams: Set '" .. getPlayerName(publicplayer) .. "' to team as '" .. data[2] .. "'." ) setPlayerTeam ( publicplayer, MoveToTeam ) return end outputDebugString( "Autoteams: Set '" .. getPlayerName(publicplayer) .. "' to team as '" .. data[2] .. "'." ) end end end, 2000, 1) else -- Remove teams if players are not team returnPlayerTeam = getPlayerTeam( player ) if returnPlayerTeam then setPlayerTeam( player, nil ) if countPlayersInTeam(returnPlayerTeam) == 0 then destroyElement(returnPlayerTeam) end end end end end Add credis if you used
  13. Cadu12

    Help Manager

    CapY, are you stealing, they you are gay dude. Oh yep, i remember that you want ask MTA Team to change client-side to server-side, thats you want stealing. proof: viewtopic.php?f=102&t=35190 if he deleted his topic:
  14. Cadu12

    login

    Doesnt work, you dont have local to getLogin/getPassword wong: LoginUsername EditRegisterUsername Sorry i cant help, if you tell me whats guiCreateEdit for login and password then i can help you edit: maybe GUIEditor_Edit[3] and GUIEditor_Edit[4] ?
  15. Cadu12

    Register denied

    function registerHandler(player, username, password) -> function registerHandler(player, command, username, password)
  16. Cadu12

    Hello

    Good that you moved to MTA MTA wins
  17. I tinhk it is possible or not. Good job idea diegofkda
  18. Change to setAccountData(conta,"char."..tostring(i), tonumber(v)) Se vc quer ajudar, me add no skype
  19. onPlayerJoin doesnt works with set/getAccountData, becuase he didnt used /login if he connected Only you have to use command /login and then get/setAccountData P.S: Are you from brazil? I am from brazil too
  20. I got a idea, you can create a new functuin called "guiChangeSkin" or "guiSetTheme" (only for client-side)
×
×
  • Create New...