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;
}