07.11.2010, 18:08
this dosnt register it dosnt create a dini
i dont get any errors or warnings
i dont get any errors or warnings
pawn Код:
dcmd_register(playerid,params[])
{
#pragma unused params
new file[128],n[MAX_PLAYER_NAME];
GetPlayerName(playerid,n,MAX_PLAYER_NAME);
format(file,sizeof(file),"MyAdmin/Users/%s.ini",n);
if(dini_Exists(file)) return SendClientMessage(playerid,YELLOW,"You are already registered!");
if(PInfo[playerid][Regged] == 1) return SendClientMessage(playerid,LIGHTBLUE,"You are already registered!");
if(PInfo[playerid][Logged] == 1) return SendClientMessage(playerid,red,"You are already registered, and logged in!");
ShowPlayerDialog(playerid,10,DIALOG_STYLE_INPUT,"Register","Welcome \n We see you want to register\nPlease enter a password below","Register","Cancel");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
new file[128],n[MAX_PLAYER_NAME];
GetPlayerName(playerid,n,MAX_PLAYER_NAME);
format(file,sizeof(file),"MyAdmin/Users/%s.ini",n);
if(dialogid == 9)
{
dini_Create(file);
dini_Set(file,"Password",inputtext);
dini_IntSet(file,"Regged",1);
dini_IntSet(file,"Logged",0);
dini_IntSet(file,"Level",0);
dini_IntSet(file,"Muted",0);
dini_IntSet(file,"Jailed",0);
dini_IntSet(file,"Frozen",0);
dini_IntSet(file,"Skin",0);
dini_IntSet(file,"Dueling",0);
dini_IntSet(file,"Score",GetPlayerScore(playerid));
SendClientMessage(playerid,LIGHTBLUE,"Congratulations, you have just registered, please /login");
PInfo[playerid][Regged] = 1;
}
return 1;
}