Question -
Lajko1 - 17.03.2010
Hello i am working on dialog /register /login system and for now its OK but i forget how i can check this:
- If(dini_IntGet ''Registered'' == 1 )
or how ever it goes the code i just need the right code becouse i forget it
i just want code how to check if player is registered ? i allready made this ''registered'' that saves it when player register to ''1'' and now i want like this
OnPlayerConnect(...)
{
if(code that check if player is registered ==1)
{
// other
}
return 1;
}
i hope u understand me what part of code i need
Re: Question -
Deat_Itself - 17.03.2010
i think you are searching about this
Код:
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
if (dini_Exists(udb_encode(playername)))
that will check the playername.Its file is created or not.
or
Код:
stock dini_IntGet(filename[],slot[]){
new tmp[256],value;
tmp = dini_Get(filename, slot);
value = strval(tmp);
return value;
}
Re: Question -
Lajko1 - 17.03.2010
Quote:
|
Originally Posted by _Saif_
i think you are searching about this
Код:
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
if (dini_Exists(udb_encode(playername)))
that will check the playername.Its file is created or not.
or
Код:
stock dini_IntGet(filename[],slot[]){
new tmp[256],value;
tmp = dini_Get(filename, slot);
value = strval(tmp);
return value;
}
|
ty for try but listen again ^^
I want the code that check if player have this for example ''item'' like if(dini code to check if player have this item) == 1
Ex:
OnPlayerConnect()
{
if(dini_(othercode)''Condom'' == 1)
{
//code
return 1;
}
return 1;
}
or what ever i hope u understand now
Re: Question -
Deat_Itself - 17.03.2010
Quote:
or what ever i hope u understand now
|
i hope you mean this
Код:
dini_IntSet(udb_encode(playername), "condom", 1);
if(dini_IntGet(udb_encode(playername), "condom") == 1)
{
//code
}
Re: Question -
Lajko1 - 17.03.2010
i think u post the rigt code that i want but i get 2 errors
Код:
public OnPlayerConnect(playerid)
{
if(dini_IntGet(udb_encode(playername), "Registered") == 0) ------------------> 108
{
ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Register","Hello!\n This account is not registered yet.\n Please type in password if you want\n to register a new account!","Register","Cancel");
return 1;
}
if(dini_IntGet(udb_encode(playername), "Registered") == 1) ------------------> 113
{
ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Login","Welcome back! Please enter your password in box\n to login your account","Login","Cancel");
return 1;
}
return 1;
}
errors:
Код:
C:\Documents and Settings\samp\Desktop\Server 2\gamemodes\new.pwn(108) : error 017: undefined symbol "dini_IntGet"
C:\Documents and Settings\samp\Desktop\Server 2\gamemodes\new.pwn(113) : error 017: undefined symbol "dini_IntGet"
Re: Question -
Deat_Itself - 17.03.2010
Код:
stock dini_IntGet(filename[],slot[]){
new tmp[256],value;
tmp = dini_Get(filename, slot);
value = strval(tmp);
return value;
}
Re: Question -
Lajko1 - 17.03.2010
o god i try but something is wrong with it ... listen want to made if player is not registered it will show him dialog for register,if he is allready register it will show him dialog for login... but as allways i faild actualy when i register it made a file in Script files... but when i come again on server it show the dialog for register again , crap ...
here is the full mode pastebin link its is just start... and first of all i need login / register system with dialogs...
here it is
http://pastebin.com/6WfHMkZF
i hope u can fix that ...
Re: Question -
Lajko1 - 18.03.2010
anyone ?
Re: Question -
Deat_Itself - 18.03.2010
Код:
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
if (dini_Exists(udb_encode(playername)))
//show him login dialog box
try wit this one .May be it works
OR
When player registers so //use it in register script
dini_IntSet(udb_encode(playername), "playerregistered", 1);
if(dini_IntGet(udb_encode(playername), "playerregistered") == 1) //show him login box.
Re: Question -
Lajko1 - 18.03.2010
its same thing i do in script that i post u ?