pawn Код:
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
new basededados[200];
format(basedados,200,"%s.ini"PlayerName);
if(strcmp(cmd, "/registrar", true) == 0)
{
tmp = strtok(cmdtext, idx);
new playername[50];
GetPlayerName(playerid, playername, sizeof(playername));
if(20 < strlen(tmp) || strlen(tmp) < 4)
{
SendClientMessage(playerid, COLOR_CYAN, "[RTX] INFORMA: Sua senha tem que ter mais de 4 e menos de 20 letras/nъmeros!");
return 1;
}
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_CYAN, "Uso correto: /registrar [senha] ~ Vai fazer com que vocк fique registrado com o server e seus stats sejam salvos!");
}
else
{
//new basededados[200];
//format(basedados,200,"%s.ini");
if (!dini_Exists(basedados)
{
dini_Create(basedados);
dini_IntSet(basedados, "pass", udb_hash(tmp));
dini_Set(basedados,"senha",tmp);
PlayerInfo[playerid][pAdmin] = 0;
PlayerInfo[playerid][pVIP] = 0;
PlayerInfo[playerid][pCV] = 0;
PlayerInfo[playerid][pADA] = 0;
PlayerInfo[playerid][pPCC] = 0;
PlayerInfo[playerid][pRRB] = 0;
PlayerInfo[playerid][pTCP] = 0;
PlayerInfo[playerid][pEX] = 0;
PlayerInfo[playerid][pBOPE] = 0;
PlayerInfo[playerid][pGOE] = 0;
PlayerInfo[playerid][pMC] = 0;
dini_IntSet(basedados, "level", PlayerInfo[playerid][pAdmin]);
dini_IntSet(basedados, "levelvip", PlayerInfo[playerid][pVIP]);
dini_IntSet(basedados, "levelcv", PlayerInfo[playerid][pCV]);
dini_IntSet(basedados, "levelada", PlayerInfo[playerid][pADA]);
dini_IntSet(basedados, "leveltcp", PlayerInfo[playerid][pTCP]);
dini_IntSet(basedados, "levelbope", PlayerInfo[playerid][pBOPE]);
dini_IntSet(basedados, "levelex", PlayerInfo[playerid][pEX]);
dini_IntSet(basedados, "levelpcc", PlayerInfo[playerid][pPCC]);
dini_IntSet(basedados, "levelrrb", PlayerInfo[playerid][pRRB]);
dini_IntSet(basedados, "levelgoe", PlayerInfo[playerid][pGOE]);
dini_IntSet(basedados, "levelmc", PlayerInfo[playerid][pMC]);
format(string, sizeof(string), "%s(%i) registrado com a senha \"%s\"", playername, playerid, tmp);
printf(string);
format(string, sizeof(string), "Vocк criou a conta %s com a senha \"%s\". Nгo se esqueзa da sua senha!", playername, tmp);
SendClientMessage(playerid, COLOR_CYAN, string);
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
ShowPlayerDialog(playerid, 60, DIALOG_STYLE_LIST, "Bem vindo, escolha uma organizaзгo:", "Comando Vermelho\nAmigos dos Amigos\nTerceiro Comando Puro\nPrimeiro Comando da Capital", "Selecionar", "");
}
else
{
SendClientMessage(playerid, COLOR_YELLOW, "[RTX] INFORMA: Um erro aconteceu enquanto tentava se registrar ao server, vaza fakes");
format(string, sizeof(string), "[RTX] INFORMA: O nick %s jб й registrado nesse server!", playername,tmp);
SendClientMessage(playerid, COLOR_YELLOW, string);
}
}
return 1;
}
// === [Login] ===
if(strcmp(cmd, "/login", true) == 0)
{
if(logged[playerid] == 1)
{
SendClientMessage(playerid, COLOR_CYAN, "Vocк jб estб logado!");
return 1;
}
tmp = strtok(cmdtext, idx);
GetPlayerName(playerid, playername, sizeof(playername));
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREEN, "Uso correto: [senha]");
}
else
{
if(dini_Exists(basedados)
{
if(logged[playerid] == 0)
{
tmp2 = dini_Get(basedados, "pass");
if(udb_hash(tmp) != strval(tmp2))
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Erro! Vocк digitou a senha errada para %s!", PlayerName);
SendClientMessage(playerid, COLOR_RED, string);
}
else
{
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
logged[playerid] = 1;
logado[playerid] = 1;
dini_Set(basedados,"senha",tmp);
PlayerInfo[playerid][pAdmin] = dini_Int(basedados, "level");
PlayerInfo[playerid][pPMs] = dini_Int(basedados, "SeePMs");
PlayerInfo[playerid][pVIP] = dini_Int(basedados, "levelvip");
PlayerInfo[playerid][pCV] = dini_Int(basedados, "levelcv");
PlayerInfo[playerid][pADA] = dini_Int(basedados, "levelada");
PlayerInfo[playerid][pTCP] = dini_Int(basedados, "leveltcp");
PlayerInfo[playerid][pBOPE] = dini_Int(basedados, "levelbope");
PlayerInfo[playerid][pEX] = dini_Int(basedados, "levelex");
PlayerInfo[playerid][pPCC] = dini_Int(basedados, "levelpcc");
PlayerInfo[playerid][pRRB] = dini_Int(basedados, "levelrrb");
PlayerInfo[playerid][pGOE] = dini_Int(basedados, "levelgoe");
PlayerInfo[playerid][pMC] = dini_Int(basedados, "levelmc");
GameTextForPlayer(playerid, "~G~ LOGADO COM SUCESSO!",2000,1);
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
if(PlayerInfo[playerid][pAdmin] == 0)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Logado como: %s", PlayerName);
format(string, sizeof(string), "--------------------------");
format(string, sizeof(string), "Membro Normal");
SendClientMessage(playerid, COLOR_BLUE, string);
}
if(PlayerInfo[playerid][pVIP] == 1)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "VIP Normal");
SendClientMessage(playerid, COLOR_BLUE, string);
GivePlayerMoney(playerid, 100000);
if(PlayerInfo[playerid][pAdmin] == 0)
{
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Logado como: %s", PlayerName);
format(string, sizeof(string), "--------------------------");
format(string, sizeof(string), "Membro Normal");
SendClientMessage(playerid, COLOR_BLUE, string);
} }
if(PlayerInfo[playerid][pCV] == 1)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Fogueteiro do CV");
SendClientMessage(playerid, COLOR_BLUE, string);
}
if(PlayerInfo[playerid][pCV] == 2)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Vapor do CV");
SendClientMessage(playerid, COLOR_BLUE, string);
}
if(PlayerInfo[playerid][pCV] == 3)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Traficante do CV");
SendClientMessage(playerid, COLOR_BLUE, string);
}
if(PlayerInfo[playerid][pCV] == 4)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Dono da Boca do CV");
SendClientMessage(playerid, COLOR_BLUE, string);
}
if(PlayerInfo[playerid][pCV] == 5)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Gerente do CV");
SendClientMessage(playerid, COLOR_BLUE, string);
}
if(PlayerInfo[playerid][pCV] == 6)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "D. do Morro do CV");
SendClientMessage(playerid, COLOR_BLUE, string);
}
if(PlayerInfo[playerid][pPCC] == 1)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Fogueteiro do PCC");
SendClientMessage(playerid, COLOR_BLUE, string);
}
if(PlayerInfo[playerid][pPCC] == 2)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Vapor do PCC");
SendClientMessage(playerid, COLOR_BLUE, string);
}
if(PlayerInfo[playerid][pPCC] == 3)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Traficante do PCC");
SendClientMessage(playerid, COLOR_BLUE, string);
}
if(PlayerInfo[playerid][pPCC] == 4)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Dono da Boca do PCC");
SendClientMessage(playerid, COLOR_BLUE, string);
}
if(PlayerInfo[playerid][pPCC] == 5)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Gerente do PCC");
SendClientMessage(playerid, COLOR_BLUE, string);
}
if(PlayerInfo[playerid][pPCC] == 6)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "D. do Morro do PCC");
SendClientMessage(playerid, COLOR_BLUE, string);
}
if(PlayerInfo[playerid][pTCP] == 1)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Fogueteiro do TCP");
SendClientMessage(playerid, COLOR_BLUE, string);
}
if(PlayerInfo[playerid][pTCP] == 2)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Vapor do TCP");
SendClientMessage(playerid, COLOR_BLUE, string);
}
if(PlayerInfo[playerid][pTCP] == 3)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Traficante do TCP");
SendClientMessage(playerid, COLOR_BLUE, string);
}
if(PlayerInfo[playerid][pTCP] == 4)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Dono da Boca do TCP");
SendClientMessage(playerid, COLOR_BLUE, string);
}
if(PlayerInfo[playerid][pTCP] == 5)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Gerente do TCP");
SendClientMessage(playerid, COLOR_BLUE, string);
}
if(PlayerInfo[playerid][pTCP] == 6)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "D. do Morro do TCP");
SendClientMessage(playerid, COLOR_BLUE, string);
}
if(PlayerInfo[playerid][pADA] == 1)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Fogueteiro do ADA");
SendClientMessage(playerid, COLOR_BLUE, string);
}
if(PlayerInfo[playerid][pADA] == 2)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Vapor do ADA");
SendClientMessage(playerid, COLOR_BLUE, string);
}
if(PlayerInfo[playerid][pADA] == 3)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Traficante do ADA");
SendClientMessage(playerid, COLOR_BLUE, string);
}
if(PlayerInfo[playerid][pADA] == 4)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Dono da Boca do ADA");
SendClientMessage(playerid, COLOR_BLUE, string);
}
if(PlayerInfo[playerid][pADA] == 5)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Gerente do ADA");
SendClientMessage(playerid, COLOR_BLUE, string);
}
if(PlayerInfo[playerid][pADA] == 6)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "D. do Morro do ADA");
SendClientMessage(playerid, COLOR_BLUE, string);
}
if(PlayerInfo[playerid][pRRB] == 1)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Repуrter");
SendClientMessage(playerid, COLOR_BLUE, string);
}
if(PlayerInfo[playerid][pRRB] == 2)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Jornalista");
SendClientMessage(playerid, COLOR_BLUE, string);
}
if(PlayerInfo[playerid][pRRB] == 3)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Vice Diretor");
SendClientMessage(playerid, COLOR_BLUE, string);
}
if(PlayerInfo[playerid][pRRB] == 4)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Diretor");
SendClientMessage(playerid, COLOR_BLUE, string);
}
if(PlayerInfo[playerid][pMC] == 1)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Cantor ( MC )");
SendClientMessage(playerid, COLOR_BLUE, string);
}
if(PlayerInfo[playerid][pBOPE] == 1)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Soldado do BOPE");
SendClientMessage(playerid, COLOR_BLUE, string);
}
if(PlayerInfo[playerid][pBOPE] == 2)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Sargento do BOPE");
SendClientMessage(playerid, COLOR_BLUE, string);
}
if(PlayerInfo[playerid][pBOPE] == 3)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Major do BOPE");
SendClientMessage(playerid, COLOR_BLUE, string);
}
if(PlayerInfo[playerid][pBOPE] == 4)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Capitгo do BOPE");
SendClientMessage(playerid, COLOR_BLUE, string);
}
if(PlayerInfo[playerid][pBOPE] == 5)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Ten.Coronel do BOPE");
SendClientMessage(playerid, COLOR_BLUE, string);
}
if(PlayerInfo[playerid][pBOPE] == 6)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Comandante do BOPE");
SendClientMessage(playerid, COLOR_BLUE, string);
}
if(PlayerInfo[playerid][pEX] == 1)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Soldado do Exercito");
SendClientMessage(playerid, COLOR_BLUE, string);
}
if(PlayerInfo[playerid][pEX] == 2)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Sargento do Exercito");
SendClientMessage(playerid, COLOR_BLUE, string);
}
if(PlayerInfo[playerid][pEX] == 3)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Major do Exercito");
SendClientMessage(playerid, COLOR_BLUE, string);
}
if(PlayerInfo[playerid][pEX] == 4)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Capitгo do Exercito");
SendClientMessage(playerid, COLOR_BLUE, string);
}
if(PlayerInfo[playerid][pEX] == 5)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Ten.Coronel do Exercito");
SendClientMessage(playerid, COLOR_BLUE, string);
}
if(PlayerInfo[playerid][pEX] == 6)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "General do Exercito");
SendClientMessage(playerid, COLOR_BLUE, string);
}
if(PlayerInfo[playerid][pGOE] == 1)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Soldado do GOE");
SendClientMessage(playerid, COLOR_BLUE, string);
}
if(PlayerInfo[playerid][pGOE] == 2)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Sargento do GOE");
SendClientMessage(playerid, COLOR_BLUE, string);
}
if(PlayerInfo[playerid][pGOE] == 3)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Major do GOE");
SendClientMessage(playerid, COLOR_BLUE, string);
}
if(PlayerInfo[playerid][pGOE] == 4)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Capitгo do GOE");
SendClientMessage(playerid, COLOR_BLUE, string);
}
if(PlayerInfo[playerid][pGOE] == 5)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Ten.Coronel do GOE");
SendClientMessage(playerid, COLOR_BLUE, string);
}
if(PlayerInfo[playerid][pGOE] == 6)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Comandante do GOE");
SendClientMessage(playerid, COLOR_BLUE, string);
}
if(PlayerInfo[playerid][pAdmin] == 1)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Administrador [Level 1]");
SendClientMessage(playerid, COLOR_BLUE, string);
format(string, sizeof(string), "~w~ %s ~g~onn", PlayerName);
GameTextForAll(string, 5000, 1);
}
if(PlayerInfo[playerid][pAdmin] == 2)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Administrador [Level 2]");
SendClientMessage(playerid, COLOR_BLUE, string);
format(string, sizeof(string), "~w~ %s ~g~onn", PlayerName);
GameTextForAll(string, 5000, 1);
}
if(PlayerInfo[playerid][pAdmin] == 3)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Administrador [Level 3]");
SendClientMessage(playerid, COLOR_BLUE, string);
IsPlayerAdmin(playerid);
format(string, sizeof(string), "~w~ %s ~g~onn", PlayerName);
GameTextForAll(string, 5000, 1);
}
if(PlayerInfo[playerid][pAdmin] == 4)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Administrador [Level 4");
SendClientMessage(playerid, COLOR_BLUE, string);
IsPlayerAdmin(playerid);
format(string, sizeof(string), "~w~ %s ~g~onn", PlayerName);
GameTextForAll(string, 5000, 1);
}
if(PlayerInfo[playerid][pAdmin] == 5)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Administrador [Level 5]");
SendClientMessage(playerid, COLOR_BLUE, string);
IsPlayerAdmin(playerid);
format(string, sizeof(string), "~w~ %s ~g~onn", PlayerName);
format(string, sizeof(string), "~r~ %s", level[playerid]);
GameTextForAll(string, 5000, 1);
}
if(PlayerInfo[playerid][pAdmin] == 6)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Administrador [Level 6]");
SendClientMessage(playerid, COLOR_BLUE, string);
IsPlayerAdmin(playerid);
format(string, sizeof(string), "~w~ %s ~g~onn", PlayerName);
GameTextForAll(string, 5000, 1);
}
if(PlayerInfo[playerid][pAdmin] == 7)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Administrador [Level 7]");
SendClientMessage(playerid, COLOR_BLUE, string);
IsPlayerAdmin(playerid);
format(string, sizeof(string), "~w~ %s ~g~onn", PlayerName);
GameTextForAll(string, 5000, 1);
}
if(PlayerInfo[playerid][pAdmin] == 8)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Administrador [Level 8]");
SendClientMessage(playerid, COLOR_BLUE, string);
IsPlayerAdmin(playerid);
format(string, sizeof(string), "~w~ %s ~g~onn", PlayerName);
GameTextForAll(string, 5000, 1);
}
if(PlayerInfo[playerid][pAdmin] == 9)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Administrador [Level 9]");
SendClientMessage(playerid, COLOR_BLUE, string);
IsPlayerAdmin(playerid);
format(string, sizeof(string), "~w~ %s ~g~onn", PlayerName);
GameTextForAll(string, 5000, 1);
}
if(PlayerInfo[playerid][pAdmin] == 10)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Administrador [Level 10]");
SendClientMessage(playerid, COLOR_BLUE, string);
IsPlayerAdmin(playerid);
format(string, sizeof(string), "~w~%s ~g~onn", PlayerName);
GameTextForAll(string, 5000, 1);
}
if(PlayerInfo[playerid][pAdmin] == 11)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Administrador [Level 11]");
SendClientMessage(playerid, COLOR_BLUE, string);
IsPlayerAdmin(playerid);
format(string, sizeof(string), "~w~ %s ~g~onn", PlayerName);
GameTextForAll(string, 5000, 1);
}
return 1;
}
}
}
else
{
format(string, sizeof(string), "A conta %s, nгo existe nesse servidor!", playername);
SendClientMessage(playerid, COLOR_CYAN, string);
SendClientMessage(playerid, COLOR_CYAN, "Por favor use /registrar (senha) para se registrar.");
}
}
return 1;
}