Venho perdir ajuda a vocкs ..
tenho meu sistema de registro aqui feito por min e cheguei a encontrar problemas..
quando vou criar uma nova conta , ele nгo da Spawn, sendo que o "DialogSexo" й oque da spawn , mas nгo aparece apуs o registro.
pawn Код:
if (dialogid == REGISTRO)
{
new sFile[256];
format(sFile, sizeof(sFile), PASTA_CONTAS, GetName(playerid));
if (response == 1)
{
DOF2_CreateFile(sFile);
DOF2_SetString(sFile, "Senha", inputtext);
DOF2_SetInt(sFile, "Profissao", 0);
DOF2_SetInt(sFile, "HTerrestre", 0);
DOF2_SetInt(sFile, "HAerea", 0);
DOF2_SetInt(sFile, "HNautica", 0);
DOF2_SetInt(sFile, "Preso", 0);
DOF2_SetInt(sFile, "TempoPreso", 0);
DOF2_SetInt(sFile, "Level", 0);
DOF2_SetInt(sFile, "TempoLevel", 0);
DOF2_SetInt(sFile, "Experiencia", 0);
DOF2_SetInt(sFile, "Gasolina", 30);
DOF2_SetInt(sFile, "TemJP", 0);
DOF2_SetInt(sFile, "LogoSAMP", 0);
DOF2_SetInt(sFile, "TemPSurf", 0);
DOF2_SetInt(sFile, "PorteArmas", 0);
DOF2_SetInt(sFile, "NivelAdmin", 0);
DOF2_SetInt(sFile, "Vip", 0);
DOF2_SetInt(sFile, "Skin", 299);
DOF2_SetInt(sFile, "Banido", 0);
DOF2_SetInt(sFile, "EstiloLuta", 0);
SetPlayerSkin(playerid, DOF2_GetInt(sFile, "Skin"));
SetPlayerColor(playerid, 0xFFFFFFAA);
PlayerPlaySound(playerid, 1057, 0, 0, 0);
Level[playerid] = 0;
Gasolina[playerid] = 30;
EstaPreso[playerid] = 0;
TempoLevel[playerid] = 0;
Experiencia[playerid] = 0;
IsAdmin[playerid] = 0;
IsVip[playerid] = 0;
Profissao[playerid] = Desempregado;
//
ShowPlayerDialog(playerid, DialogSexo, DIALOG_STYLE_MSGBOX, "Sexo", "Qual й seu sexo?", "Masculino", "Feminino");
new xd[150];
format(xd, sizeof(xd), "{FFFAFA}• Vocк se registrou com a senha: {FFDAB9}'%s'{FFFAFA}, Guarde-a pois serб nessesбrio para ter acesso a sua conta novamente.", inputtext);
PlayerInfo[playerid][Logado] = 1;
SendClientMessage(playerid, Vermelho, xd);
new ano, mes, dia2, stringd[30], stringh[30], Hour, Minute, Second;
getdate(ano, mes, dia2);
format(stringd, sizeof(stringd), " (%d/%d/%d)", dia2, mes, ano);
gettime(Hour, Minute, Second);
format(stringh, sizeof(stringh), " (%d:%d:%d)", Hour, Minute, Second);
DOF2_SetString(sFile, "Logou", stringd);
DOF2_SetString(sFile, "Horas", stringh);
PlayerInfo[playerid][Logado] = 1;
DOF2_SaveFile();
}
else
{
format(StringDL, sizeof(StringDL), "{1E90FF}Usuбrio {FFFAFA}: %s\n{1E90FF}Status da Conta {FFFAFA}: {FF0000}Nгo Registrada\n{1E90FF}Insira uma senha e clique em {FFFAFA}'Registrar'", nome(playerid));
ShowPlayerDialog(playerid, REGISTRO, DIALOG_STYLE_PASSWORD, "Conta", StringDL, "Registrar", "Sair");
}
}
if(dialogid == DialogSexo)
{
new sFile[60];
format(sFile, sizeof(sFile), PASTA_CONTAS, GetName(playerid));
if(response == 1)
{
SetPlayerSkin(playerid, 299);
DOF2_SetInt(sFile, "Skin", 299);
DOF2_SetFloat(sFile, "SpawnX", 608.2704);
DOF2_SetFloat(sFile, "SpawnY", -1458.6222);
DOF2_SetFloat(sFile, "SpawnZ", 14.3811);
SetSpawnInfo(playerid, 1, DOF2_GetInt(sFile, "Skin"), DOF2_GetFloat(sFile, "SpawnX"), DOF2_GetFloat(sFile, "SpawnY"), DOF2_GetFloat(sFile, "SpawnZ"), 354.1657, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
}
else
{
SetPlayerSkin(playerid, 65);
DOF2_SetInt(sFile, "Skin", 65);
DOF2_SetFloat(sFile, "SpawnX", 608.2704);
DOF2_SetFloat(sFile, "SpawnY", -1458.6222);
DOF2_SetFloat(sFile, "SpawnZ", 14.3811);
SetSpawnInfo(playerid, 1, DOF2_GetInt(sFile, "Skin"), DOF2_GetFloat(sFile, "SpawnX"), DOF2_GetFloat(sFile, "SpawnY"), DOF2_GetFloat(sFile, "SpawnZ"), 354.1657, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
}
return 1;
}
if (dialogid == LOGIN)
{
new Arq[256];
format(Arq, sizeof(Arq), PASTA_CONTAS, GetName(playerid));
if (response == 1)
{
new senhaacc[256];
senhaacc = DOF2_GetString(Arq, "Senha");
if (strcmp(inputtext, senhaacc, true) == 0)
{
PlayerInfo[playerid][Logado] = 1;
GivePlayerGrana(playerid, DOF2_GetInt(Arq, "Dinheiro"));
SetSpawnInfo(playerid, 0, DOF2_GetInt(Arq, "Skin"), DOF2_GetFloat(Arq, "SpawnX"), DOF2_GetFloat(Arq, "SpawnY"), DOF2_GetFloat(Arq, "SpawnZ"), 354.1657, 0, 0, 0, 0, 0, 0);
//
IsAdmin[playerid] = DOF2_GetInt(Arq, "NivelAdmin");
IsVip[playerid] = DOF2_GetInt(Arq, "Vip");
SetPlayerSkin(playerid, DOF2_GetInt(Arq, "Skin"));
Experiencia[playerid] = DOF2_GetInt(Arq, "Experiencia");
TempoLevel[playerid] = DOF2_GetInt(Arq, "TempoLevel");
Gasolina[playerid] = DOF2_GetInt(Arq, "Gasolina");
Profissao[playerid] = DOF2_GetInt(Arq, "Profissao");
//
TemJP[playerid] = DOF2_GetInt(Arq, "TemJP");
LogoSAMP[playerid] = DOF2_GetInt(Arq, "LogoSAMP");
TemPSurf[playerid] = DOF2_GetInt(Arq, "TemPSurf");
//
Level[playerid] = DOF2_GetInt(Arq, "Level");
SetPlayerFightingStyle(playerid, DOF2_GetInt(Arq, "Lutas"));
AtualizarCSpawn(playerid);
AtualizarCores(playerid);
SetPlayerInterior(playerid, 0);
new ano, mes, dia2, stringd[30], stringh[30], Hour, Minute, Second;
getdate(ano, mes, dia2);
format(stringd, sizeof(stringd), " (%d/%d/%d)", dia2, mes, ano);
gettime(Hour, Minute, Second);
format(stringh, sizeof(stringh), " (%d:%d:%d)", Hour, Minute, Second);
DOF2_SetString(Arq, "Logou", stringd);
DOF2_SetString(Arq, "Horas", stringh);
//
TextDrawHideForPlayer(playerid, BoxIntro);
TextDrawHideForPlayer(playerid, IntroText1);
TextDrawHideForPlayer(playerid, IntroText2);
TextDrawHideForPlayer(playerid, IntroText3);
TextDrawHideForPlayer(playerid, IntroText4);
TextDrawShowForPlayer(playerid, TextBaixo1);
SpawnPlayer(playerid);
DOF2_SaveFile();
}
else
{
PlayerInfo[playerid][LoginsFalsos]++;
if (PlayerInfo[playerid][LoginsFalsos] >= 3)
{
format(StringDL, sizeof(StringDL), "( Info ) %s foi kickado automaticamente. ( %d tentativas de login)", GetName(playerid), 3);
SendClientMessageToAll(0x00C1C1AA, StringDL);
SendDeathMessage(INVALID_PLAYER_ID, playerid, 0);
SetPlayerColor(playerid, 0xFFFFFFAA);
Kick(playerid);
}
else
{
format(StringDL, sizeof(StringDL), "{1E90FF}Senha Incorreta!\n{1E90FF}Insira sua senha e clique em {FFFAFA}'Logar'", nome(playerid));
ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_PASSWORD, "Conta", StringDL, "Logar", "Sair");
}
}
}
else
{
format(StringDL, sizeof(StringDL), "{1E90FF}Usuбrio {FFFAFA}: %s\n{1E90FF}Status da Conta {FFFAFA}: Registrada\n{1E90FF}Insira sua senha e clique em {FFFAFA}'Logar'", nome(playerid));
ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_PASSWORD, "Conta", StringDL, "Logar", "Sair");
}
}
em public OnPlayerSpawn pegue as coordenadas do jogador na pasta onde vocк salvou SpawnX, SpawnY e SpawnZ, e sete a posiзгo dele, em registro e login coloque dessa forma.
Ele vai forзar a spawnar o player e nisso chamando a callback OnPlayerSpawn, lб й onde vocк deve colocar as coordenadas da posiзгo do player.
Ok ok VLw .. mais tirei tou com uma dъvida aqui testei esse bug com meu amigo..
mas apуs ele sair reinicei o servidor e o registrei normalmente..
mais agora vou mandar ele entrar para ver se estб dando conflito entre players..
Nгo obtive resultados bons..
estive a testar e quando um player registrado estб on , quem vai se registrar reconhe-se como se esse "Alguem" que vai registrar й o que jб estб registrado assim bugando a porra toda , alguem poderia me ajudar? cуdigo logo acima