24.09.2014, 23:46
Hola, tengo un problema a veces tengo una cuenta con nivel administrativo y no puedo logear se me congela la pc o se me cierra el gta, pero si creo otra nueva cuenta funciona normal
si sуlo pasa cuando te logueas pues donde debes buscar?? en la funciуn del logueo
|
public OnPlayerSpawn(playerid) { if(!gPlayerLogged{playerid}) { SendClientMessageEx(playerid, COLOR_WHITE, "ERROR: No has ingresado correctamente al servidor!"); Kick(playerid); return 1; } if(IsPlayerNPC(playerid)) return 1; if(!gPlayerAnimLibsPreloaded[playerid]) { LoadAnimLibs(playerid); gPlayerAnimLibsPreloaded[playerid] = 1; } SetPlayerWantedLevel(playerid, Info[playerid][pWantedLevel]); gTeam[playerid] = Info[playerid][pTeam]; //Set the Team SetPlayerSpawn(playerid); SetPlayerWeapons(playerid); OnDuty[playerid] = 0; SetPlayerToTeamColor(playerid); SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 1); SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI, 1); SyncPlayerTime(playerid); if(Info[playerid][pDutyPolicia] == 1) { { if(Info[playerid][pRank] == 1) SetPlayerSkin(playerid, 280); RadioOn[playerid] = 1; OnDuty[playerid] = 1; Info[playerid][pDutyPolicia] = 1; } { if(Info[playerid][pRank] == 2) SetPlayerSkin(playerid, 281); RadioOn[playerid] = 1; OnDuty[playerid] = 1; Info[playerid][pDutyPolicia] = 1; } { if(Info[playerid][pRank] == 3) SetPlayerSkin(playerid, 266); RadioOn[playerid] = 1; OnDuty[playerid] = 1; Info[playerid][pDutyPolicia] = 1; } { if(Info[playerid][pRank] == 4) SetPlayerSkin(playerid, 265); RadioOn[playerid] = 1; OnDuty[playerid] = 1; Info[playerid][pDutyPolicia] = 1; } { if(Info[playerid][pRank] == 5) SetPlayerSkin(playerid, 281); RadioOn[playerid] = 1; OnDuty[playerid] = 1; Info[playerid][pDutyPolicia] = 1; } { if(Info[playerid][pLeader] == 1) SetPlayerSkin(playerid, 281); RadioOn[playerid] = 1; OnDuty[playerid] = 1; Info[playerid][pDutyPolicia] = 1; } { if(Info[playerid][pSex] == 2) SetPlayerSkin(playerid, 211); RadioOn[playerid] = 1; OnDuty[playerid] = 1; Info[playerid][pDutyPolicia] = 1; } SetPlayerColor(playerid, TEAM_BLUE_COLOR); ShowPlayerMarkers(0); } if(Info[playerid][pDutyPolicia] == 0) { SetPlayerSkin(playerid, Info[playerid][pChar]); SetPlayerColor(playerid, TEAM_HIT_COLOR); } return 1; }
function SafeLogin(playerid) { ClearChatbox(playerid); TextDrawHideForPlayer(playerid, cargando); TextDrawHideForPlayer(playerid, looking); TextDrawHideForPlayer(playerid, box); SetPlayerJoinCamera(playerid); new playername[MAX_PLAYER_NAME]; GetPlayerName(playerid, playername, sizeof(playername)); LoginTimer[playerid] = SetTimerEx("TimerLogin",30000,0,"d",playerid); if(INI_Exist(playername)) { gPlayerAccount[playerid] = 1; ShowMainMenuDialog(playerid, 1); return 1; } else { if(strfind( playername, "_", true) == -1) { SetPlayerName(playerid, "InvalidNick"); SendClientMessageEx(playerid, COLOR_WHITE, "Porfavor usa el formato correcto: Nombre_Apellido"); SendClientMessageEx(playerid, COLOR_WHITE, "Vuelve a entrar con el formato indicado." ); Kick(playerid); } else { gPlayerAccount[playerid] = 0; ShowMainMenuDialog(playerid, 2); } return 1; } } ShowMainMenuDialog(playerid, frame) { new titlestring[28]; new string[256]; InsideMainMenu[playerid] = true; switch(frame) { case 1: { INI_ParseFile(UserPath(playerid), "LoadUser_pass", .bExtra = true, .extra = playerid); new ip[32]; GetPlayerIp(playerid, ip, 32); format(titlestring, sizeof(titlestring), "Esta cuenta estб registrada", GetPlayerNameEx(playerid)); format(string, sizeof(string), "Ingresa tu contraseсa:", ip); SafeDialogEx(playerid,DLOGIN,DIALOG_STYLE_PASSWORD ,titlestring,string,"Entrar","Salir"); SetPlayerVirtualWorld(playerid, 20); } case 2: { new ip[32]; GetPlayerIp(playerid, ip, 32); format(titlestring, sizeof(titlestring), "Registra una nueva cuenta", GetPlayerNameEx(playerid)); format(string, sizeof(string), "Contraseсa:", ip); SafeDialogEx(playerid,DREGISTER,DIALOG_STYLE_INPUT ,titlestring,string,"Registrar","Salir"); SetPlayerVirtualWorld(playerid, 20); } } } ShowMenuLogin(playerid) { ClearChatbox(playerid); new string[128]; for(new i = 0; i < 9; i++) { TextDrawShowForPlayer(playerid, LoginMenu[i]); } TextDrawShowForPlayer(playerid, cargando); TextDrawShowForPlayer(playerid, looking); TextDrawShowForPlayer(playerid, box); TextDrawHideForPlayer(playerid, VortexZone); TextDrawSetString(MOTD, string); TextDrawShowForPlayer(playerid, MOTD); TextDrawSetString(LoginMenu[8], string); return 1; } HideMenuLogin(playerid) { TextDrawHideForPlayer(playerid, MOTD); for(new i = 0; i < 9; i++) { TextDrawHideForPlayer(playerid, LoginMenu[i]); } TextDrawShowForPlayer(playerid, VortexZone); return 1; } function TimerLogin(playerid) { SendClientMessage(playerid,COLOR_GENERAL,"* Han pasado 30 segundos y no ingresaste correctamente, fuiste expulsado automбticamente."); SetPlayerName(playerid,"InvalidNick"); Kick(playerid); }
ShowMenuLogin(playerid)
{
ClearChatbox(playerid);
new string[128];//Aqui la creas
for(new i = 0; i < 9; i++)
{
TextDrawShowForPlayer(playerid, LoginMenu[i]);
}
TextDrawShowForPlayer(playerid, cargando);
TextDrawShowForPlayer(playerid, looking);
TextDrawShowForPlayer(playerid, box);
TextDrawHideForPlayer(playerid, VortexZone);
TextDrawSetString(MOTD, string);//Aca la pones vacia MAL
TextDrawShowForPlayer(playerid, MOTD);
TextDrawSetString(LoginMenu[8], string);//Aca la pones vacia MAL
return 1;
}
new string[128];//Creas una variable string vacia
TextDrawSetString(LoginMenu[8], string);//Se la asignas a este textdraw, Ўvacнa!