Please Very little help *(rep++++)
#1

===> I made this rank system cmd. But i am little confusing. I want like If you Have Score = 0 or greater than it than your rank will rookie.

2- If score will equal to 150 or greater than it than your rank will private.
3- If score will equal to 250 or greater than it than your rank will corporal.
4- If score will equal to 350 or greater than it than your rank will sergeant.
5- If score will equal to 500 or greater than it than your rank will Captain.
6- If score will equal to 750 or greater than it than your rank will Bargadier.
7- If score will equal to 1200 or greater than it than your rank will general.
8- If score will equal to 2000 or greater than it than your rank will Commander.

pawn Код:
CMD:rank(playerid,params[])
{
 if(GetPlayerScore(playerid) > 0 )
 {
    SendClientMessage(playerid,GREEN,"Your rank is Rookie!");
 }
 if(GetPlayerScore(playerid) > 150)
 {
    SendClientMessage(playerid,GREEN,"Your rank is Private!");
 }
 if(GetPlayerScore(playerid) > 250)
 {
    SendClientMessage(playerid,GREEN,"Your rank is Corporal!");
 }
 if(GetPlayerScore(playerid) > 350)
 {
    SendClientMessage(playerid,GREEN,"Your rank is Sergeant!");
 }
 if(GetPlayerScore(playerid) > 500)
 {
    SendClientMessage(playerid,GREEN,"Your rank is Captain!");
 }
 if(GetPlayerScore(playerid) > 750)
 {
    SendClientMessage(playerid, GREEN,"Your rank is Bergadier!");
 }
 if(GetPlayerScore(playerid) > 1200)
 {
    SendClientMessage(playerid, GREEN,"Your rank is General!");
 }
 else if(GetPlayerScore(playerid) >= 2000)
 {
    SendClientMessage(playerid,GREEN,"Your rank is Commander!");
 }
 return 1;
}
Reply
#2

pawn Код:
CMD:rank(playerid,params[])
{
 if(GetPlayerScore(playerid) >= 0 )
 {
    SendClientMessage(playerid,GREEN,"Your rank is Rookie!");
 }
 if(GetPlayerScore(playerid) >= 150)
 {
    SendClientMessage(playerid,GREEN,"Your rank is Private!");
 }
 if(GetPlayerScore(playerid) >= 250)
 {
    SendClientMessage(playerid,GREEN,"Your rank is Corporal!");
 }
 if(GetPlayerScore(playerid) >= 350)
 {
    SendClientMessage(playerid,GREEN,"Your rank is Sergeant!");
 }
 if(GetPlayerScore(playerid) >= 500)
 {
    SendClientMessage(playerid,GREEN,"Your rank is Captain!");
 }
 if(GetPlayerScore(playerid) >= 750)
 {
    SendClientMessage(playerid, GREEN,"Your rank is Bergadier!");
 }
 if(GetPlayerScore(playerid) >= 1200)
 {
    SendClientMessage(playerid, GREEN,"Your rank is General!");
 }
 if(GetPlayerScore(playerid) >= 2000)
 {
    SendClientMessage(playerid,GREEN,"Your rank is Commander!");
 }
 return 1;
}
Reply
#3

So whats the problem?

just add >= to every check.

EDIT: The guy above me posted same secound ._.
Reply
#4

I said it cuz i need help. I also did this and u also told me.
But when i type /rank having 0 score it says "your rank is rookie" . But when i /setmyscore to 150. It show me "your rank is Rookie"
"your rank is Private"
What is This?/ Can u help me??
Reply
#5

pawn Код:
CMD:rank(playerid,params[])
{
     if(GetPlayerScore(playerid) >= 0 )
     {
        SendClientMessage(playerid,GREEN,"Your rank is Rookie!");
        return 1;
     }
     if(GetPlayerScore(playerid) >= 150)
     {
        SendClientMessage(playerid,GREEN,"Your rank is Private!");
        return 1;
     }
     if(GetPlayerScore(playerid) >= 250)
     {
        SendClientMessage(playerid,GREEN,"Your rank is Corporal!");
        return 1;
     }
     if(GetPlayerScore(playerid) >= 350)
     {
        SendClientMessage(playerid,GREEN,"Your rank is Sergeant!");
        return 1;
     }
     if(GetPlayerScore(playerid) >= 500)
     {
        SendClientMessage(playerid,GREEN,"Your rank is Captain!");
        return 1;
     }
     if(GetPlayerScore(playerid) >= 750)
     {
        SendClientMessage(playerid, GREEN,"Your rank is Bergadier!");
        return 1;
     }
     if(GetPlayerScore(playerid) >= 1200)
     {
        SendClientMessage(playerid, GREEN,"Your rank is General!");
        return 1;
     }
     if(GetPlayerScore(playerid) >= 2000)
     {
        SendClientMessage(playerid,GREEN,"Your rank is Commander!");
        return 1;
     }
     return 1;
}
Reply
#6

It could be that /setmyscore isn't working correctly, might wanna post that here.
Reply
#7

Quote:
Originally Posted by Jack Shred
Посмотреть сообщение
It could be that /setmyscore isn't working correctly, might wanna post that here.
Totally the problem here is /rank not /setmyscore. i gave the fix code above
Reply
#8

Omar Bhai here you have :

pawn Код:
CMD:rank(playerid,params[])
{
     if(GetPlayerScore(playerid) >= 0 && GetPlayerScore(playerid) < 150)// score is greater than 0 and less than 150 it rookie ... same below
     {
        SendClientMessage(playerid,GREEN,"Your rank is Rookie!");
        return 1;
     }
     if(GetPlayerScore(playerid) >= 150 && GetPlayerScore(playerid) < 250)
     {
        SendClientMessage(playerid,GREEN,"Your rank is Private!");
        return 1;
     }
     if(GetPlayerScore(playerid) >= 250 && GetPlayerScore(playerid) < 350)
     {
        SendClientMessage(playerid,GREEN,"Your rank is Corporal!");
        return 1;
     }
     if(GetPlayerScore(playerid) >= 350 && GetPlayerScore(playerid) < 500)
     {
        SendClientMessage(playerid,GREEN,"Your rank is Sergeant!");
        return 1;
     }
     if(GetPlayerScore(playerid) >= 500 && GetPlayerScore(playerid) < 750)
     {
        SendClientMessage(playerid,GREEN,"Your rank is Captain!");
        return 1;
     }
     if(GetPlayerScore(playerid) >= 750 && GetPlayerScore(playerid) < 1200)
     {
        SendClientMessage(playerid, GREEN,"Your rank is Bergadier!");
        return 1;
     }
     if(GetPlayerScore(playerid) >= 1200 && GetPlayerScore(playerid) < 2000)
     {
        SendClientMessage(playerid, GREEN,"Your rank is General!");
        return 1;
     }
     if(GetPlayerScore(playerid) >= 2000)
     {
        SendClientMessage(playerid,GREEN,"Your rank is Commander!");
        return 1;
     }
     return 1;
}
Reply
#9

Thnx It Helped me Very Much..... (rep added)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)