Author Topic: Rank mod var not working [Solved]  (Read 967 times)

I'm not sure if this is the right place for this, but i figured it dealt with coding so yeah.

But this rank mod, says it comes with variables but it doesn't seem to work at all. For example when you get to rank 2 and if you use variables to check if your rank 2 or above, it just comes back as false. So I was hoping someone would know what to do to fix this
« Last Edit: August 21, 2016, 12:02:08 PM by YounqD »

This mod uses Client.rank to store the rank value. Typing announce(findclientbyname(yournamehere).rank); will announce your rank.

To check if a player's level is above a certain point, you could do something like this:

Code: [Select]
if(%client.rank >= 32)
     return 1;
else
     return 0;

This will return true when the player's rank is equal to or above 32, and false if it isn't
« Last Edit: August 21, 2016, 09:53:59 AM by PhantOS »

Code: [Select]
if(%client.rank >= 32)
     return 1;
else
     return 0;

This will return true when the player's rank is equal to or above 32, and false if it isn't
This if statement is redundant, %client.rank >= 32 will either return true or false.

This mod uses Client.rank to store the rank value. Typing announce(findclientbyname(yournamehere).rank); will announce your rank.

To check if a player's level is above a certain point, you could do something like this:

Code: [Select]
if(%client.rank >= 32)
     return 1;
else
     return 0;

This will return true when the player's rank is equal to or above 32, and false if it isn't

So wait, where would i put this?

So wait, where would i put this?
I really don't know what you're trying to do exactly. If you want to find out if the rank is higher than that number you just put it in anywhere. If you need it properly packaged, do something like this:

Code: [Select]
function isRankHigher(%c,%r)
{
     return (%c.rank > %r);
}

isRankHigher(findclientbyname(playerName),2);
this will tell you whether the player you're looking for's rank is higher than 2. You can do anything with this, and that's up to you. Where you put it in the code is also up to you, and nobody can really decide that for you.


I really don't know what you're trying to do exactly. If you want to find out if the rank is higher than that number you just put it in anywhere. If you need it properly packaged, do something like this:

Code: [Select]
function isRankHigher(%c,%r)
{
     return (%c.rank > %r);
}

isRankHigher(findclientbyname(playerName),2);
this will tell you whether the player you're looking for's rank is higher than 2. You can do anything with this, and that's up to you. Where you put it in the code is also up to you, and nobody can really decide that for you.

Sorry I should've specified more, but yes I did want it packaged, i didn't know how to say it, but also i went in game to check if it works and it still being weird here let me show you how the events are set up so you have a better idea of what i'm trying to do


Sorry I should've specified more, but yes I did want it packaged, i didn't know how to say it, but also i went in game to check if it works and it still being weird here let me show you how the events are set up so you have a better idea of what i'm trying to do

you're supposed to be using VCE_ifValue as the event and <var:cl:rank> as the value.

you're supposed to be using VCE_ifValue as the event and <var:cl:rank> as the value.

Welp time to kms, all this time lmao thanks man sorry ya'll for the confusion