19.10.2010, 00:56
as vezes (nem sempre) qdo se digita /logar e senha, crash o server.
pawn Код:
if (strcmp(cmd, "/logar", true) ==0)
{
new tmp[256];
new tmppass[64];
tmp = strtok(cmdtext, idx);
new FilePathUser[256];
format(FilePathUser, sizeof(FilePathUser), "%s%s.ini",UserFiles,PlayerInfo[playerid][Name]);
if(IsPlayerConnected(playerid))
{
if (!dini_Exists(FilePathUser))
{
SendClientMessage(playerid, ErrorColor, "[BCC]: Vocк nгo estб registrado.");
return 1;
}
if(PlayerInfo[playerid][Loged] == 1)
{
SendClientMessage(playerid, ErrorColor, "[BCC]: Voce jб esta logado.");
return 1;
}
if(!strlen(tmp))
{
SendClientMessage(playerid,ErrorColor, "[BCC]: /logar [Senha]");
return 1;
}
if(!IsValidPassword(tmp)) return SendClientMessage(playerid,ErrorColor,"[BCC]: Caractere invбlido");
new password;
format(FilePathUser, sizeof(FilePathUser), "%s%s.ini",UserFiles,PlayerInfo[playerid][Name]);
strmid(PlayerInfo[playerid][pKey], dini_Get(FilePathUser,"Pass"), 0, strlen(dini_Get(FilePathUser,"Pass")), 255);
strmid(tmppass, tmp, 0, strlen(cmdtext), 255);
Encrypt(tmppass);
if(strcmp(PlayerInfo[playerid][pKey],tmppass, true ) == 0 )
{
LoadPlayerConfig(playerid);
SendClientMessage(playerid,BroadCastColor,"Logado com sucesso!");
PlayerInfo[playerid][Loged] = 1;
SpawnPlayer(playerid);
CheckOwnerh(playerid);
CheckOwners(playerid);
CheckOwnerc(playerid);
}
else{
SendClientMessage(playerid,ErrorColor,"Senha Incorreta!");
}
}
return 1;
}