SA-MP Forums Archive
If is player alredy registred check - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: If is player alredy registred check (/showthread.php?tid=582806)



[SOLVED]If is player alredy registred check - Deny1 - 23.07.2015

I have problem in mod if is player registred he can again regist. i need some registring check
EDIT: i use ini


AW: If is player alredy registred check - Mencent - 23.07.2015

Hello!

Can you send us your code, so we can check this?

- Mencent


Re: AW: If is player alredy registred check - Deny1 - 23.07.2015

Quote:

case DIALOG_REGISTER:
{
if (!response) return Kick(playerid);
if(response)
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Reg.",""COL_WHITE"bad pass.\n"COL_WHITE"Put pass to regist.","Register","Exit");
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Password",udb_hash(inputtext));
INI_WriteInt(File,"Cash",0);
INI_WriteInt(File,"Admin",0);
INI_WriteInt(File,"Age",0);
INI_WriteInt(File,"Sex",2);
INI_WriteInt(File,"Skin",0);
INI_WriteInt(File,"Location",0);
INI_Close(File);

here....


AW: If is player alredy registred check - Mencent - 23.07.2015

Where are you checking wheather the player is already registered?

- Mencent


Re: AW: If is player alredy registred check - Deny1 - 23.07.2015

look i have text draws only register and login and if user make account he can do that again so i need something if is player registred bla bla scm that name is alredy registed


AW: If is player alredy registred check - Mencent - 23.07.2015

Ah, I have misunderstood you.

EDIT:
Write it so:
PHP код:
case DIALOG_REGISTER:
{
    if (!
response) return Kick(playerid);
    if(
response)
    {
        new 
INI:File INI_Open(UserPath(playerid));
        if(
INI_Exist(UserPath(playerid)))return SendClientMessage(playerid,-1,"This name is already registered!");
        if(!
strlen(inputtext)) return ShowPlayerDialog(playeridDIALOG_REGISTERDIALOG_STYLE_INPUT""COL_WHITE"Reg.",""COL_WHITE"bad pass.\n"COL_WHITE"Put pass to regist.","Register","Exit");
        
INI_SetTag(File,"data");
        
INI_WriteInt(File,"Password",udb_hash(inputtext));
        
INI_WriteInt(File,"Cash",0);
        
INI_WriteInt(File,"Admin",0);
        
INI_WriteInt(File,"Age",0);
        
INI_WriteInt(File,"Sex",2);
        
INI_WriteInt(File,"Skin",0);
        
INI_WriteInt(File,"Location",0);
        
INI_Close(File); 
- Mencent