CRASH.. After I set my self as admin... -
Hello everyone....
pawn Код:
public OnLoginAttempt(playerid) {
new rows,fields;
cache_get_data(rows,fields);
new loginattempts = GetPVarInt(playerid,"LoginAttempts");
new msg[128];
if(rows < 1) {
loginattempts++;
if((MAX_LOGIN_ATTEMPTS-loginattempts) <= 0) {
SendClientMessage(playerid, X11_RED,"You have been kicked for entering the incorrect password.");
Kick(playerid);
}
SetPVarInt(playerid,"LoginAttempts",loginattempts);
format(msg,sizeof(msg),"[ERROR]: Incorrect password. You have %d more attempts before you will be kicked.",MAX_LOGIN_ATTEMPTS-loginattempts);
SendClientMessage(playerid, X11_WHITE, msg);
ShowLoginDialog(playerid);
return 1;
}
SendClientMessage(playerid, X11_ORANGE,"Successful login!");
new alevel, id_string[32];
cache_get_row(0,0,id_string);
//`adminlevel`,`newbrank`,`connecttime`,`admintitle`
alevel = strval(id_string);
cache_get_row(0,1,id_string);
SetPVarInt(playerid, "NewbieRank", strval(id_string));
cache_get_row(0,2,id_string);
SetPVarInt(playerid, "ConnectTime", strval(id_string));
cache_get_row(0,3,id_string);
SetPVarString(playerid, "AdminTitle", id_string);
if(alevel != 0) {
format(msg,sizeof(msg),"You are logged in as a %s!",id_string);
SendClientMessage(playerid, X11_WHITE, msg);
SetPVarInt(playerid,"AdminFlags",alevel);
}
cache_get_row(0,1,id_string);
alevel = strval(id_string);
if(alevel != 0) {
SetPVarInt(playerid,"NewbieRank",alevel);
format(msg,sizeof(msg),"You are logged in as a %s",GetNewbieName(playerid));
SendClientMessage(playerid, X11_WHITE, msg);
}
if(GetPVarInt(playerid, "AdminFlags") != 0 || GetPVarInt(playerid, "NewbieRank") != 0) {
adminOnPlayerLogin(playerid);
}
cache_get_row(0,4,id_string); //donate points
alevel = strval(id_string);
SetPVarInt(playerid, "DonatePoints", alevel);
cache_get_row(0,5,id_string); //donate rank
alevel = strval(id_string);
SetPVarInt(playerid, "DonateRank", alevel);
cache_get_row(0,6,id_string); //cookies
alevel = strval(id_string);
SetPVarInt(playerid, "Cookies", alevel);
cache_get_row(0,7,id_string); //ajail release time
alevel = strval(id_string);
if(alevel > 0) {
SetTimerEx("AJail",1000, false, "dds", playerid, alevel, "AJailed");
}
cache_get_row(0,8,id_string);
SetPVarInt(playerid, "NMuteTime", strval(id_string)+gettime());
cache_get_row(0,9,id_string);
SetPVarInt(playerid, "MuteTime", strval(id_string)+gettime());
cache_get_row(0,10,id_string);
SetPVarInt(playerid, "ReportBanned", strval(id_string));
cache_get_row(0,11,id_string);
SetPVarInt(playerid, "AccountFlags", strval(id_string));
cache_get_row(0,12,id_string);
SetPVarInt(playerid, "NumAJails", strval(id_string));
cache_get_row(0,13,id_string);
SetPVarInt(playerid, "NumKicks", strval(id_string));
cache_get_row(0,14,id_string);
SetPVarInt(playerid, "NumBans", strval(id_string));
cache_get_row(0,15,id_string);
new hideval = strval(id_string);
if(hideval != 0)
SetPVarInt(playerid, "AdminHidden", hideval);
OnPlayerLogin(playerid);
return 1;
}
forward OnPlayerConnectEx(playerid);
public OnPlayerConnectEx(playerid) {
if(numUsersOnIP(playerid) > 6) {
#if ip_remote_check
KickEx(playerid, "Too many simultaneous sessions");
#else
Ban(playerid);
#endif
return 0;
}
return 0;
}
public OnPlayerLogin(playerid) {
new msg[128],ip[16];
new acctotal = numPlayersOnAcc(playerid);
if(acctotal > 0) {
format(msg, sizeof(msg), "* AdmWarn: %s[%s] has logged in multiple times from the same account.",GetPlayerNameEx(playerid, ENameType_CharName),GetPlayerNameEx(playerid, ENameType_AccountName));
ABroadcast(X11_YELLOW, msg, EAdminFlags_All);
KickEx(playerid, "Logging in multiple times from the same IP");
DeletePVar(playerid, "LoggedIn");
sendMsgToAccID(GetPVarInt(playerid, "AccountID"), X11_TOMATO_2, "* Warning: Someone has successfully logged into your account while you were online. Consider changing your password.");
return 1;
}
new total;
GetPlayerIpEx(playerid, ip, sizeof(ip));
if((total = numPlayersOnIp(ip)) > 1) {
format(msg, sizeof(msg), "* AdmWarn: %s[%d] has logged in %d times from the same IP(%s).",GetPlayerNameEx(playerid, ENameType_CharName),playerid,total,ip);
ABroadcast(X11_YELLOW, msg, EAdminFlags_All);
}
SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 998);
SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL_SILENCED, 999);
SetPlayerSkillLevel(playerid, WEAPONSKILL_DESERT_EAGLE, 999);
SetPlayerSkillLevel(playerid, WEAPONSKILL_SHOTGUN, 999);
SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 1);
SetPlayerSkillLevel(playerid, WEAPONSKILL_SPAS12_SHOTGUN, 999);
SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI, 1);
SetPlayerSkillLevel(playerid, WEAPONSKILL_MP5, 999);
SetPlayerSkillLevel(playerid, WEAPONSKILL_AK47, 999);
SetPlayerSkillLevel(playerid, WEAPONSKILL_M4, 999);
SetPlayerSkillLevel(playerid, WEAPONSKILL_SNIPERRIFLE, 999);
SetPVarInt(playerid, "AccountLoginTime", gettime()); //Login time for the account, not the character
LoadCharacters(playerid, true);
format(msg, sizeof(msg), "Welcome %s!",GetPlayerNameEx(playerid, ENameType_AccountName));
SendClientMessage(playerid, X11_ORANGE, msg);
format(query, sizeof(query), "SELECT `flags`,`adminflags`,(`host`&`mask`)=(INET_ATON(\"%s\")&`mask`) FROM `loginflags` WHERE (`host`&`mask`)=(INET_ATON(\"%s\")&`mask`) OR (`accountid` = %d) order by 3 desc",ip,ip,GetPVarInt(playerid, "AccountID"));
mysql_function_query(g_mysql_handle, query, true, "OnLoadIPFlags", "dd", playerid,0);
return 1;
}
Thank you for your time and your time..
Re: CRASH.. After I set my self as admin... -
The information crashdetect gave are not very helpful. You know the 2 public functions but not what was the actual reason the server crashed. So make sure the version of the crashdetect is 4.13.1 and you compiled your scripts with debug info (-d3).
If nothing more is shown, I guess you'll have to debug it manually (print messages in each line to see where the code stops).
Re: CRASH.. After I set my self as admin... -
Re: CRASH.. After I set my self as admin... -
Sorry for double post ... But still
Made pawn.cfg in it typed -d3 so yeah. IDK what to do every function check with printf?
Re: CRASH.. After I set my self as admin... -
Just make sure the extension of the file is .cfg otherwise it won't work. You can even make sure after compiling if you get more information.