31.12.2010, 14:27
need help with my register system .. here is the system
When I connect, the dialogs doesnt even show and i just spawn in no where...
see my onplayerrequst
Also the account doesnt saves, nothing saves in Reg/Users
Really bugged please help
pawn Код:
public OnPlayerConnect(playerid)
{
new pname[MAX_PLAYER_NAME];
new string[180];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s has connected to the server",pname);
MessageToAdmins(Grey, string);
new playerfile[100];
GetPlayerName(playerid, pname, sizeof(pname));
format(playerfile, sizeof(playerfile), "Reg/Users/%s.ini",pname);
if (!dini_Exists(playerfile)) SendClientMessage(playerid, Yellow, "%s not found in our database, register an account");
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Register your account", "Enter a password", "Register", "Quit");
if(dini_Exists(playerfile)) SendClientMessage(playerid, Green, "%s is registered login to your account");
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Login to your account", "Enter your password", "Login", "Quit");
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
if(logged[playerid] == 1)
{
new playerfile[100], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(playerfile, sizeof(playerfile), "Reg/Users/%s.ini",pname);
dini_IntSet(playerfile, "Level", level[playerid]);
}
level[playerid] = 0;
logged[playerid] = 0;
muted[playerid] = 0;
new string[180], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s has left the server.",pname);
MessageToAdmins(Grey, string);
return 1;
}
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1)
{
new playerfile[128], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(playerfile, sizeof(playerfile), "Reg/Users/%s.ini",pname);
ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Register your account","Enter a password","Register","Quit");
new playerip[20];
GetPlayerIp(playerid, playerip, sizeof(playerip));
dini_Create(playerfile);
dini_IntSet(playerfile, "Password", udb_hash(inputtext));
dini_Set(playerfile, "Ip", playerip);
dini_IntSet(playerfile, "Level", 0);
logged[playerid] = 1;
}
if(dialogid == 2)
{
new playerfile[100], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(playerfile, sizeof(playerfile), "Reg/Users/%s.ini",pname);
new tmp[256];
if(udb_hash(inputtext) != tmp) {
SendClientMessage(playerid, Red,"Incorrect password!");
ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Login to your account","Enter your password","Login","Quit");
}
else {
tmp = dini_Get(playerfile, "Password");
if(udb_hash(inputtext) == strval(tmp))
return 1;
}
Quote:
E:\GTA San Andreas\Server\gamemodes\Test.pwn(634) : error 033: array must be indexed (variable "tmp") E:\GTA San Andreas\Server\gamemodes\Test.pwn(644) : error 030: compound statement not closed at the end of file (started at line 630) Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Errors. |
see my onplayerrequst
pawn Код:
{
SetPlayerPos(playerid, 1383.1418,2185.1440,11.0234);
SetPlayerFacingAngle(playerid, 0502);
SetPlayerCameraPos(playerid, 1377.5685,2178.9609,11.0234);
SetPlayerCameraLookAt(playerid, 1383.1418,2185.1440,11.0234);
return 1;
}
Really bugged please help