/rank command Mistake. Help Please.
#1

Well..I tried to make a command which tells player rank.
So can you tell whats wrong with the code ? and solve it too ? Thanks
pawn Код:
CMD:myrank(playerid,params[])
    {
        new rank[128];
        if(Kills[playerid]<10){rank = "Newbie Shooter";}
        if(Kills[playerid]<25 && Kills[playerid]>=10) {rank = "Killer Shooter";}
        if(Kills[playerid]<75 && Kills[playerid]>=25 {rank = "Master Shooter";}
        if(Kills[playerid]<150 && Kills[playerid]>=300) {rank = "Pro Shooter";}
        if(Kills[playerid]<300 && Kills[playerid]>=450) {rank = "Striker Shooter";}
        if(Kills[playerid]<450 && Kills[playerid]>= 675) {rank = "Freekill Shooter";}
        if(Kills[playerid]<675 && Kills[playerid]>= 1000) {rank = "Psycho Shooter";}
        if(Kills[playerid]<1000 && Kills[playerid]>= 1500) {rank = "Fatal Shooter";}
        if(Kills[playerid]<1500 && Kills[playerid]>= 2250){rank = "Havoc Shooter";}
        if(Kills[playerid]<2250 && Kills[playerid]>= 3375) {rank = "Extreme Shooter";}
        if(Kills[playerid]<3375 && Kills[playerid]>= 5100) {rank = "Wild Shooter";}
        if(Kills[playerid]<5100 && Kills[playerid]>= 7650) {rank = "Hazardous Shooter";}
        if(Kills[playerid]<7650 && Kills[playerid]>= 11475) {rank = "IGI Shooter";}
        if(Kills[playerid]<11475 && Kills[playerid]>= 17500) {rank = "Tactical Shooter";}
        if(Kills[playerid]<17500 && Kills[playerid]>= 26250) {rank = "Dedicated Shooter";}
        if(Kills[playerid]<26250 && Kills[playerid]>= 39375) {rank = "Insane Shooter";}
        if(Kills[playerid]<39375 && Kills[playerid]>= 60000) {rank = "Real Shooter";}
        if(Kills[playerid]<60000 && Kills[playerid]>= 100000) {rank = "Professional Shooter";}
        if(Kills[playerid]> 100000) {rank = "Rockstar Shooter";}
        new string[500];
        format(string, sizeof(string), "{FFFFFF}Rank:%s", rank);
        ShowPlayerDialog(playerid,3,DIALOG_STYLE_MSGBOX,"{FF0000}YOUR STATS:",string,"OK","");
        return 1;
    }
Error is
C:\Documents and Settings\gaurav\Desktop\my TDM\filterscripts\admin.pwn(2712) : error 029: invalid expression, assumed zero
Reply
#2

use

pawn Код:
format(rank,sizeof(rank), "Your rank");
instead of

pawn Код:
rank = "your rank"
Reply
#3

rank="Rank"; works ^^
Reply
#4

if(Kills[playerid]<75 && Kills[playerid]>=25) {rank = "Master Shooter";}

This line is wrong you have forgot the red marked
Reply
#5

So whats the problem ?
Reply
#6

PHP код:
CMD:myrank(playerid,params[])
    {
        new 
rank[128];
        if(
Kills[playerid]<10){rank "Newbie Shooter";}
        if(
Kills[playerid]<25 && Kills[playerid]>=10) {rank "Killer Shooter";}
        if(
Kills[playerid]<75 && Kills[playerid]>=25) {rank "Master Shooter";}
        if(
Kills[playerid]<150 && Kills[playerid]>=300) {rank "Pro Shooter";}
        if(
Kills[playerid]<300 && Kills[playerid]>=450) {rank "Striker Shooter";}
        if(
Kills[playerid]<450 && Kills[playerid]>= 675) {rank "Freekill Shooter";}
        if(
Kills[playerid]<675 && Kills[playerid]>= 1000) {rank "Psycho Shooter";}
        if(
Kills[playerid]<1000 && Kills[playerid]>= 1500) {rank "Fatal Shooter";}
         if(
Kills[playerid]<1500 && Kills[playerid]>= 2250){rank "Havoc Shooter";}
        if(
Kills[playerid]<2250 && Kills[playerid]>= 3375) {rank "Extreme Shooter";}
        if(
Kills[playerid]<3375 && Kills[playerid]>= 5100) {rank "Wild Shooter";}
        if(
Kills[playerid]<5100 && Kills[playerid]>= 7650) {rank "Hazardous Shooter";}
        if(
Kills[playerid]<7650 && Kills[playerid]>= 11475) {rank "IGI Shooter";}
        if(
Kills[playerid]<11475 && Kills[playerid]>= 17500) {rank "Tactical Shooter";}
        if(
Kills[playerid]<17500 && Kills[playerid]>= 26250) {rank "Dedicated Shooter";}
        if(
Kills[playerid]<26250 && Kills[playerid]>= 39375) {rank "Insane Shooter";}
        if(
Kills[playerid]<39375 && Kills[playerid]>= 60000) {rank "Real Shooter";}
        if(
Kills[playerid]<60000 && Kills[playerid]>= 100000) {rank "Professional Shooter";}
        if(
Kills[playerid]> 100000) {rank "Rockstar Shooter";}
                         new 
string[500];
                         
format(stringsizeof(string), "{FFFFFF}Rank:%s"rank);
                         
ShowPlayerDialog(playerid,3,DIALOG_STYLE_MSGBOX,"{FF0000}YOUR STATS:",string,"OK","");
        return 
1;
    } 
Reply
#7

Brilliant Marcel ! .

Rep for that brilliant mistake finder
P.S i did posted that lol post..because you didn't posted the solution..but after i did posted it you did replied with answer xD..
Anyway Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)