[Ajuda] Alguem pode me ajudar em um sistema de login e registro
#1

Antes que falem pra eu estudar ou pra eu ir para outro tуpico para aprender, saiba que jб fiz isso, e atй consegui fazer sozinho um sistema de save com DOF2 (Um grande passo para um novato) , mas a parte que falta ainda implementar no GM й o de registrar e logar na conta , mas n posso abrir qualquer topico com um tutorial pq eu jб montei meu prуprio sistema de salvar, e poderia dar conflito!

Resumindo : Preciso do sistema de registro e login que deia pra encaixar no que eu jб fiz:
PHP код:
//            INCLUDES                           //
#include <a_samp>
#include <zcmd>
#include <DOF2>
// DEFINES //
// ENUMS //
enum pInfo
{
pDinheiro,
pSkin,
pTrabalho,
};
// NEW'S//
new PlayerInfo[MAX_PLAYERS][pInfo];
//Callbacks//
public OnPlayerConnect(playerid)
{
//Sistema carregar ou criar Conta//
new File[70], sendername[MAX_PLAYER_NAME];
GetPlayerName(playeridsendernamesizeof(sendername));
format(Filesizeof(File), "%s.ini"sendername);
if(
DOF2_FileExists(File))
{
PlayerInfo[playerid][pDinheiro] = DOF2_GetInt(File"Dinheiro");
PlayerInfo[playerid][pSkin] = DOF2_GetInt(File"Skin");
PlayerInfo[playerid][pTrabalho] = DOF2_GetInt(File"Trabalho");
SendClientMessage(playerid, -1"Perfil carregado com sucesso");
}
else
{
DOF2_CreateFile(File);
DOF2_SetInt(File"Skin"97);
DOF2_SetInt(File"Dinheiro"5000);
DOF2_SetInt(File"Trabalho"0);
DOF2_SaveFile();
SendClientMessage(playerid, -1"Perfil criado com sucesso. Aproveite!");
OnPlayerConnect(playerid);
}
return 
1;
}
public 
OnPlayerDisconnect(playerid)
{
new 
File[70], sendername[MAX_PLAYER_NAME];
GetPlayerName(playeridsendernamesizeof(sendername));
format(Filesizeof(File), "%s.ini"sendername);
DOF2_SetInt(File"Skin"PlayerInfo[playerid][pSkin]);
DOF2_SetInt(File"Dinheiro"PlayerInfo[playerid][pDinheiro]);
DOF2_SetInt(File"Trabalho"PlayerInfo[playerid][pTrabalho]);
DOF2_SaveFile();
return 
1;
}
public 
OnPlayerSpawn(playerid)
{
SetPlayerSkin(playeridPlayerInfo[playerid][pSkin]);
GivePlayerMoney(playeridPlayerInfo[playerid][pDinheiro]);
PlayerInfo[playerid][pTrabalho] = DOF2_GetInt("%.ini""Trabalho");

Reply
#2

Amigo crie dialog.. vc jб fez o sistema pelo que eu vi no OnPlayerConnect

Pesquise : Como criar dialog no samp

Ai vc vai criar aquela caixinha de dialogo que tem nos sv.
Reply
#3

Quote:
Originally Posted by C4rtm4n
Посмотреть сообщение
Amigo crie dialog.. vc jб fez o sistema pelo que eu vi no OnPlayerConnect

Pesquise : Como criar dialog no samp

Ai vc vai criar aquela caixinha de dialogo que tem nos sv.
Ah sim, ok, Obrigado vou procurar aqui.
Reply
#4

Ai vc faz assim Cara
PHP код:
public OnPlayerConnect(playerid)
{
if(
DOF2_FileExists(File))
{
 
AQUI A DIALOG LOGIN
}
else {
 
Aqui a dialog Registro
}
return 
1;

E a parte que carrega e cria a acc tu coloca na resposta do Dialog
Reply
#5

Quote:
Originally Posted by C4rtm4n
Посмотреть сообщение
Ai vc faz assim Cara
PHP код:
public OnPlayerConnect(playerid)
{
if(
DOF2_FileExists(File))
{
 
AQUI A DIALOG LOGIN
}
else {
 
Aqui a dialog Registro
}
return 
1;

C:\Users\Ailton\Desktop\PAWNO\gamemodes\Gamemodese mnome.pwn(184) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.



E a parte que carrega e cria a acc tu coloca na resposta do Dialog
Nao fiz desse jeito, sу que do jeito que fiz deu 1 erro, serб que pra corrigir precisa fzr dessa forma q tu falou? Olha ae:
PHP код:
//            INCLUDES                           //
#include <a_samp>
#include <zcmd>
#include <DOF2>
// DEFINES //
#define     DIALOG_REGISTRO         1
#define     DIALOG_LOGAR            2
// ENUMS //
enum pInfo
{
pDinheiro,
pSkin,
pTrabalho,
pSenha,
};
// NEW'S//
new PlayerInfo[MAX_PLAYERS][pInfo];
new 
Erro[MAX_PLAYERS];
//Callbacks//
public OnPlayerConnect(playerid)
{
//Sistema carregar ou criar Conta//
new File[70], sendername[MAX_PLAYER_NAME];
GetPlayerName(playeridsendernamesizeof(sendername));
format(Filesizeof(File), "%s.ini"sendername);
if(
DOF2_FileExists(File))
{
PlayerInfo[playerid][pDinheiro] = DOF2_GetInt(File"Dinheiro");
PlayerInfo[playerid][pSkin] = DOF2_GetInt(File"Skin");
PlayerInfo[playerid][pTrabalho] = DOF2_GetInt(File"Trabalho");
SendClientMessage(playerid, -1"Perfil carregado com sucesso");
ShowPlayerDialog(playeridDIALOG_LOGARDIALOG_STYLE_PASSWORD"Logar""Vocк й Registrado, digite sua senha para logar!\nSe errar 5 vezes sua conta serб banida!""Confirma""Cancelar");
}
else
{
DOF2_CreateFile(File);
DOF2_SetInt(File"Skin"97);
DOF2_SetInt(File"Dinheiro"5000);
DOF2_SetInt(File"Trabalho"0);
DOF2_SaveFile();
ShowPlayerDialog(playeridDIALOG_REGISTRODIALOG_STYLE_INPUT"Registro""Vocк ainda nгo й Registrado, digite uma senha para se registrar!""Confirma""Cancelar");
SendClientMessage(playerid, -1"Perfil criado com sucesso. Aproveite!");
OnPlayerConnect(playerid);
//Veiculos
AddStaticVehicleEx(510,1255.8000000,-2044.3000000,59.2000000,0.0000000,-1,-1,15); //Mountain Bike
AddStaticVehicleEx(510,1255.1000000,-2044.2000000,59.2000000,0.0000000,-1,-1,15); //Mountain Bike
AddStaticVehicleEx(510,1254.2000000,-2044.3000000,59.3000000,0.0000000,-1,-1,15); //Mountain Bike
AddStaticVehicleEx(510,1253.5000000,-2044.3000000,59.3000000,0.0000000,-1,-1,15); //Mountain Bike
AddStaticVehicleEx(510,1252.7000000,-2044.3000000,59.3000000,0.0000000,-1,-1,15); //Mountain Bike
AddStaticVehicleEx(510,1269.4000000,-2044.9000000,58.8000000,0.0000000,-1,-1,15); //Mountain Bike
AddStaticVehicleEx(510,1270.2000000,-2045.0000000,58.8000000,0.0000000,-1,-1,15); //Mountain Bike
AddStaticVehicleEx(510,1270.8000000,-2045.0000000,58.8000000,0.0000000,-1,-1,15); //Mountain Bike
AddStaticVehicleEx(510,1271.3000000,-2045.0000000,58.8000000,0.0000000,-1,-1,15); //Mountain Bike
AddStaticVehicleEx(510,1271.9000000,-2045.0000000,58.8000000,0.0000000,-1,-1,15); //Mountain Bike
//Objetos e Interiores
CreateObject(1280,1279.3000000,-2036.3000000,58.4000000,0.0000000,0.0000000,0.0000000); //object(parkbench1) (1)
CreateObject(1280,1279.4000000,-2031.3000000,58.4000000,0.0000000,0.0000000,0.0000000); //object(parkbench1) (2)
CreateObject(1280,1279.2000000,-2017.8000000,58.3000000,0.0000000,0.0000000,0.0000000); //object(parkbench1) (3)
CreateObject(1280,1279.2000000,-2012.9000000,58.3000000,0.0000000,0.0000000,0.0000000); //object(parkbench1) (4)
CreateObject(1280,1243.3000000,-2035.3000000,59.3000000,0.0000000,0.0000000,180.0000000); //object(parkbench1) (5)
CreateObject(1280,1243.3000000,-2029.1000000,59.3000000,0.0000000,0.0000000,179.9950000); //object(parkbench1) (6)
CreateObject(1280,1243.6000000,-2018.0000000,59.3000000,0.0000000,0.0000000,180.0000000); //object(parkbench1) (7)
CreateObject(1280,1243.6000000,-2011.8000000,59.3000000,0.0000000,0.0000000,180.0000000); //object(parkbench1) (8)
CreateObject(7033,1262.7000000,-2038.2000000,62.9000000,0.0000000,0.0000000,360.0000000); //object(vgnhsegate02) (1)
CreateObject(14846,1560.2000000,-1676.9000000,-251.5000000,0.0000000,0.0000000,0.0000000); //object(int_ppol) (5)
CreateObject(1535,1545.0000000,-1682.9000000,-253.8999900,0.0000000,0.0000000,88.0000000); //object(gen_doorext14) (2)
CreateObject(1535,1545.0000000,-1680.0000000,-253.8999900,0.0000000,0.0000000,271.9950000); //object(gen_doorext14) (5)
CreateObject(1535,1545.0000000,-1682.9000000,-253.8999900,0.0000000,358.0000000,269.9950000); //object(gen_doorext14) (6)
CreateObject(2610,1549.1000000,-1692.1000000,-253.1000100,0.0000000,0.0000000,178.0000000); //object(cj_p_fileing2) (1)
CreateObject(2610,1549.6000000,-1692.1000000,-253.1000100,0.0000000,0.0000000,177.9950000); //object(cj_p_fileing2) (2)
CreateObject(2610,1552.8000000,-1692.0000000,-253.1000100,0.0000000,0.0000000,177.9950000); //object(cj_p_fileing2) (3)
CreateObject(2610,1553.2000000,-1692.0000000,-253.1000100,0.0000000,0.0000000,177.9950000); //object(cj_p_fileing2) (4)
CreateObject(1671,1552.9000000,-1686.7000000,-253.5000000,0.0000000,0.0000000,270.0000000); //object(swivelchair_a) (1)
CreateObject(2008,1551.7000000,-1687.7000000,-253.8999900,0.0000000,0.0000000,92.0000000); //object(officedesk1) (1)
CreateObject(2309,1550.4000000,-1688.0000000,-253.8999900,0.0000000,0.0000000,286.0000000); //object(med_office_chair2) (1)
CreateObject(1704,1546.0000000,-1691.0000000,-253.8999900,0.0000000,0.0000000,90.0000000); //object(kb_chair03) (1)
CreateObject(1704,1545.9000000,-1689.2000000,-253.8999900,0.0000000,0.0000000,90.0000000); //object(kb_chair03) (2)
CreateObject(1963,1551.2000000,-1692.1000000,-253.6000100,0.0000000,0.0000000,358.0000000); //object(est_desk) (1)
CreateObject(2330,1561.2000000,-1662.8000000,-252.5000000,0.0000000,0.0000000,0.0000000); //object(cj_bedroom1_w) (2)
CreateObject(2330,1563.7000000,-1663.7000000,-252.5000000,0.0000000,0.0000000,274.0000000); //object(cj_bedroom1_w) (3)
CreateObject(2605,1559.8000000,-1666.1000000,-252.1000100,0.0000000,0.0000000,0.0000000); //object(polce_desk1) (1)
CreateObject(2604,1561.9000000,-1670.4000000,-251.7000000,0.0000000,0.0000000,0.0000000); //object(cj_police_counter) (1)
CreateObject(2607,1559.8000000,-1665.3000000,-252.1000100,0.0000000,0.0000000,0.0000000); //object(polce_desk2) (2)
CreateObject(3109,1556.0000000,-1660.7000000,-251.3000000,0.0000000,0.0000000,90.0000000); //object(imy_la_door) (2)
CreateObject(2184,1550.2000000,-1668.5000000,-252.5000000,0.0000000,0.0000000,96.0000000); //object(med_office6_desk_2) (1)
CreateObject(1714,1551.0000000,-1666.6000000,-252.5000000,0.0000000,0.0000000,0.0000000); //object(kb_swivelchair1) (1)
CreateObject(1714,1551.0000000,-1668.7000000,-252.5000000,0.0000000,0.0000000,252.0000000); //object(kb_swivelchair1) (2)
CreateObject(2724,1548.3000000,-1667.6000000,-252.0000000,0.0000000,0.0000000,96.0000000); //object(lm_stripchair) (1)
CreateObject(3109,1564.0000000,-1656.8000500,-251.3000000,0.0000000,0.0000000,90.0000000); //object(imy_la_door) (3)
CreateObject(2634,1558.7000000,-1660.8000000,-251.3999900,0.0000000,0.0000000,180.0000000); //object(ab_vaultdoor) (1)
CreateObject(334,1558.7000000,-1657.2000000,-251.5000000,0.0000000,0.0000000,0.0000000); //object(1)
CreateObject(348,1559.1000000,-1657.2000000,-251.2000000,0.0000000,0.0000000,0.0000000); //object(2)
CreateObject(351,1559.6000000,-1657.2000000,-250.8999900,359.1660000,97.9570000,358.0580000); //object(3)
CreateObject(356,1559.2000000,-1657.2000000,-251.8000000,0.0000000,0.0000000,0.0000000); //object(4)
CreateObject(373,1558.2000000,-1659.4000000,-251.1000100,328.7360000,326.6860000,355.1660000); //object(5)
CreateObject(370,1557.8000000,-1659.0000000,-251.2000000,0.0000000,0.0000000,0.0000000); //object(7)
CreateObject(1974,1558.6000000,-1657.2000000,-250.8000000,0.0000000,0.0000000,340.0000000); //object(kb_golfball) (1)
CreateObject(1974,1559.8000000,-1657.2000000,-250.8000000,0.0000000,0.0000000,339.9990000); //object(kb_golfball) (2)
CreateObject(1974,1559.8000000,-1657.2000000,-252.1000100,0.0000000,0.0000000,339.9990000); //object(kb_golfball) (4)
CreateObject(1974,1558.4000000,-1657.2000000,-252.1000100,0.0000000,0.0000000,339.9990000); //object(kb_golfball) (6)
CreateObject(1974,1558.6000000,-1657.1000000,-252.1000100,0.0000000,0.0000000,339.9990000); //object(kb_golfball) (7)
CreateObject(3036,1567.7000000,-1701.1000000,-254.8000000,0.0000000,0.0000000,0.0000000); //object(ct_gatexr) (1)
CreateObject(3036,1558.7000000,-1701.0000000,-254.8000000,0.0000000,0.0000000,0.0000000); //object(ct_gatexr) (2)
CreateObject(3036,1563.2000000,-1701.0000000,-254.8000000,0.0000000,0.0000000,0.0000000); //object(ct_gatexr) (3)
CreateObject(3036,1572.2000000,-1701.1000000,-254.8000000,0.0000000,0.0000000,0.0000000); //object(ct_gatexr) (4)
CreateObject(2514,1553.4000000,-1695.7000000,-254.3000000,0.0000000,0.0000000,0.0000000); //object(cj_toilet1) (1)
}
return 
1;
}
public 
OnPlayerDisconnect(playerid)
{
new 
File[70], sendername[MAX_PLAYER_NAME];
GetPlayerName(playeridsendernamesizeof(sendername));
format(Filesizeof(File), "%s.ini"sendername);
DOF2_SetInt(File"Skin"PlayerInfo[playerid][pSkin]);
DOF2_SetInt(File"Dinheiro"PlayerInfo[playerid][pDinheiro]);
DOF2_SetInt(File"Trabalho"PlayerInfo[playerid][pTrabalho]);
DOF2_SaveFile();
return 
1;
}
public 
OnPlayerSpawn(playerid)
{
SetPlayerSkin(playeridPlayerInfo[playerid][pSkin]);
GivePlayerMoney(playeridPlayerInfo[playerid][pDinheiro]);
PlayerInfo[playerid][pTrabalho] = DOF2_GetInt("%.ini""Trabalho");
}
public 
OnGameModeInit()
{
//Comandos Gerais//
UsePlayerPedAnims();
}
public 
OnGameModeExit()
{
    
DOF2_Exit();
    return 
1;
}
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
new 
File[70], sendername[MAX_PLAYER_NAME];
GetPlayerName(playeridsendernamesizeof(sendername));
format(Filesizeof(File), "%s.ini"sendername);
if(
dialogid == DIALOG_REGISTRO)
{
if(!
strval(inputtext)) //Verifica se o player digitou LETRAS, caso for true
//Retorna a dialog de registro novamente para ele digitar NЪMEROS
ShowPlayerDialog(playeridDIALOG_REGISTRODIALOG_STYLE_INPUT"Registro""Digite apenas nъmeros!\nDigite sua senha novamente para se registrar!""Confirma""Cancelar");
return 
1;
}
if(!
response//Verifica se ele clicar em 'Cancelar"
//Caso ele clicar em cancelar, irб retornar ao playerid KICK
Kick(playerid);
return 
1;
}
else 
//Verifica se ele Confirma o Registro
//Caso for true, ira criar o arquivo
PlayerInfo[playerid][pSenha] = strval(inputtext);
DOF2_SetInt(File"Senha"PlayerInfo[playerid][pSenha]);
DOF2_SaveFile();
ShowPlayerDialog(playeridDIALOG_LOGARDIALOG_STYLE_PASSWORD"Logar""Vocк se cadastrou, agora й sу logar com sua senha registrada!""Confirma""Cancelar");
}
}
if(
dialogid == DIALOG_LOGAR)
{
if(!
strval(inputtext)) //Verifica se o player digitou letras, caso for true
{
ShowPlayerDialog(playeridDIALOG_LOGARDIALOG_STYLE_PASSWORD"Logar""Digite apenas nъmeros!\nDigite sua senha cadastrada para logar!\nSe errar 5 vezes sua conta serб banida!""Confirma""Cancelar");
return 
1;
}
if(!
response//Verifica se ele clicar em 'Cancelar"
//Caso ele clicar em cancelar, irб retornar ao playerid KICK
Kick(playerid);
return 
1;
}
else 
//Verifica se ele Confirma o Login
{
PlayerInfo[playerid][pSenha] = DOF2_GetInt(File"Senha");
if(
strval(inputtext) == PlayerInfo[playerid][pSenha])
SpawnPlayer(playerid);
}
else
{
ShowPlayerDialog(playeridDIALOG_LOGARDIALOG_STYLE_PASSWORD"Logar""Vocк digitou sua senha errado, digite-a novamente para logar!\nSe errar 5 vezes irб ser kickado!""Confirma""Cancelar");
Erro[playerid]++; //O erro vai aumentar cada vez que ele errar
if(Erro[playerid] == 5//Quando chegar а 5 vezes, irб retornar a msg e o Ban
{
SendClientMessage(playerid, -1"Vocк foi kickado!");
Kick(playerid);
return 
1;
}
}
}
return 
1;

Reply
#6

Quote:
Originally Posted by Kledson
Посмотреть сообщение
Nao fiz desse jeito, sу que do jeito que fiz deu 1 erro, serб que pra corrigir precisa fzr dessa forma q tu falou? Olha ae:
PHP код:
//            INCLUDES                           //
#include <a_samp>
#include <zcmd>
#include <DOF2>
// DEFINES //
#define     DIALOG_REGISTRO         1
#define     DIALOG_LOGAR            2
// ENUMS //
enum pInfo
{
pDinheiro,
pSkin,
pTrabalho,
pSenha,
};
// NEW'S//
new PlayerInfo[MAX_PLAYERS][pInfo];
new 
Erro[MAX_PLAYERS];
//Callbacks//
public OnPlayerConnect(playerid)
{
//Sistema carregar ou criar Conta//
new File[70], sendername[MAX_PLAYER_NAME];
GetPlayerName(playeridsendernamesizeof(sendername));
format(Filesizeof(File), "%s.ini"sendername);
if(
DOF2_FileExists(File))
{
PlayerInfo[playerid][pDinheiro] = DOF2_GetInt(File"Dinheiro");
PlayerInfo[playerid][pSkin] = DOF2_GetInt(File"Skin");
PlayerInfo[playerid][pTrabalho] = DOF2_GetInt(File"Trabalho");
SendClientMessage(playerid, -1"Perfil carregado com sucesso");
ShowPlayerDialog(playeridDIALOG_LOGARDIALOG_STYLE_PASSWORD"Logar""Vocк й Registrado, digite sua senha para logar!\nSe errar 5 vezes sua conta serб banida!""Confirma""Cancelar");
}
else
{
DOF2_CreateFile(File);
DOF2_SetInt(File"Skin"97);
DOF2_SetInt(File"Dinheiro"5000);
DOF2_SetInt(File"Trabalho"0);
DOF2_SaveFile();
ShowPlayerDialog(playeridDIALOG_REGISTRODIALOG_STYLE_INPUT"Registro""Vocк ainda nгo й Registrado, digite uma senha para se registrar!""Confirma""Cancelar");
SendClientMessage(playerid, -1"Perfil criado com sucesso. Aproveite!");
OnPlayerConnect(playerid);
//Veiculos
AddStaticVehicleEx(510,1255.8000000,-2044.3000000,59.2000000,0.0000000,-1,-1,15); //Mountain Bike
AddStaticVehicleEx(510,1255.1000000,-2044.2000000,59.2000000,0.0000000,-1,-1,15); //Mountain Bike
AddStaticVehicleEx(510,1254.2000000,-2044.3000000,59.3000000,0.0000000,-1,-1,15); //Mountain Bike
AddStaticVehicleEx(510,1253.5000000,-2044.3000000,59.3000000,0.0000000,-1,-1,15); //Mountain Bike
AddStaticVehicleEx(510,1252.7000000,-2044.3000000,59.3000000,0.0000000,-1,-1,15); //Mountain Bike
AddStaticVehicleEx(510,1269.4000000,-2044.9000000,58.8000000,0.0000000,-1,-1,15); //Mountain Bike
AddStaticVehicleEx(510,1270.2000000,-2045.0000000,58.8000000,0.0000000,-1,-1,15); //Mountain Bike
AddStaticVehicleEx(510,1270.8000000,-2045.0000000,58.8000000,0.0000000,-1,-1,15); //Mountain Bike
AddStaticVehicleEx(510,1271.3000000,-2045.0000000,58.8000000,0.0000000,-1,-1,15); //Mountain Bike
AddStaticVehicleEx(510,1271.9000000,-2045.0000000,58.8000000,0.0000000,-1,-1,15); //Mountain Bike
//Objetos e Interiores
CreateObject(1280,1279.3000000,-2036.3000000,58.4000000,0.0000000,0.0000000,0.0000000); //object(parkbench1) (1)
CreateObject(1280,1279.4000000,-2031.3000000,58.4000000,0.0000000,0.0000000,0.0000000); //object(parkbench1) (2)
CreateObject(1280,1279.2000000,-2017.8000000,58.3000000,0.0000000,0.0000000,0.0000000); //object(parkbench1) (3)
CreateObject(1280,1279.2000000,-2012.9000000,58.3000000,0.0000000,0.0000000,0.0000000); //object(parkbench1) (4)
CreateObject(1280,1243.3000000,-2035.3000000,59.3000000,0.0000000,0.0000000,180.0000000); //object(parkbench1) (5)
CreateObject(1280,1243.3000000,-2029.1000000,59.3000000,0.0000000,0.0000000,179.9950000); //object(parkbench1) (6)
CreateObject(1280,1243.6000000,-2018.0000000,59.3000000,0.0000000,0.0000000,180.0000000); //object(parkbench1) (7)
CreateObject(1280,1243.6000000,-2011.8000000,59.3000000,0.0000000,0.0000000,180.0000000); //object(parkbench1) (8)
CreateObject(7033,1262.7000000,-2038.2000000,62.9000000,0.0000000,0.0000000,360.0000000); //object(vgnhsegate02) (1)
CreateObject(14846,1560.2000000,-1676.9000000,-251.5000000,0.0000000,0.0000000,0.0000000); //object(int_ppol) (5)
CreateObject(1535,1545.0000000,-1682.9000000,-253.8999900,0.0000000,0.0000000,88.0000000); //object(gen_doorext14) (2)
CreateObject(1535,1545.0000000,-1680.0000000,-253.8999900,0.0000000,0.0000000,271.9950000); //object(gen_doorext14) (5)
CreateObject(1535,1545.0000000,-1682.9000000,-253.8999900,0.0000000,358.0000000,269.9950000); //object(gen_doorext14) (6)
CreateObject(2610,1549.1000000,-1692.1000000,-253.1000100,0.0000000,0.0000000,178.0000000); //object(cj_p_fileing2) (1)
CreateObject(2610,1549.6000000,-1692.1000000,-253.1000100,0.0000000,0.0000000,177.9950000); //object(cj_p_fileing2) (2)
CreateObject(2610,1552.8000000,-1692.0000000,-253.1000100,0.0000000,0.0000000,177.9950000); //object(cj_p_fileing2) (3)
CreateObject(2610,1553.2000000,-1692.0000000,-253.1000100,0.0000000,0.0000000,177.9950000); //object(cj_p_fileing2) (4)
CreateObject(1671,1552.9000000,-1686.7000000,-253.5000000,0.0000000,0.0000000,270.0000000); //object(swivelchair_a) (1)
CreateObject(2008,1551.7000000,-1687.7000000,-253.8999900,0.0000000,0.0000000,92.0000000); //object(officedesk1) (1)
CreateObject(2309,1550.4000000,-1688.0000000,-253.8999900,0.0000000,0.0000000,286.0000000); //object(med_office_chair2) (1)
CreateObject(1704,1546.0000000,-1691.0000000,-253.8999900,0.0000000,0.0000000,90.0000000); //object(kb_chair03) (1)
CreateObject(1704,1545.9000000,-1689.2000000,-253.8999900,0.0000000,0.0000000,90.0000000); //object(kb_chair03) (2)
CreateObject(1963,1551.2000000,-1692.1000000,-253.6000100,0.0000000,0.0000000,358.0000000); //object(est_desk) (1)
CreateObject(2330,1561.2000000,-1662.8000000,-252.5000000,0.0000000,0.0000000,0.0000000); //object(cj_bedroom1_w) (2)
CreateObject(2330,1563.7000000,-1663.7000000,-252.5000000,0.0000000,0.0000000,274.0000000); //object(cj_bedroom1_w) (3)
CreateObject(2605,1559.8000000,-1666.1000000,-252.1000100,0.0000000,0.0000000,0.0000000); //object(polce_desk1) (1)
CreateObject(2604,1561.9000000,-1670.4000000,-251.7000000,0.0000000,0.0000000,0.0000000); //object(cj_police_counter) (1)
CreateObject(2607,1559.8000000,-1665.3000000,-252.1000100,0.0000000,0.0000000,0.0000000); //object(polce_desk2) (2)
CreateObject(3109,1556.0000000,-1660.7000000,-251.3000000,0.0000000,0.0000000,90.0000000); //object(imy_la_door) (2)
CreateObject(2184,1550.2000000,-1668.5000000,-252.5000000,0.0000000,0.0000000,96.0000000); //object(med_office6_desk_2) (1)
CreateObject(1714,1551.0000000,-1666.6000000,-252.5000000,0.0000000,0.0000000,0.0000000); //object(kb_swivelchair1) (1)
CreateObject(1714,1551.0000000,-1668.7000000,-252.5000000,0.0000000,0.0000000,252.0000000); //object(kb_swivelchair1) (2)
CreateObject(2724,1548.3000000,-1667.6000000,-252.0000000,0.0000000,0.0000000,96.0000000); //object(lm_stripchair) (1)
CreateObject(3109,1564.0000000,-1656.8000500,-251.3000000,0.0000000,0.0000000,90.0000000); //object(imy_la_door) (3)
CreateObject(2634,1558.7000000,-1660.8000000,-251.3999900,0.0000000,0.0000000,180.0000000); //object(ab_vaultdoor) (1)
CreateObject(334,1558.7000000,-1657.2000000,-251.5000000,0.0000000,0.0000000,0.0000000); //object(1)
CreateObject(348,1559.1000000,-1657.2000000,-251.2000000,0.0000000,0.0000000,0.0000000); //object(2)
CreateObject(351,1559.6000000,-1657.2000000,-250.8999900,359.1660000,97.9570000,358.0580000); //object(3)
CreateObject(356,1559.2000000,-1657.2000000,-251.8000000,0.0000000,0.0000000,0.0000000); //object(4)
CreateObject(373,1558.2000000,-1659.4000000,-251.1000100,328.7360000,326.6860000,355.1660000); //object(5)
CreateObject(370,1557.8000000,-1659.0000000,-251.2000000,0.0000000,0.0000000,0.0000000); //object(7)
CreateObject(1974,1558.6000000,-1657.2000000,-250.8000000,0.0000000,0.0000000,340.0000000); //object(kb_golfball) (1)
CreateObject(1974,1559.8000000,-1657.2000000,-250.8000000,0.0000000,0.0000000,339.9990000); //object(kb_golfball) (2)
CreateObject(1974,1559.8000000,-1657.2000000,-252.1000100,0.0000000,0.0000000,339.9990000); //object(kb_golfball) (4)
CreateObject(1974,1558.4000000,-1657.2000000,-252.1000100,0.0000000,0.0000000,339.9990000); //object(kb_golfball) (6)
CreateObject(1974,1558.6000000,-1657.1000000,-252.1000100,0.0000000,0.0000000,339.9990000); //object(kb_golfball) (7)
CreateObject(3036,1567.7000000,-1701.1000000,-254.8000000,0.0000000,0.0000000,0.0000000); //object(ct_gatexr) (1)
CreateObject(3036,1558.7000000,-1701.0000000,-254.8000000,0.0000000,0.0000000,0.0000000); //object(ct_gatexr) (2)
CreateObject(3036,1563.2000000,-1701.0000000,-254.8000000,0.0000000,0.0000000,0.0000000); //object(ct_gatexr) (3)
CreateObject(3036,1572.2000000,-1701.1000000,-254.8000000,0.0000000,0.0000000,0.0000000); //object(ct_gatexr) (4)
CreateObject(2514,1553.4000000,-1695.7000000,-254.3000000,0.0000000,0.0000000,0.0000000); //object(cj_toilet1) (1)
}
return 
1;
}
public 
OnPlayerDisconnect(playerid)
{
new 
File[70], sendername[MAX_PLAYER_NAME];
GetPlayerName(playeridsendernamesizeof(sendername));
format(Filesizeof(File), "%s.ini"sendername);
DOF2_SetInt(File"Skin"PlayerInfo[playerid][pSkin]);
DOF2_SetInt(File"Dinheiro"PlayerInfo[playerid][pDinheiro]);
DOF2_SetInt(File"Trabalho"PlayerInfo[playerid][pTrabalho]);
DOF2_SaveFile();
return 
1;
}
public 
OnPlayerSpawn(playerid)
{
SetPlayerSkin(playeridPlayerInfo[playerid][pSkin]);
GivePlayerMoney(playeridPlayerInfo[playerid][pDinheiro]);
PlayerInfo[playerid][pTrabalho] = DOF2_GetInt("%.ini""Trabalho");
}
public 
OnGameModeInit()
{
//Comandos Gerais//
UsePlayerPedAnims();
}
public 
OnGameModeExit()
{
    
DOF2_Exit();
    return 
1;
}
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
new 
File[70], sendername[MAX_PLAYER_NAME];
GetPlayerName(playeridsendernamesizeof(sendername));
format(Filesizeof(File), "%s.ini"sendername);
if(
dialogid == DIALOG_REGISTRO)
{
if(!
strval(inputtext)) //Verifica se o player digitou LETRAS, caso for true
//Retorna a dialog de registro novamente para ele digitar NЪMEROS
ShowPlayerDialog(playeridDIALOG_REGISTRODIALOG_STYLE_INPUT"Registro""Digite apenas nъmeros!\nDigite sua senha novamente para se registrar!""Confirma""Cancelar");
return 
1;
}
if(!
response//Verifica se ele clicar em 'Cancelar"
//Caso ele clicar em cancelar, irб retornar ao playerid KICK
Kick(playerid);
return 
1;
}
else 
//Verifica se ele Confirma o Registro
//Caso for true, ira criar o arquivo
PlayerInfo[playerid][pSenha] = strval(inputtext);
DOF2_SetInt(File"Senha"PlayerInfo[playerid][pSenha]);
DOF2_SaveFile();
ShowPlayerDialog(playeridDIALOG_LOGARDIALOG_STYLE_PASSWORD"Logar""Vocк se cadastrou, agora й sу logar com sua senha registrada!""Confirma""Cancelar");
}
}
if(
dialogid == DIALOG_LOGAR)
{
if(!
strval(inputtext)) //Verifica se o player digitou letras, caso for true
{
ShowPlayerDialog(playeridDIALOG_LOGARDIALOG_STYLE_PASSWORD"Logar""Digite apenas nъmeros!\nDigite sua senha cadastrada para logar!\nSe errar 5 vezes sua conta serб banida!""Confirma""Cancelar");
return 
1;
}
if(!
response//Verifica se ele clicar em 'Cancelar"
//Caso ele clicar em cancelar, irб retornar ao playerid KICK
Kick(playerid);
return 
1;
}
else 
//Verifica se ele Confirma o Login
{
PlayerInfo[playerid][pSenha] = DOF2_GetInt(File"Senha");
if(
strval(inputtext) == PlayerInfo[playerid][pSenha])
SpawnPlayer(playerid);
}
else
{
ShowPlayerDialog(playeridDIALOG_LOGARDIALOG_STYLE_PASSWORD"Logar""Vocк digitou sua senha errado, digite-a novamente para logar!\nSe errar 5 vezes irб ser kickado!""Confirma""Cancelar");
Erro[playerid]++; //O erro vai aumentar cada vez que ele errar
if(Erro[playerid] == 5//Quando chegar а 5 vezes, irб retornar a msg e o Ban
{
SendClientMessage(playerid, -1"Vocк foi kickado!");
Kick(playerid);
return 
1;
}
}
}
return 
1;

Erro:
C:\Users\Ailton\Desktop\PAWNO\gamemodes\Gamemodese mnome.pwn(184) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#7

Amigo vc esta CARREGANDO OS DADOS E CRIANDO ELES ANTES DO CARA CRIAR A CONTA vc deve fazer na resposta do Dialog o carregamento e a criaзгo de conta

PHP код:
#define DialogRegistro 0
#define DialogLogin 1
// Ondialogresponse //
if(dialogid == DialogRegistro)
{
   if(
response)
   {
   
// Aqui O code de setar os valores e criar a acc no OnPlayerConnect deixa sу o dialog
   
}
   else return 
Kick(playerid);
}
if(
dialogid == DialogLogin)
{
   if(
response)
   {
 
// Aqui os carregamento da conta
   
}
   else return 
Kick(playerid);

Em OnPlayerconnect vc deixa sу os dialog.

Da uma estudada aqui у https://sampforum.blast.hk/showthread.php?tid=350855


OBS : Estou pelo celular qualquer erro avise.
Reply
#8

https://sampforum.blast.hk/showthread.php?tid=639297
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)