Originally Posted by Revelation
lucotaku1: Es un LAdmin modificado de una versiуn del LAdmin 6.2 con 10 Niveles, etc...
Fluid016: No hice muchas modificaciones, sуlo repare un Bug de un Menu RCON en dialogo que cualquiera podнa usar, hasta que lo puse para Admin Nivel 10, y repare algunos diбlogos que hacнan interferencia con otros....
Acб estб mi funciуn OnPlayerDisconnect si la gustan revisar, la verdad es que no encuentro forma de quй algo ahн cause el Lag en el servidor, produciendo que cuando se desconecta un Player, este aparece todavнa conectado adentro del servidor, deja de responder el servidor y no responde el comando "exit" en la consola:
Код:
public OnPlayerDisconnect(playerid, reason)
{
EstaLogueado[playerid] = false;
Fallo[playerid] = 0;
txdAlpha[0][playerid] = 0;
txdAlpha[1][playerid] = 0;
EntroAlEvento[playerid] = 0;
EventoCmd[playerid] = 0;
DudaEnviada[playerid] = 0;
KillTimer(actualizaciones2[playerid]);
new PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
if(ServerInfo[ConnectMessages] == 1)
{
switch (reason) {
case 0: format(str, sizeof(str), "%s [%d] Se ha Desconectado (Crash/Error de conexiуn)", PlayerName, playerid);
case 1: format(str, sizeof(str), "%s [%d] Se ha Desconectado (Salio)", PlayerName, playerid);
case 2: format(str, sizeof(str), "%s [%d] Se ha Desconectado (Kickeado/Baneado)", PlayerName, playerid);
}
for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && playerid != i)
{
if(PlayerInfo[i][Level] > 1) SendClientMessage(i,red,str);
}
}
if(GetPVarInt(playerid, "Reconnecting") == 1)
{
new iStr[128],
iP[16];
GetPVarString(playerid, "RecIP", iP, sizeof(iP));
printf("%s", iP);
format(iStr, sizeof(iStr), "unbanip %s", iP);
SendRconCommand(iStr);
SendRconCommand("reloadbans");
SetPVarInt(playerid, "Reconnecting", 0);
}
if(PlayerInfo[playerid][LoggedIn] == 1) SavePlayer(playerid);
if(udb_Exists(PlayerName2(playerid))) dUserSetINT(PlayerName2(playerid)).("loggedin",0);
PlayerInfo[playerid][LoggedIn] = 0;
PlayerInfo[playerid][Level] = 0;
PlayerInfo[playerid][pVip] = 0;
PlayerInfo[playerid][Hide] = 0;
PlayerInfo[playerid][Jailed] = 0;
PlayerInfo[playerid][Frozen] = 0;
EstaEnFly[playerid] = 0;
YaUsoNuclear[playerid] = 0;
BuscadoPorNuclear[playerid]=0;
HanDesactivadaoLaBomba[playerid]=0;
#if EnableTwoRcon == true
PlayerInfo[playerid][MaxRcon] = 0;
#endif
IPDATA[playerid][Ignore] = false;
if(PlayerInfo[playerid][Jailed] == 1) KillTimer( JailTimer[playerid] );
if(PlayerInfo[playerid][Frozen] == 1) KillTimer( FreezeTimer[playerid] );
if(ServerInfo[Locked] == 1) KillTimer( LockKickTimer[playerid] );
if(PlayerInfo[playerid][pCar] != -1) CarDeleter(PlayerInfo[playerid][pCar]);
ADpm[playerid] = 0;
#if defined ENABLE_SPEC
for(new x=0; x<MAX_PLAYERS; x++)
if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && PlayerInfo[x][SpecID] == playerid)
AdvanceSpectate(x);
#endif
//////////////
if (EnDuelo[playerid]==1)
{
for (new i=1; i<=ARENAS; i++)
{
if ((Duelos[i][DesaId] == playerid || Duelos[i][DesafiadoId] == playerid) && (Duelos[i][Libre]==1))
{
Duelos[i][Libre] = 0;
EnDuelo[Duelos[i][DesaId]] = 0;
EnDuelo[Duelos[i][DesafiadoId]] = 0;
if (playerid == Duelos[i][DesaId])
{
new string6[128];
format(string6,sizeof(string6),"{ED1FE6}Duelo Info: %s a abandonado el servidor en medio de un duelo, %s es el ganador por default.",PlayerName2(playerid),PlayerName2(Duelos[i][DesafiadoId]));
SendClientMessageToAll(COLOR_DUELO,string6);
PlayerInfo[playerid][Dlose] ++;
PlayerInfo[Duelos[i][DesafiadoId]][Dwin] ++;
switch (i)
{
case 1: {SetPlayerPos(Duelos[i][DesafiadoId],2347.3047,1575.4369,39.2732); SetPlayerFacingAngle(Duelos[i][DesafiadoId],270.8635); SetPlayerVirtualWorld(Duelos[i][DesafiadoId], 0);}
case 2: {SetPlayerPos(Duelos[i][DesafiadoId],2464.8000488281,2548.1999511719,10.89999961853); SetPlayerFacingAngle(Duelos[i][DesafiadoId],0.0); SetPlayerVirtualWorld(Duelos[i][DesafiadoId], 0);}
case 3: {SetPlayerPos(Duelos[i][DesafiadoId],2444.6999511719,2548.6999511719,10.89999961853); SetPlayerFacingAngle(Duelos[i][DesafiadoId],0.0); SetPlayerVirtualWorld(Duelos[i][DesafiadoId], 0);}
case 4: {SetPlayerPos(Duelos[i][DesafiadoId],2511.8999023438,2348.1000976563,10.800000190735); SetPlayerFacingAngle(Duelos[i][DesafiadoId],353.4433); SetPlayerVirtualWorld(Duelos[i][DesafiadoId], 0);}
}
for (new j=0; j<= MAX_PLAYERS; j++)
{
if (ViendoDuelo[j] == i)
{
new str2[256];
format(str2,sizeof(str2),"~r~%s ~w~es el ganador del duelo",PlayerName2(Duelos[i][DesafiadoId]));
GameTextForPlayer(j,str2,5000,0);
ViendoDuelo[j] =-1;
}
}
}
if (playerid == Duelos[i][DesafiadoId])
{
new string7[128];
format(string7,sizeof(string7),"{ED1FE6}Duelo Info: %s a abandonado el servidor en medio de un duelo, %s es el ganador por default.",PlayerName2(playerid),PlayerName2(Duelos[i][DesaId]));
SendClientMessageToAll(COLOR_DUELO,string7);
PlayerInfo[playerid][Dlose] ++;
PlayerInfo[Duelos[i][DesaId]][Dwin] ++;
switch (i)
{
case 1: {SetPlayerPos(Duelos[i][DesaId],2347.3047,1575.4369,39.2732); SetPlayerFacingAngle(Duelos[i][DesaId],270.8635); SetPlayerVirtualWorld(Duelos[i][DesaId], 0);}
case 2: {SetPlayerPos(Duelos[i][DesaId],1873.3582763672,1344.1617431641,25.673486709595); SetPlayerFacingAngle(Duelos[i][DesaId],0.0); SetPlayerVirtualWorld(Duelos[i][DesaId], 0);}
case 3: {SetPlayerPos(Duelos[i][DesaId],2444.6999511719,2548.6999511719,10.89999961853); SetPlayerFacingAngle(Duelos[i][DesaId],0.0); SetPlayerVirtualWorld(Duelos[i][DesaId], 0);}
case 4: {SetPlayerPos(Duelos[i][DesaId],2511.8999023438,2348.1000976563,10.800000190735); SetPlayerFacingAngle(Duelos[i][DesaId],353.4433); SetPlayerVirtualWorld(Duelos[i][DesaId], 0);}
}
for (new j=0; j<= MAX_PLAYERS; j++)
{
if (ViendoDuelo[j] == i)
{
new str2[256];
format(str2,sizeof(str2),"~r~%s ~w~es el ganador del duelo",PlayerName2(Duelos[i][DesaId]));
GameTextForPlayer(j,str2,5000,0);
ViendoDuelo[j] =-1;
SetPlayerVirtualWorld(j, 0);
}
}
}
Duelos[i][DesaId] = -1;
Duelos[i][DesafiadoId] = -1;
Duelos[i][ArmasId] = -1;
return 1;
}
}
}
PlayerInfo[playerid][Noduelo] = false;
new OnLine;
for(new i, g = GetMaxPlayers(); i < g; i--)
if(IsPlayerConnected(i))
OnLine--;
return OnLine;
}
|