09.08.2013, 19:23
As I understand you have 45 ranks and you have 45 checks for all of the 45 ranks, correct me if I'm wrong.
pawn Код:
stock CheckForLevelUpdate(playerid)
{
if ( pInfo[playerid][Exp] >= 0 )
{
if( pInfo[playerid][Rank] < 45 )
{
new string[128];
PlayerPlaySound(playerid, 1150, 0, 0, 0);
pInfo[playerid][Rank]++;
pInfo[playerid][Cookies] += 1;
format(string, sizeof(string), "** You have reacher rank %d!", pInfo[playerid][Rank]);
SCM(playerid, COLOR_CON_GREEN, string);
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, 24);
new msg[128],ok[128];
format(msg, sizeof(msg), "%s (%d) has been promoted to rank {F70505}%s {FFFFFF}({F70505}%d{FFFFFF})!", pname,playerid,RankName(playerid),pInfo[playerid][Rank]);
format(ok, sizeof(ok), "03,2%s (%d) has been promoted to rank %s (%d)!",pname,playerid,RankName(playerid),pInfo[playerid][Rank]);
SCMTA(COLOR_LIGHTBLUE, msg);
IRC_Say(gGroupID, IRC_CHANNEL, ok);
SetRank3DText(playerid);
}
}
}