pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
new string[128];
PlayerPlaySound(playerid, 1185, 0.0, 0.0, 0.0);
PlayerInfo[playerid][pModel] = Peds[classid][0];
if (RegistrationStep[playerid] == 0 && gPlayerLogged[playerid] != 1)
{
ClearChatbox(playerid, 10);
format(string, sizeof(string), "Bem vindo ao %s", SCRIPT_VERSION);
SendClientMessage(playerid, COLOR_YELLOW, string);
SendClientMessage(playerid, COLOR_YELLOW2, " ");
if (gPlayerConta[playerid] != 0)
{
GameTextForPlayer(playerid, "~y~ USE: ~n~ ~p~ /logar [senha]", 5000, 1);
SendClientMessage(playerid, COLOR_YELLOW2, "USE: /logar [SENHA] - para acessar a sua conta.");
SendClientMessage(playerid, COLOR_LIGHTRED, "Caso erre ela 3 vezes, serб banido :C !");
}
else
{
GameTextForPlayer(playerid, "~y~ USE: ~n~ ~p~ /registrar [senha]", 5000, 1);
SendClientMessage(playerid, COLOR_YELLOW2, "Este NICK nгo estб registrado em nosso banco de dados.");
SendClientMessage(playerid, COLOR_WHITE, "USE: /registrar [SENHA] - Para cadastrar sua conta em nosso server");
}
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, 1558.7385,-1675.7007,16.1953);
SetPlayerFacingAngle(playerid, 160.0);
SetPlayerCameraPos(playerid, 1506.7966,-1645.9325,22.3203);
SetPlayerCameraLookAt(playerid, 1537.1453,-1670.2620,12.6740);
PlayerInfo[playerid][pModel] = Peds[classid][0];
SetPlayerTeamFromClass(playerid,classid);
}
else SpawnPlayer(playerid);
return false;
=====================================
if (strcmp(cmd, "/logar", true) ==0 )
{
if(IsPlayerConnected(playerid))
{
new tmppass[64];
if(gPlayerLogged[playerid] == 1)
{
SendClientMessage(playerid, COLOR_DBLUE, "[TLC]: Voce ja esta 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;
}
if (strcmp(cmd, "/registrar", true) ==0 )
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 1)
{
SendClientMessage(playerid, COLOR_DBLUE, "[TLC]: Voce ja esta logado.");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s.ini", sendername);
new File: hFile = fopen(string, io_read);
if (hFile)
{
SendClientMessage(playerid, COLOR_YELLOW, "Este Nick ja existe, tente ortro.");
fclose(hFile);
return 1;
}
new tmppass[64];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USE: /registrar [Senha]");
SendClientMessage(playerid, COLOR_YELLOW, "-==> Use Nome_Sobrenome ( Ex: Andre_Felipe ) <==-");
return 1;
}
strmid(tmppass, tmp, 0, strlen(cmdtext), 255);
Encrypt(tmppass);
OnPlayerRegister(playerid,tmppass);
}
return 1;
}