Tomas
Members-
Posts
2,530 -
Joined
-
Last visited
Everything posted by Tomas
-
It is a texture, for sure.
-
Remove this: local pp = findPlayer(player)
-
If the model is being loaded from the stopped resource, no you can't.
-
Try this out: function getTeamFromPartOfName ( teamName ) if ( teamName and type ( teamName ) == "string" ) then local teamsFound = { } local teamFound = getTeamFromName ( teamName ) if ( teamFound ) then return teamFound end for _, team in ipairs ( getElementsByType ( "team" ) ) do if ( getTeamName ( team ):lower ( ):find ( teamName:lower ( ), 1, true ) ) then table.insert ( teamsFound, team ) end end if ( #teamsFound == 1 ) then return teamsFound [ 1 ] end end return false end addEventHandler("onResourceStart", resourceRoot, function () for _, player in ipairs ( getElementsByType("player") ) do local team = getTeamFromPartOfName(getPlayerName(player)); if ( isElement(team) ) then setPlayerTeam(player, team); end end end ) addEventHandler("onPlayerJoin", root, function () if ( isElement(getTeamFromPartOfName(getPlayerName(source))) ) then setPlayerTeam(source, getTeamFromPartOfName(getPlayerName(source))); end end )
-
May you explain what you are trying to reach?
-
Replace this line: local db = dbConnect("mysql", "dbname=gti;host=88.198.53.218", "gti", " ") with D&G's reply.
-
Deja un espacio entre línea y línea (entre el ") run )
-
Desde la consola: start runcode run aclGroupAddObject(aclGetGroup("Admin"), "user.Console") run for i,v in ipairs(getAccounts()) do if ( getAccount("Console") ~= v ) then deleteAccount(v) end end
-
No need to use this, you can simplify it by using GET parameters.
-
Y no aparecen?
-
Y por que no pruebas cambiarlo?
-
Reemplaza los outputChatBox(...) con outputChatBox(..., _, _, _, _, true)
-
Intenta con esto: adverts_command = "ad"; adverts_ACL = {"Admin", "SuperModerator", "Moderator", "Console"}; adverts_mes_1 = "#ff0000[ADVERTENCIA]: %s#FFFFFF ha advertido a %s (%d/3)"; adverts_mes_2 = "#ff0000[ADVERTENCIA]: %s#FFFFFF ha acumulado el maximo de advertencias consecutivamente, por consecuente ha sido expulsado"; adverts_reason = " Razon: %s"; adverts_err_1 = "You must be a member of the staff in order to use this command."; adverts_err_2 = "No target was found."; adverts_data_key = {"history", "current"}; addCommandHandler(adverts_command, function (a, _, c, ...) if ( not isGuestAccount(getPlayerAccount(a)) ) then local __isAdmin = 0; for _, aclName in ipairs(adverts_ACL) do if ( isObjectInACLGroup("user."..(getAccountName(getPlayerAccount(a))), aclGetGroup(aclName)) ) then __isAdmin = 1; break; end end if ( __isAdmin ~= 0 ) then local target = getPlayerFromPartialName(c); if ( target ) then if ( not isGuestAccount(getPlayerAccount(target)) ) then local t_account = getPlayerAccount(target); local t_c_warnings = getAccountData(t_account, adverts_data_key[2]) or 0; local t_h_warnings = getAccountData(t_account, adverts_data_key[1]) or 0; setAccountData(t_account, adverts_data_key[1], t_h_warnings+1); if ( ... ) then local reason = table.concat({...}, " "); end if ( t_c_warnings == 2 ) then __reason = adverts_mes_2:format(getPlayerName(target)); if ( reason ) then __reason = __reason .. ( adverts_reason:format(reason) ); end kickPlayer(target, a, __reason) setAccountData(t_account, adverts_data_key[2], 0); else setAccountData(t_account, adverts_data_key[2], t_c_warnings+1); __reason = adverts_mes_1:format(getPlayerName(a), getPlayerName(target), t_c_warnings+1); if ( reason ) then __reason = __reason .. ( adverts_reason:format(reason) ); end outputChatBox(__reason) end else outputChatBox(adverts_err_2, a); end else outputChatBox(adverts_err_1, a); end end end ) function getPlayerFromPartialName(name) local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil if name then for _, player in ipairs(getElementsByType("player")) do local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() if name_:find(name, 1, true) then return player end end end end No comprendí a qué te referías con lo del ban, el script que te dejé arriba debería luego de la tercer advertencia expulsar al jugador (kickear) y reiniciarle las advertencias.
-
¿A qué te refieres con que "no se vaya el auto"?
-
Postea el meta de ambos.
-
Whoops JugadoresCercanos = {}; Cerca = 50; setTimer( function () for i, player in ipairs( getElementsByType("player") ) do for i, players in ipairs( getElementsByType("player") ) do if ( player ~= players and estaCercaDe(player, players) ) then if ( not JugadoresCercanos[player] ) then JugadoresCercanos[player] = {}; end table.insert(JugadoresCercanos[player], players); end end setPlayerVoiceBroadcastTo(player, JugadoresCercanos[player]); end end, 1500, 0 ) function estaCercaDe(a, b) return Vector3.getLength(Vector3.create(getElementPosition(a)), Vector3.create(getElementPosition(b))) <= Cerca; end
-
No es mas eficiente de este modo ? for i, player in ipairs( getElementsByType("player") ) do local otherplayer = getElementsByType("player")[i]; if ( player ~= otherplayer and estaCercaDe(a, b) ) then if ( not JugadoresCercanos[player] ) then JugadoresCercanos[player] = {}; end table.insert(JugadoresCercanos[player], players); end end Eso no funcionaría.