04.10.2011, 05:34
Hello,
I am having a tiny issue. I made a system up where if you were say admin rank 2 it would say Junior Admin when I type /newbie and if you were admin rank 99999 you would show up as Community Manager on /newbie, but when I do /newbie as a level 99999 Administrator it says Junior Admin.
This is the code I have for it right now.
Also I made something similar for the helpers where if you did /helpers if you were say rank 3 helper it would say Senior Helper %s [NAME], but when I do /helpers and I am a rank 5 helper it says all the ranks and my name like
Junior Helper %s
General Helper %s
Senior Helper %s
Assistant Head Helper %s
Head Helper %s
This is the code I used for this:
Could someone explain why these things are doing this?
Thank you in advance and +1 REP to whoever can help me.
EDIT: Okay I got /helpers showing only one rank by adding else in front of if, but it only shows Junior Helper. and non of the other ranks.
I am having a tiny issue. I made a system up where if you were say admin rank 2 it would say Junior Admin when I type /newbie and if you were admin rank 99999 you would show up as Community Manager on /newbie, but when I do /newbie as a level 99999 Administrator it says Junior Admin.
Код:
SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/n)ewbie [newbie chat]"); return 1; } if(PlayerInfo[playerid][pLevel] > 1 && PlayerInfo[playerid][pAdmin] <= 1 && PlayerInfo[playerid][pHelper] <= 0) format(string, sizeof(string), "** Player %s: %s", sendername, result); else if(PlayerInfo[playerid][pAdmin] >= 2) format(string, sizeof(string), "Junior Admin %s: %s", sendername, result); else if(PlayerInfo[playerid][pAdmin] >= 3) format(string, sizeof(string), "General Admin %s: %s", sendername, result); else if(PlayerInfo[playerid][pAdmin] >= 4) format(string, sizeof(string), "Senior Admin %s: %s", sendername, result); else if(PlayerInfo[playerid][pAdmin] >= 1337) format(string, sizeof(string), "Lead Admin %s: %s", sendername, result); else if(PlayerInfo[playerid][pAdmin] >= 99998) format(string, sizeof(string), "Community Scripter %s: %s", sendername, result); else if(PlayerInfo[playerid][pAdmin] >=99999) format(string, sizeof(string), "Community Manager %s: %s", sendername, result); else if(PlayerInfo[playerid][pDonateRank] >= 1) format(string, sizeof(string), "VIP %s: %s", sendername, result); else if(PlayerInfo[playerid][pHelper] >= 5) format(string, sizeof(string), "Head Helper %s: %s", sendername, result); else if(PlayerInfo[playerid][pHelper] >= 4) format(string, sizeof(string), "Assistant Head Helper %s: %s", sendername, result); else if(PlayerInfo[playerid][pHelper] >= 3) format(string, sizeof(string), "Senior Helper %s: %s", sendername, result); else if(PlayerInfo[playerid][pHelper] >= 2) format(string, sizeof(string), "General Helper %s: %s", sendername, result); else if(PlayerInfo[playerid][pHelper] == 1) format(string, sizeof(string), "Junior Helper %s: %s", sendername, result); else format(string, sizeof(string), "Newbie %s: %s", sendername, result); OOCNewbie(NEWBIE_COLOR,string); if(PlayerInfo[playerid][pAdmin] <= 1 && PlayerInfo[playerid][pHelper] <= 0) { UseNewbieTimer[playerid] = true; SetTimerEx("UseNewbie",50*1000,0,"i",playerid); } } }
Also I made something similar for the helpers where if you did /helpers if you were say rank 3 helper it would say Senior Helper %s [NAME], but when I do /helpers and I am a rank 5 helper it says all the ranks and my name like
Junior Helper %s
General Helper %s
Senior Helper %s
Assistant Head Helper %s
Head Helper %s
This is the code I used for this:
Код:
if (strcmp(cmd, "/helpers", true) == 0) { if(IsPlayerConnected(playerid)) { SendClientMessage(playerid, COLOR_GRAD1, "Helpers Online:"); for(new i; i<MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(PlayerInfo[i][pHelper] >= 1) { GetPlayerName(i, sendername, sizeof(sendername)); format(string, 256, "Junior Helper %s", sendername); SendClientMessage(playerid, COLOR_GRAD2, string); } if(PlayerInfo[i][pHelper] >= 2) { GetPlayerName(i, sendername, sizeof(sendername)); format(string, 256, "General Helper %s", sendername); SendClientMessage(playerid, COLOR_GRAD2, string); } if(PlayerInfo[i][pHelper] >= 3) { GetPlayerName(i, sendername, sizeof(sendername)); format(string, 256, "Senior Helper %s", sendername); SendClientMessage(playerid, COLOR_GRAD2, string); } if(PlayerInfo[i][pHelper] >= 4) { GetPlayerName(i, sendername, sizeof(sendername)); format(string, 256, "Assistant Head Helper %s", sendername); SendClientMessage(playerid, COLOR_GRAD2, string); } if(PlayerInfo[i][pHelper] >= 5) { GetPlayerName(i, sendername, sizeof(sendername)); format(string, 256, "Head Helper %s", sendername); SendClientMessage(playerid, COLOR_GRAD2, string); } } } } return 1; }
Thank you in advance and +1 REP to whoever can help me.
EDIT: Okay I got /helpers showing only one rank by adding else in front of if, but it only shows Junior Helper. and non of the other ranks.