pawn Код:
if (strcmp(cmd, "/registrar", true) ==0 )
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GREY, " Vocк jб estб logado.");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "Players/%s.ini", sendername);
new File: hFile = fopen(string, io_read);
if (hFile)
{
SendClientMessage(playerid, COLOR_YELLOW, "Este Nick jб existe, use outro.");
fclose(hFile);
return 1;
}
new tmppass[128];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USE: /registrar [Senha]");
return 1;
}
getdate(year, month, day);
strmid(tmppass, tmp, 0, strlen(cmdtext), 255);
format(gstring, sizeof(gstring), "AdmCmd: %s Registrou no Servidor (%d-%d-%d), Senha: %s", PlayerName(playerid),day,month,year,tmppass);
RegistroLog(gstring);
format(gstring, sizeof(gstring), "AdmCmd: %s Registrou no Servidor (%d-%d-%d), Senha: %s", PlayerName(playerid),day,month,year,tmppass);
SoEuVejoMsm(COLOR_YELLOW, gstring);
Encrypt(tmppass);
OnPlayerRegister(playerid,tmppass);
}
return 1;
}
pawn Код:
if (strcmp(cmd, "/logar", true) ==0 )
{
if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
{
new tmppass[128];
if(gPlayerLogged[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GREY, " Vocк jб estб logado.");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USE: /logar [Senha]");
return 1;
}
strmid(tmppass, tmp, 0, strlen(cmdtext), 255);
Encrypt(tmppass);
OnPlayerLogin(playerid,tmppass);
}
return 1;
}