Post: Check if someone is a certain level?
02-22-2016, 11:59 AM #1
(adsbygoogle = window.adsbygoogle || []).push({}); I was wondering how to check if someone was a certain level and if not to call a different function
So lets say if they are not level 55 it will not call one function but skip it and call another...
(adsbygoogle = window.adsbygoogle || []).push({});
02-22-2016, 02:01 PM #2
seanhellen
Are you high?
Something like this?
    
If(player.pers["rank"] != 55)
{
//dont do anything
else
{
//do something
}


On my phone so might not be quite right but something along those lines Happy
Isnt there a getrank() function too?
02-22-2016, 04:32 PM #3
DoraTheKiller97
Treasure hunter
Im looking for this as well, would work great for an xp lobby/Unlock all camos lobby.

EDIT: I think i found a way. Try this

    if(player.pers["rank"] == player.maxRank)
{
//do something
}
else
{
// do something else
}
02-22-2016, 06:50 PM #4
seanhellen
Are you high?
Originally posted by dorathekiller97 View Post
Im looking for this as well, would work great for an xp lobby/Unlock all camos lobby.

EDIT: I think i found a way. Try this

    if(player.pers["rank"] == player.maxRank)
{
//do something
}
else
{
// do something else
}



Yeah. Stick it in a function n it should work...hopefully Happy

The following user thanked seanhellen for this useful post:

DoraTheKiller97
02-22-2016, 10:22 PM #5
None of these seem to work correctly for some odd reason, I had one of them skipping to the else function but that was for level 55 and level 1 so I am not sure what is wrong :/
02-23-2016, 07:09 AM #6
seanhellen
Are you high?
Originally posted by TheNiceUb3r View Post
None of these seem to work correctly for some odd reason, I had one of them skipping to the else function but that was for level 55 and level 1 so I am not sure what is wrong :/


If it was mine, try putting == 55 where i put != 55. Then if someone is level 55, itll do the if, if not itll do the else so;

    
Rank(player)
{
if(player.pers["rank"] == 55)
{
//do stuff for level 55;
}
else
{
//do stuff for under 55;
}
}


This is for a certain player, you could use a foreach loop to do it for everyone

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo