help me fix newbie cmd
#1

Quote:

CMD:newbie(playerid, params[]) {
if(playerVariables[playerid][pNewbieTimeout] > 0 && playerVariables[playerid][pAdminLevel] < 1) {
SendClientMessage(playerid,COLOR_GREY, "You must wait until you can speak again in the newbie chat channel.");
return 1;
}
if(!isnull(params)) {
GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);

if(playerVariables[playerid][pAdminLevel] > 0 && playerVariables[playerid][pAdminDuty] != 0) {
format(szMessage, sizeof(szMessage), "[NEWBIE CHAT] Admin %s: %s", szPlayerName, params);
}
else if(playerVariables[playerid][pHelper] >= 1 && playerVariables[playerid][pHelperDuty] >= 1) {
format(szMessage, sizeof(szMessage), "[NEWBIE CHAT] Helper %s: %s", szPlayerName, params);
playerVariables[playerid][pNewbieTimeout] = 5;
}
else if(playerVariables[playerid][pPlayingHours] >= 23) {
format(szMessage, sizeof(szMessage), "[NEWBIE CHAT] Player %s: %s", szPlayerName, params);
playerVariables[playerid][pNewbieTimeout] = 25;
}
else if(playerVariables[playerid][pPlayingHours] >= 47) {
format(szMessage, sizeof(szMessage), "[NEWBIE CHAT] Professional Player %s: %s", szPlayerName, params);
playerVariables[playerid][pNewbieTimeout] = 20;
}
else if(playerVariables[playerid][pPlayingHours] >= 96) {
format(szMessage, sizeof(szMessage), "[NEWBIE CHAT] Expert Player %s: %s", szPlayerName, params);
playerVariables[playerid][pNewbieTimeout] = 15;
}
else if(playerVariables[playerid][pAdminLevel] > 0 && playerVariables[playerid][pAdminDuty] == 0) {
format(szMessage, sizeof(szMessage), "[NEWBIE CHAT] Legend Player %s: %s", szPlayerName, params);
}
else {
format(szMessage, sizeof(szMessage), "[NEWBIE CHAT] Newbie %s: %s", szPlayerName, params);
playerVariables[playerid][pNewbieTimeout] = 30;
}
foreach(Player, x) {
if(playerVariables[x][pStatus] >= 1 && playerVariables[x][pNewbieEnabled] == 1) {
SendClientMessage(x, COLOR_NEWBIE, szMessage);
}
}
}
else {
return SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/(n)ewbie [question]");
}
return 1;
}

i want to make a rank in newbie chat, if someone PLAYINGHOURS more than 23 it show PLAYER rank in newbie chat and if someone PLAYINGHOURS more than 47 it show PROFESSIONAL PLAYER, but the problem is i have 100 playing hours but it only show PLAYER rank in the newbie chat

can someone fix the cmd ?
thanks
Reply
#2

If you notice a bit more, for example 100 is in All of those non equations, so would be better if you make it like:

pawn Код:
if(a > PlayingHours >= b)
Just an example. I'm not going to give you the complete cmd, do it yourself :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)