11.06.2011, 19:22
tente,
pawn Code:
if(strcmp(cmd, "/login", true) == 0)
{
new Account[40],Name[MAX_PLAYER_NAME];
GetPlayerName(playerid,Name,sizeof(Name));
format(Account,sizeof(Account),Accounts,Name);
tmp = strtok(cmdtext, idx);
if(logged[playerid] == 1)
{
return SendClientMessage(playerid, COLOR_CYAN, "Vocк jб estб logado!");
}
if(!strlen(tmp))
{
return SendClientMessage(playerid, COLOR_GREEN, "Uso correto: [senha]");
}
else if(dini_Exists(udb_encode(Account)))
{
if(udb_hash(tmp) != dini_Get(udb_encode(Account),"pass"))
{
SendClientMessage(playerid,-1,"Error: Senha incorreta.");
}
else
{
logged[playerid] = 1;
logado[playerid] = 1;
dini_Set(udb_encode(Account),"senha",tmp);
PlayerInfo[playerid][pAdmin] = dini_Int(udb_encode(Account),"level");
PlayerInfo[playerid][pPMs] = dini_Int(udb_encode(Account),"SeePMs");
PlayerInfo[playerid][pVIP] = dini_Int(udb_encode(Account),"levelvip");
PlayerInfo[playerid][pADA] = dini_Int(udb_encode(Account),"levelada");
PlayerInfo[playerid][pTCP] = dini_Int(udb_encode(Account),"leveltcp");
PlayerInfo[playerid][pBOPE] = dini_Int(udb_encode(Account),"levelbope");
PlayerInfo[playerid][pEX] = dini_Int(udb_encode(Account),"levelex");
PlayerInfo[playerid][pPCC] = dini_Int(udb_encode(Account),"levelpcc");
PlayerInfo[playerid][pRRB] = dini_Int(udb_encode(Account),"levelrrb");
PlayerInfo[playerid][pGOE] = dini_Int(udb_encode(Account),"levelgoe");
PlayerInfo[playerid][pCV] = dini_Int(udb_encode(Account),"levelcv");
GameTextForPlayer(playerid, "~G~ LOGADO COM SUCESSO!",2000,1);
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
if(PlayerInfo[playerid][pAdmin] == 0)
{
SendClientMessage(playerid,COLOR_BLUE,"--------------------------");
SendClientMessage(playerid,COLOR_BLUE,"Membro Normal");
format(string,sizeof(string),"Logado como: %s",Name);
SendClientMessage(playerid,COLOR_BLUE,string);
}
}
}
return true;
}