18.06.2011, 06:11
I currently am trying to implement my registration system into my Server FFS. It works fine on my home computer, but it does not currently work correctly on my Server FFS. Video is below, and a few callbacks + scripting is shown below.
OnPlayerRequestClass:
OnDialogRespons:
Video:
Xfire Video Of The Error
OnPlayerRequestClass:
pawn Код:
new file[128],name[128];
GetPlayerName(playerid,name,sizeof(name));
format(file,sizeof(file),userfile,name);
IsWarned[playerid] = 0;
for(new go;go<11;go++)
{
SendClientMessage(playerid,-1," ");
}
if(!fexist(file))
{
for(new go;go<11;go++)
{
SendClientMessage(playerid,-1," ");
}
SendClientMessage(playerid,-1,"{FFFFFF}[SYSTEM]{D1D1D1} You are not registered, please register now.");
ShowPlayerDialog(playerid,3,DIALOG_STYLE_INPUT,"Registration","--------------------\nWelcome to RealTime Roleplay\nPlease register your account.\n--------------------","Register","");
}
if(fexist(file))
{
for(new go;go<11;go++)
{
SendClientMessage(playerid,-1," ");
}
SendClientMessage(playerid,-1,"{FFFFFF}[SYSTEM]{D1D1D1} Welcome back to RealTime Roleplay!");
SendClientMessage(playerid,-1,"{D1D1D1}Please login to continue your roleplay expirence.");
ShowPlayerDialog(playerid,4,DIALOG_STYLE_INPUT,"Login","--------------------\nWelcome back to RealTime Roleplay!\nPlease type in your password and hit login.\nHope you have fun on RealTime Roleplay\n--------------------","Login","");
SetPlayerSkin(playerid,Info[playerid] [Skin]);
}
OnDialogRespons:
pawn Код:
new file[128],name[128],buf[129],kicked[128];
GetPlayerName(playerid,name,sizeof(name));
format(file,sizeof(file),userfile,name);
format(kicked,sizeof(kicked),"{FF6803}%s has been kicked [Reason: Failure to provide a correct password]",name);
WP_Hash(buf,sizeof(buf),inputtext);
if(dialogid == 3)
{
if(response)
{
print("Debug Register");
dini_Create(file);
dini_Set(file,"Password",buf);
dini_IntSet(file,"Level",0);
dini_IntSet(file,"Score",1);
dini_IntSet(file,"Cash",1000);
dini_IntSet(file,"Jailed",0);
dini_IntSet(file,"JTime",0);
dini_IntSet(file,"Vehicle",0);
Info[playerid] [Password] = dini_Int(file,"Password");
Info[playerid] [Level] = dini_Int(file,"Level");
Info[playerid] [Score] = dini_Int(file,"Score");
Info[playerid] [Cash] = dini_Int(file,"Cash");
Info[playerid] [Jailed] = dini_Int(file,"Jailed");
Info[playerid] [JTime] = dini_Int(file,"JTime");
SetPlayerScore(playerid,Info[playerid] [Score]);
GivePlayerMoney(playerid,Info[playerid] [Cash]);
SendClientMessage(playerid,-1,"{FFFFFF}[SYSTEM]{D1D1D1} You have successfully registered!");
ShowPlayerDialog(playerid,5,DIALOG_STYLE_LIST,"Select your gender","Male\nFemale","Ok","Cancel");
}
else
{
ShowPlayerDialog(playerid,0,DIALOG_STYLE_INPUT,"Registration","Welcome,please register your name\nThe password entered will be used to login to the server.","Register","");
}
}
else if(dialogid == 4)
{
new warn[128];
format(warn,sizeof(warn),"{D40404}[WARNING]{D1D1D1} You have typed in the wrong password, try %i/3",IsWarned[playerid]);
if(response)
{
if(strcmp(buf,dini_Get(file,"Password"))==0)
{
SendClientMessage(playerid,-1,"{FFFFFF}[SYSTEM]{D1D1D1} Welcome back, You have successfuly logged in!");
Info[playerid] [Level] = dini_Int(file,"Level");
Info[playerid] [Score] = dini_Int(file,"Score");
Info[playerid] [Cash] = dini_Int(file,"Cash");
Info[playerid] [Jailed] = dini_Int(file,"Jailed");
Info[playerid] [JTime] = dini_Int(file,"JTime");
SetPlayerScore(playerid,Info[playerid] [Score]);
GivePlayerMoney(playerid,Info[playerid] [Cash]);
SpawnPlayer(playerid);
TogglePlayerSpectating(playerid,true);
TogglePlayerSpectating(playerid,false);
SetPlayerPos(playerid,-1953.4885,1339.2349,7.1875);
SetPlayerFacingAngle(playerid,174.3617);
}
else
{
if(IsWarned[playerid] <=3)
{
IsWarned[playerid]++;
SendClientMessage(playerid,-1,warn);
}
else
{
SendClientMessage(playerid,-1,warn);
SendClientMessageToAll(-1,kicked);
Kick(playerid);
}
return ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Login","--------------------\nWelcome back to RealTime Roleplay!\nPlease type in your password and hit login.\nHope you have fun on RealTime Roleplay\n--------------------","Login","Cancel");
}
}
else
{
Kick(playerid);
}
}
else if(dialogid == 5)
{
if (response)
{
switch (listitem)
{
case 0:
{
dini_Set(file,"Gender","Male");
dini_IntSet(file,"Skin",male[random(sizeof(male))]);
}
case 1:
{
dini_Set(file,"Gender","Female");
dini_IntSet(file,"Skin",female[random(sizeof(female))]);
}
}
TogglePlayerSpectating(playerid,true);
TogglePlayerSpectating(playerid,false);
SetPlayerPos(playerid,-1953.4885,1339.2349,7.1875);
SetPlayerFacingAngle(playerid,174.3617);
Info[playerid] [Skin] = dini_Int(file,"Skin");
}
}
Код:
Its supposed to debug when the Reg dialog is called upon, but it does not print what i have put. So the problem is in Dialogid 3
Xfire Video Of The Error