Jump to content

kikear al server


BorderLine

Recommended Posts

Posted

taba intentando hacer para kikear a todo el server, pero no pude.

Bueno como soy novato intente esto

  
local players = getElementsByType ( "player" ) 
function kickall () 
for theKey,thePlayer in ipairs(players) do  
kickPlayer ( players, "Server will be closed. Back in 1 or 2 hours."  ) 
end 
end 
addEventHandler ( "onResourceStart", getRootElement(), kickall ) 

el drama es que no funciona, aunke nunca entendi mucho el for theKey

Actual Nick: [XGN]BorderLine

Actual Clan: XLatino

Actual Status: Staff, Mod Level 1

(BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline

Posted
function kickall ( ) 
    local players = getElementsByType ( "player" ) 
    for theKey, thePlayer in ipairs ( players ) do 
        kickPlayer ( thePlayer, nil, "Server will be closed. Back in 1 or 2 hours."  ) -- Es "thePlayer", no "players". 
    end 
end 
addEventHandler ( "onResourceStart", resourceRoot, kickall ) 

Acordate de darle permiso en el acl.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

si, el drama es que cuando lo apago, a todos les da time out. y las cuentas algunas cosas, como el dinero, zombiekills las habilidades se pierden desde la ultima vez que entraste al server

tonses los kikeo a todos, se guardan sus habilidades y dinero y de ai procedo a ponerle pass al server

y solid, me tiro un error

close function at line 4

Actual Nick: [XGN]BorderLine

Actual Clan: XLatino

Actual Status: Staff, Mod Level 1

(BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline

Posted
si, el drama es que cuando lo apago, a todos les da time out. y las cuentas algunas cosas, como el dinero, zombiekills las habilidades se pierden desde la ultima vez que entraste al server

tonses los kikeo a todos, se guardan sus habilidades y dinero y de ai procedo a ponerle pass al server

y solid, me tiro un error

close function at line 4

sobra un end

Developer @ MYVAL

Posted

Debe ser otra cosa, probe mi codigo y funciona perfectamente.

P.D: @Alexs_Steel: No sobra ningun end, 1 end para terminar el loop y el otro para terminar la funcion.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

con el "addEventHandler ( "onResourceStart", resourceRoot, kickall )" se kikean al empezar el script

si quieres comando puedes cambiarle a addCommandHandler("comando",kickall)

Actual Nick: [XGN]BorderLine

Actual Clan: XLatino

Actual Status: Staff, Mod Level 1

(BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...