Results 1 to 7 of 7

Thread: Rank check

  1. #1
    Lieutenant Loveboy's Avatar
    Join Date
    Nov 2012
    Posts
    546
    Thanks
    229
    Thanked 72 Times in 46 Posts

    Rank check

    Hello Guys, i am new here. I have a rank system, and i make a rank shop
    i want a "rank check" to get a weapon

    so If a guy is rank 5, then he can get "bren_mp"
    else
    you need more ranks

  2. #2
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    Hey, i dont know which rank-system you got, but i guess its IzNoGod's.

    You can write:

    Code:
    if (player.stats["rank"] < 5)
    {
        player iprintlnbold("Get rank 5 first!");
        return;
    }
    timescale 0.01

  3. #3
    Lieutenant Loveboy's Avatar
    Join Date
    Nov 2012
    Posts
    546
    Thanks
    229
    Thanked 72 Times in 46 Posts
    Hmmm please add something how like a script for "bren_mp" and with "else -> not enough rank"

  4. #4
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    Code:
    if (player.stats["rank"] < 5)
    {
         player iprintlnbold("Get rank 5 first!");
         return; 
    }
    player iprintlnbold("You got Bren!");
    player switchToWeapon("bren_mp");
    timescale 0.01

  5. #5
    Lieutenant Loveboy's Avatar
    Join Date
    Nov 2012
    Posts
    546
    Thanks
    229
    Thanked 72 Times in 46 Posts
    also ginge es auch so?

    if (player.stats["rank"] < 5)
    {
    player setweaponslotweapon("primary","bren");
    return;
    }
    else
    {
    player iprintlnbold("Get rank 5!");
    }

  6. #6
    Lieutenant Loveboy's Avatar
    Join Date
    Nov 2012
    Posts
    546
    Thanks
    229
    Thanked 72 Times in 46 Posts
    Ok, i have

    switch(response)
    {
    case "1":

    wepcurrent = self getcurrentweapon();


    if(self.money >= 10)
    {
    if (self.stats["rank"] < 3)
    {
    self iprintlnbold("Get rank 3 first!");
    return;
    }
    self iprintlnbold("You got Bren!");
    self setweaponslotweapon("raygun_mp");
    self.money-=10;
    self iprintlnbold("^1-10");
    self iprintlnbold("^2You bought: Raygun");
    }

    else if(self.money < 10)
    {
    self iprintlnbold("^1Not enough Money!");
    }
    break;

    If i am not rank 3 (display: "Get rank 3 first!") <- GOOD
    If i am over rank 3 (display: "Get rank 3 first!") <- BAD

  7. #7
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    1. speak english
    2. use [code][/code] for code-format

    Yes, that if-else would be also possible, but it makes the code uglier.

    I guess your mod doesnt set player.stats["rank"], so it wont work. what rank-mod are you using?
    timescale 0.01

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •