Originally Posted by Scratchy_Nutz
pawn Код:
public OnPlayerRequestClass(playerid, classid) { new string[128]; PlayerPlaySound(playerid, 1097, 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 (gPlayerAccount[playerid] != 0) { new loginstring[128]; new loginname[64]; GetPlayerName(playerid,loginname,sizeof(loginname)); format(loginstring,sizeof(loginstring),"Bem Vindo ao San Francisco Life Brasil, %s\nEste nick esta registrado.\nVoce pode logar agora:",loginname); ShowPlayerDialog(playerid,12346,DIALOG_STYLE_INPUT,"Logar",loginstring,"Logar","Sair"); } else { new regstring[128]; new regname[64]; GetPlayerName(playerid,regname,sizeof(regname)); SendClientMessage(playerid, 0xD900D3C8, "Voce ainda nao esta registrado use Nome_Sobrenome Ex:Marco_Nutz"); format(regstring,sizeof(regstring),"Bem Vindo ao San Francisco Life Brasil, %s\nvoce nao tem uma conta.\nPor favor registre-se:",regname); ShowPlayerDialog(playerid,12345,DIALOG_STYLE_INPUT,"Registrar",regstring,"Registrar","Sair"); } 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; }
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { //new sendername[MAX_PLAYER_NAME]; new string[128]; if(response) { if(dialogid == 12346 || dialogid == 12347) { if(strlen(inputtext)) { new tmppass[64]; strmid(tmppass, inputtext, 0, strlen(inputtext), 255); Encrypt(tmppass); OnPlayerLogin(playerid,tmppass); } else { new loginstring[128]; new loginname[64]; GetPlayerName(playerid,loginname,sizeof(loginname)); format(loginstring,sizeof(loginstring),"<SFLBR> Senha Erada\nPor favor informe a senha correta:",loginname); ShowPlayerDialog(playerid,12347,DIALOG_STYLE_INPUT,"Logar",loginstring,"Logar","Sair"); gPlayerLogTries[playerid] += 1; if(gPlayerLogTries[playerid] == 4) { Ban(playerid); } } } if(dialogid == 12345) { if(strlen(inputtext)) { 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 nome foi Registrado com Sucesso!"); fclose(hFile); return 1; } new tmppass[64]; strmid(tmppass, inputtext, 0, strlen(inputtext), 255); Encrypt(tmppass); OnPlayerRegister(playerid,tmppass); } else { new regstring[128]; new regname[64]; GetPlayerName(playerid,regname,sizeof(regname)); format(regstring,sizeof(regstring),"Bem Vindo ao San Francisco Life Brasil, %s\nVoce nao tem uma conta.\nPor favor registre-se:",regname); ShowPlayerDialog(playerid,12345,DIALOG_STYLE_INPUT,"Registrar",regstring,"Registrar","Sair"); } } } else { Kick(playerid); } return 1; }
e no onplayerregister, em baixo do Maried To (GM Godfather)
pawn Код:
fclose(hFile);ShowPlayerDialog(playerid, 12346, DIALOG_STYLE_INPUT, "Login", "Bem Vindo ao San Francisco Life Brasil v1.5\nDigite sua Senha para Logar!!!\nSe errar a senha 5 vezes serб banido por serguranзa", "Logar", "Sair"); } } return 1; }
bom, й isso =D
|