29.06.2011, 18:34
(
Последний раз редактировалось [BVE]Lucas_Locate; 29.06.2011 в 19:34.
)
Bom Galera quero uma ajuda com meu cod, Quando me registro tudo bem salva mais depois que sai do servidor
ai quando vou entrar da erro de senha Codigo:
ai quando vou entrar da erro de senha Codigo:
pawn Код:
public OnPlayerConnect(playerid)
{
GivePlayerMoney(playerid, 600000);
PlayerInfo[playerid][SpawnDance] = true;
ApplyAnimation(playerid,"DANCING","DNCE_M_B",4.0,1,0,0,0,-1);
gPlayerLogged[playerid] = 0;
new name[MAX_PLAYER_NAME], file[256];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), SERVER_USER_FILE, name);
if (!dini_Exists(file))
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "{33AA33}Brasil Drift Life", "{E67802}Bem vindo, vocк nгo estб registrado, digite sua senha abaixo", "Registrar", "Sair");
}
if(fexist(file))
{
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "{33AA33}Brasil Drift Life", "{E67802}Bem Vindo, vocк estб registrado, Digite sua senha abaixo ", "Login", "Sair");
}
new pname[MAX_PLAYER_NAME],
string[64];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), " %s Entrou no Servidor!", pname);
SendClientMessageToAll(0x38FF06FF, string);
{
TextDrawShowForPlayer(playerid, Textdraw99);
TextDrawShowForPlayer(playerid, Textdraw88);
TextDrawShowForPlayer(playerid, Textdraw9);
}
return 1;
}
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
new
name[MAX_PLAYER_NAME],
file[256];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), SERVER_USER_FILE, name);
if(gPlayerLogged[playerid] == 1)
{
dini_IntSet(file, "Score", GetPlayerScore(playerid));
dini_IntSet(file, "Money", GetPlayerMoney(playerid));
dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][pAdminLevel]);
dini_IntSet(file, "Banido",PlayerInfo[playerid][pBanned]);
dini_IntSet(file, "Preso",PlayerInfo[playerid][pJailed]);
dini_IntSet(file, "Mudo",PlayerInfo[playerid][pMuted]);
}
gPlayerLogged[playerid] = 0;
KillTimer( PlayerInfo[playerid][SpawnTimer] );
new
pname[MAX_PLAYER_NAME],
string[128];
GetPlayerName(playerid, pname, sizeof(pname));
switch(reason)
{
case 0: format(string, sizeof(string), " %s saiu do servidor. (Crashed)", pname);
case 1: format(string, sizeof(string), " %s saiu do servidor. (Saiu)", pname);
case 2: format(string, sizeof(string), " %s saiu do servidor. (Kicked/Banned)", pname);
}
SendClientMessageToAll(0x2641FEAA, string);
if(VecSpawned[playerid] != -1)
{
DestroyVehicle(VecSpawned[playerid]);
VecSpawned[playerid] = (-1);
}
return 1;
}
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
new file[256];
new string[128];
if (dialogid == 1)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), SERVER_USER_FILE, name);
if(!response) return Kick(playerid);
if (!strlen(inputtext)) return
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Brasil Drift Life", "Bem-vindo, Voзк nгo estб registrada, digite sua senha abaixo", "Register", "Sair");
dini_Create(file);
dini_IntSet(file, "Key", udb_hash(inputtext));
dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][pAdminLevel] = 0);
dini_IntSet(file, "Money",PlayerInfo[playerid][pCash] = 500);
dini_IntSet(file, "Score",PlayerInfo[playerid][pScore] = 0);
dini_IntSet(file, "Preso",PlayerInfo[playerid][pJailed] = 0);
dini_IntSet(file, "Mudo",PlayerInfo[playerid][pMuted] = 0);
dini_IntSet(file, "Banido",PlayerInfo[playerid][pBanned] = 0);
format(string, 128, "[Warning]: Vocк foi registrado com sucesso nickname: %s sua senha: %s, Vocк estб longado.", name, inputtext);
SendClientMessage(playerid, 0xD09C00AA, string);
gPlayerLogged[playerid] = 1;
}
if (dialogid == 2)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), SERVER_USER_FILE, name);
if(!response) return Kick(playerid);
if (!strlen(inputtext)) return ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "{33AA33}Brasil Drift Fife", "{E67802}Digite sua senha abaixo para se cadastrar", "Login", "Sair");
new tmp;
tmp = dini_Int(file, "Password");
if(udb_hash(inputtext) != tmp) {
SendClientMessage(playerid, 0xF08400AA, "Senha errada.");
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "{33AA33}Brasil Drift Life", "{E67802}Digite sua senha abaixo para se cadastrar", "Login", "Sair");
}
else
{
gPlayerLogged[playerid] = 1;
PlayerInfo[playerid][pAdminLevel] = dini_Int(file, "AdminLevel");
SetPlayerScore(playerid, dini_Int(file, "Score"));
GivePlayerCash(playerid, dini_Int(file, "Money"));
PlayerInfo[playerid][pMuted] = dini_Int(file, "Mudo");
PlayerInfo[playerid][pJailed] = dini_Int(file, "Preso");
PlayerInfo[playerid][pBanned] = dini_Int(file, "Banido");
SendClientMessage(playerid,0xF08400AA, "[Warning]: Vocк estб longado!");
}
}
if(dialogid == Dialog)
if(!response) return 1; // Criador de carros para Players nгo fais parte do Registro,Login o codigo Abaixo!!
{
switch(listitem)
{
case 0:
{
new Float:X, Float:Y, Float:Z, Float:Ang, Int, pCarro;
Int = GetPlayerInterior(playerid);
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
GetPlayerInterior(playerid);
pCarro = CreateVehicle(411, X, Y, Z, Ang, -1, -1, -1);
LinkVehicleToInterior(pCarro, Int);
PutPlayerInVehicle(playerid, pCarro, 0);
}
case 1:
{
new Float:X, Float:Y, Float:Z, Float:Ang, Int, pCarro;
Int = GetPlayerInterior(playerid);
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
pCarro = CreateVehicle(451, X, Y, Z, Ang, -1, -1, -1);
LinkVehicleToInterior(pCarro, Int);
PutPlayerInVehicle(playerid, pCarro, 0);
}
case 2:
{
new Float:X, Float:Y, Float:Z, Float:Ang, Int, pCarro;
Int = GetPlayerInterior(playerid);
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
pCarro = CreateVehicle(603, X, Y, Z, Ang, -1, -1, -1);
LinkVehicleToInterior(pCarro, Int);
PutPlayerInVehicle(playerid, pCarro, 0);
}
case 3:
{
new Float:X, Float:Y, Float:Z, Float:Ang, Int, pCarro;
Int = GetPlayerInterior(playerid);
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
pCarro = CreateVehicle(415, X, Y, Z, Ang, -1, -1, -11);
LinkVehicleToInterior(pCarro, Int);
PutPlayerInVehicle(playerid, pCarro, 0);
}
case 4:
{
new Float:X, Float:Y, Float:Z, Float:Ang, Int, pCarro;
Int = GetPlayerInterior(playerid);
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
pCarro = CreateVehicle(429, X, Y, Z, Ang, -1, -1, -1);
LinkVehicleToInterior(pCarro, Int);
PutPlayerInVehicle(playerid, pCarro, 0);
}
case 5:
{
new Float:X, Float:Y, Float:Z, Float:Ang, Int, pCarro;
Int = GetPlayerInterior(playerid);
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
pCarro = CreateVehicle(587, X, Y, Z, Ang, -1, -1, -1);
LinkVehicleToInterior(pCarro, Int);
PutPlayerInVehicle(playerid, pCarro, 0);
}
case 6:
{
new Float:X, Float:Y, Float:Z, Float:Ang, Int, pCarro;
Int = GetPlayerInterior(playerid);
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
pCarro = CreateVehicle(402, X, Y, Z, Ang, -1, -1, -1);
LinkVehicleToInterior(pCarro, Int);
PutPlayerInVehicle(playerid, pCarro, 0);
}
case 7:
{
new Float:X, Float:Y, Float:Z, Float:Ang, Int, pCarro;
Int = GetPlayerInterior(playerid);
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
pCarro = CreateVehicle(571, X, Y, Z, Ang, -1, -1, -1);
LinkVehicleToInterior(pCarro, Int);
PutPlayerInVehicle(playerid, pCarro, 0);
}
case 8:
{
new Float:X, Float:Y, Float:Z, Float:Ang, Int, pCarro;
Int = GetPlayerInterior(playerid);
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
pCarro = CreateVehicle(434, X, Y, Z, Ang, -1, -1, -1);
LinkVehicleToInterior(pCarro, Int);
PutPlayerInVehicle(playerid, pCarro, 0);
}
case 9:
{
new Float:X, Float:Y, Float:Z, Float:Ang, Int, pCarro;
Int = GetPlayerInterior(playerid);
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
pCarro = CreateVehicle(545, X, Y, Z, Ang, -1, -1, -1);
LinkVehicleToInterior(pCarro, Int);
PutPlayerInVehicle(playerid, pCarro, 0);
}
case 10:
{
new Float:X, Float:Y, Float:Z, Float:Ang, Int, pCarro;
Int = GetPlayerInterior(playerid);
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
pCarro = CreateVehicle(480, X, Y, Z, Ang, -1, -1, -1);
LinkVehicleToInterior(pCarro, Int);
PutPlayerInVehicle(playerid, pCarro, 0);
}
case 11:
{
new Float:X, Float:Y, Float:Z, Float:Ang, Int, pCarro;
Int = GetPlayerInterior(playerid);
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
pCarro = CreateVehicle(439, X, Y, Z, Ang, -1, -1, -1);
LinkVehicleToInterior(pCarro, Int);
PutPlayerInVehicle(playerid, pCarro, 0);
}
case 12:
{
new Float:X, Float:Y, Float:Z, Float:Ang, Int, pCarro;
Int = GetPlayerInterior(playerid);
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
pCarro = CreateVehicle(550, X, Y, Z, Ang, -1, -1, -1);
LinkVehicleToInterior(pCarro, Int);
PutPlayerInVehicle(playerid, pCarro, 0);
}
case 13:
{
new Float:X, Float:Y, Float:Z, Float:Ang, Int, pCarro;
Int = GetPlayerInterior(playerid);
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
pCarro = CreateVehicle(495, X, Y, Z, Ang, -1, -1, -1);
LinkVehicleToInterior(pCarro, Int);
PutPlayerInVehicle(playerid, pCarro, 0);
}
case 14:
{
return 1;
}
}
}
return 1;
}