04.12.2012, 13:21
Guys,
My adminscript is causing the server to crash, I also found out where its comming from. Luckily i used the crashdetect plugins. I cant really see whats wrong with the OnDialogResponse. If somnebody can kindly help me fix this. Nothing seems to work.
My adminscript is causing the server to crash, I also found out where its comming from. Luckily i used the crashdetect plugins. I cant really see whats wrong with the OnDialogResponse. If somnebody can kindly help me fix this. Nothing seems to work.
pawn Код:
[12:57:00] [debug] Server crashed while executing systema.amx
[12:57:00] [debug] AMX backtrace:
[12:57:00] [debug] #0 00000039 in ?? () from systema.amx
[12:57:00] [debug] #1 00000039 in public OnDialogResponse () from systema.amx
[12:57:00] [debug] System backtrace:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch( dialogid )
{
case DIALOG_REGISTER:
{
if (!response) return Kick(playerid);
if(response)
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Register",""COL_RED"{FFFFFF}You Haved Typed A {FF0000}Invalid {FFFFFF}Password\n"COL_WHITE"Type A Password Below To Register Your Account","Register","Quit");
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Password",udb_hash(inputtext));
INI_WriteInt(File,"VIPLevel",0);
INI_WriteInt(File,"Cash",0);
INI_WriteInt(File,"Admin",0);
INI_WriteInt(File,"Kills",0);
INI_WriteInt(File,"Deaths",0);
INI_Close(File);
SendClientMessage(playerid, 0xFFFFFF, "{FFFFFF}You Have {00FF00}Successfully {FFFFFF}Registered A Account!");
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
}
}
case DIALOG_LOGIN:
{
if ( !response ) return Kick ( playerid );
if( response )
{
if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success",""COL_GREEN"{FFFFFF}You Have {00FF40}Successfully {FFFFFF}Logged In!","Ok","");
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"{FFFFFF}You Typed A {FF0000}Incorrect {FFFFFF}Password\n"COL_WHITE"Type Your Password Below To Login","Login","Quit");
}
return 1;
}
}
}
return 1;
}