18.04.2010, 19:44
Ae as linhas
//---------------------------<[ OnDialogResponse ]>--------------------------------------------------------
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),"Perigo!\nP or favor digite a senha corretamente!:",loginname);
ShowPlayerDialog(playerid,12347,DIALOG_STYLE_INPUT ,"Logar",loginstring,"Logar","Sair");
gPlayerLogTries[playerid] += 1;
if(gPlayerLogTries[playerid] == 5) { 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, "That Username is already taken, please choose a different one.");
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, %s\nVocк nгo tem conta.\nPor favor registre-se:",regname);
ShowPlayerDialog(playerid,12345,DIALOG_STYLE_INPUT ,"Registrar",regstring,"Registrar","Sair");
}
}
}
else
{
Kick(playerid);
}
return 1;
}
----------------------------------------------------------------------------------------------------------------------------------
public OnPlayerRequestClass(playerid, classid)
{
ClearChatbox(playerid, 10);
SendClientMessage(playerid, COLOR_GREEN, " ~ Bem Vindo ao Brasil Xtreme Life! ~");
SendClientMessage(playerid, COLOR_RED, " ");
SendClientMessage(playerid, COLOR_YELLOW2, " ");
SendClientMessage(playerid, COLOR_YELLOW2, " ");
SendClientMessage(playerid, COLOR_YELLOW2, " ");
SendClientMessage(playerid, COLOR_YELLOW2, " ");
SendClientMessage(playerid, COLOR_YELLOW2, " ");
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, %s\nEsse nick й registrado.\nVocк pode logar-se:",loginname);
ShowPlayerDialog(playerid,12346,DIALOG_STYLE_INPUT ,"Logar",loginstring,"Logar","Sair");
}
else
{
gPlayerAccount[playerid] = 0;
new regstring[128];
new regname[64];
GetPlayerName(playerid,regname,sizeof(regname));
format(regstring,sizeof(regstring),"Bem Vindo, %s\nVocк nгo tem conta.\nPor favor registre-se:",regname);
ShowPlayerDialog(playerid,12345,DIALOG_STYLE_INPUT ,"Registrar",regstring,"Registrar","Sair");
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "USE: Voce pode se registrar - Para cadastrar sua conta em nosso server");
ShowPlayerDialog(playerid,12345,DIALOG_STYLE_INPUT ,"Registrar",regstring,"Registrar","Sair");
//PlayerPlaySound(playerid, 1187, 0.0, 0.0, 0.0);
PlayerInfo[playerid][pModel] = Peds[classid][0];
SetPlayerTeamFromClass(playerid,classid);
}
else SpawnPlayer(playerid);
return true;
----------------------------------------------------------------------------------------------------------------------------------
Essas sгo as linhas
//---------------------------<[ OnDialogResponse ]>--------------------------------------------------------
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),"Perigo!\nP or favor digite a senha corretamente!:",loginname);
ShowPlayerDialog(playerid,12347,DIALOG_STYLE_INPUT ,"Logar",loginstring,"Logar","Sair");
gPlayerLogTries[playerid] += 1;
if(gPlayerLogTries[playerid] == 5) { 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, "That Username is already taken, please choose a different one.");
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, %s\nVocк nгo tem conta.\nPor favor registre-se:",regname);
ShowPlayerDialog(playerid,12345,DIALOG_STYLE_INPUT ,"Registrar",regstring,"Registrar","Sair");
}
}
}
else
{
Kick(playerid);
}
return 1;
}
----------------------------------------------------------------------------------------------------------------------------------
public OnPlayerRequestClass(playerid, classid)
{
ClearChatbox(playerid, 10);
SendClientMessage(playerid, COLOR_GREEN, " ~ Bem Vindo ao Brasil Xtreme Life! ~");
SendClientMessage(playerid, COLOR_RED, " ");
SendClientMessage(playerid, COLOR_YELLOW2, " ");
SendClientMessage(playerid, COLOR_YELLOW2, " ");
SendClientMessage(playerid, COLOR_YELLOW2, " ");
SendClientMessage(playerid, COLOR_YELLOW2, " ");
SendClientMessage(playerid, COLOR_YELLOW2, " ");
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, %s\nEsse nick й registrado.\nVocк pode logar-se:",loginname);
ShowPlayerDialog(playerid,12346,DIALOG_STYLE_INPUT ,"Logar",loginstring,"Logar","Sair");
}
else
{
gPlayerAccount[playerid] = 0;
new regstring[128];
new regname[64];
GetPlayerName(playerid,regname,sizeof(regname));
format(regstring,sizeof(regstring),"Bem Vindo, %s\nVocк nгo tem conta.\nPor favor registre-se:",regname);
ShowPlayerDialog(playerid,12345,DIALOG_STYLE_INPUT ,"Registrar",regstring,"Registrar","Sair");
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "USE: Voce pode se registrar - Para cadastrar sua conta em nosso server");
ShowPlayerDialog(playerid,12345,DIALOG_STYLE_INPUT ,"Registrar",regstring,"Registrar","Sair");
//PlayerPlaySound(playerid, 1187, 0.0, 0.0, 0.0);
PlayerInfo[playerid][pModel] = Peds[classid][0];
SetPlayerTeamFromClass(playerid,classid);
}
else SpawnPlayer(playerid);
return true;
----------------------------------------------------------------------------------------------------------------------------------
Essas sгo as linhas