12.01.2019, 00:39
From the logs:
This happens when a player registers an account in the server with this following dialog:
Код:
[15:47:50] [debug] Run time error 3: "Stack/heap collision (insufficient stack size)" [15:47:50] [debug] Stack pointer (STK) is 0x31E4430, heap pointer (HEA) is 0x31E4834 [15:47:50] [debug] AMX backtrace: [15:47:50] [debug] #0 0000f374 in public OnDialogResponse (0, 130, 1, -1, 52316168) from LSGW.amx
pawn Код:
if(dialogid == DIALOG_REGISTER)
{
new ip[16], newplayer[MAX_PLAYER_NAME], pmsg[128], striiing[2000];
GetPlayerIp(playerid, ip, sizeof(ip));
if (!response) return Kick (playerid);
if(!strlen(inputtext))
{
strcat(striiing, ""COL_RED"You Have Entered An Invalid password.\n"COL_WHITE"Type Your "COL_RED"Password "COL_WHITE"Below To Register An Account, \nThe Password Must Be Between "COL_RED"3"COL_WHITE" And "COL_RED"20"COL_WHITE" Characters, You Can Change Your Password Later,\nAlso Be Sure To Type A "COL_RED"Strong Password "COL_WHITE"And Don't "COL_RED"Share "COL_WHITE"It.");
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Account Registering...",striiing,"Register","Quit");
return 1;
}
if(strlen(inputtext) < 3 || strlen(inputtext) > 15)
{
strcat(striiing, ""COL_RED"You Have Entered An Invalid password.\n"COL_WHITE"Type Your "COL_RED"Password "COL_WHITE"Below To Register An Account, \nThe Password Must Be Between "COL_RED"3"COL_WHITE" And "COL_RED"20"COL_WHITE" Characters, You Can Change Your Password Later,\nAlso Be Sure To Type A "COL_RED"Strong Password "COL_WHITE"And Don't "COL_RED"Share "COL_WHITE"It.");
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Account Registering...",striiing,"Register","Quit");
return 1;
}
SendClientMessage(playerid, 0xFFF700FF, "You Have Successfully Registered An Account!");
new string[2000];
strcat(string, ""COL_BEYELLOW"You Have Successfully Registered An Account In "COL_LIGHTBLUE"LSGW"COL_BEYELLOW"!\nThe Best Gang War Server Ever, You Can Kill Players, Capture Turfs.\nComplete Achievements And Many More, You Can Find More Features In /cmds.");
strcat(string, "\n"COL_BEYELLOW"Please Register At Our Forum: lsgangwars.createaforum.com, Make Sure You Have Read All /rules.\nIf You Need Any Help, Please Use /help Or /ahelp [Text] From Online Admins.\nAlso Check Out /updates For The Latest Updates And /credits!\n\nRegards,\nLSGW {FF0000}Owner"COL_BEYELLOW".");
ShowPlayerDialog(playerid, DIALOG_REGISTERWELCOME, DIALOG_STYLE_MSGBOX, ""COL_WHITE"Welcome To LSGW!", string, "Close", "");
GetPlayerName(playerid, newplayer, MAX_PLAYER_NAME);
format(pmsg, sizeof(pmsg), "[REGISTER] %s (%d) Has Registered An Account.", newplayer, playerid);
SendClientMessageToAll(0xB5B200AA, pmsg);
KillTimer(LoginTime[playerid]);
new hashpass[129]; //Now we will create a new variable to hash his/her password
WP_Hash(hashpass,sizeof(hashpass),inputtext);//We will use whirlpool to hash their inputted text
new INI:File = INI_Open(Path(playerid));
INI_SetTag(File,"data");
INI_WriteString(File,"Password",hashpass);
INI_WriteInt(File,"Cash",0);
INI_WriteInt(File,"Admin",0);
INI_WriteInt(File,"Management",0);
INI_WriteInt(File,"Kills",0);
INI_WriteInt(File,"Deaths",0);
INI_WriteInt(File,"Score",0);
INI_WriteInt(File,"Drugs",0);
INI_WriteInt(File,"Adrenaline",0);
INI_WriteInt(File,"Registered",1);
INI_WriteInt(File,"VIPLevel",0);
INI_WriteInt(File,"FavouriteSkin",-1);
INI_WriteInt(File,"FavouriteSong",0);
INI_WriteInt(File,"BankMoney",0);
INI_WriteInt(File,"Daysalive",0);
INI_WriteInt(File,"Banned",0);
INI_WriteInt(File,"Muted",0);
INI_WriteInt(File,"MuteWarnings",0);
INI_WriteInt(File,"MaxMuteWarnings",0);
INI_WriteInt(File,"Warnings",0);
INI_WriteInt(File,"TimesKicked",0);
INI_WriteInt(File,"StartingMusic",0);
INI_WriteInt(File,"Respect",0);
INI_WriteInt(File,"AutoUseSkin",0);
INI_WriteInt(File,"FightingSkill",4);
INI_WriteInt(File,"TurfsCaptured",0);
INI_WriteInt(File,"TurfsLost",0);
INI_WriteInt(File,"AssistedTurfsCaptured",0);
INI_WriteInt(File,"Hours",0);
INI_WriteInt(File,"Minutes",0);
INI_WriteInt(File,"ObjectEditor",0);
INI_WriteInt(File,"KillSound",0);
INI_Close(File);
PlayerInfo[playerid][pPass] = hashpass;
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
PlayerAlreadyRegisteredIn[playerid] = 1;
PlayerAlreadyLoggedIn[playerid] = 1;
Info[playerid][Logged] = 1;
Info[playerid][Registered] = 1;
Info[playerid][Favouriteskin] = -1;
F_GivePlayerMoney(playerid, 10000);
UserTimer[playerid] = SetTimerEx("UserSaver", 100000, true, "d", playerid);
PlayerDays[playerid] = SetTimerEx("DaysAlive", 1380000, true, "d", playerid);
Minscount[playerid] = SetTimerEx("Minscounter", 60000, true, "d", playerid);
new INI:File2 = INI_Open(UserPath2(playerid));
INI_WriteString(File2,"IP", ip);
INI_Close(File2);
}