Raised This Month: $51 Target: $400
 12% 

Level Ranks Flags


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
OXYD
AlliedModders Donor
Join Date: Aug 2019
Location: pluto
Old 08-25-2019 , 14:21   Level Ranks Flags
Reply With Quote #1

Hy! Can someone help me with some functions?

I need some natives from LevelRanks and some functions that will do this:
- If a player reach for example rank 18 -> he gets the a b and c flags, but he will have them forever
- If i reset the LevelRanks database, he will lose those flags


All im asking r the natives and functions to do that, cuz i have no idea which one should i use.

If u can implement those in a code, it will be perfect. Thanks
__________________
ADD ME ON STEAM - https://steamcommunity.com/id/kenoxyd
89.40.104.210:27015 // COMPETITIVE SERVER
DISCORD: KENOXYD#9098
OXYD is offline
Kellan123
AlliedModders Donor
Join Date: Aug 2012
Old 08-25-2019 , 17:26   Re: Level Ranks Flags
Reply With Quote #2

Are you using https://forums.alliedmods.net/showthread.php?t=299311 ?!?

Flags: https://wiki.alliedmods.net/Checking...Mod_Scripting)

PHP Code:
Ex:

Use 
native#include <lvl_ranks>

Check rank: if(LR_GetClientPos(client) >= 18)

new 
flags GetUserFlagBits(client);

if(!(
flags ADMFLAG_RESERVATION)) SetUserFlagBits(clientflags ADMFLAG_RESERVATION); 

Last edited by Kellan123; 08-25-2019 at 17:44.
Kellan123 is offline
OXYD
AlliedModders Donor
Join Date: Aug 2019
Location: pluto
Old 08-26-2019 , 05:33   Re: Level Ranks Flags
Reply With Quote #3

I get this error
HTML Code:
Native "LR_GetClientPos" was not found.
This is the source


HTML Code:
#pragma semicolon 1

#define DEBUG

#define PLUGIN_AUTHOR "KENOXYD"

#include <sourcemod>
#include <lvl_ranks>

public Plugin myinfo = 
{
	name = "Crook Ranks",
	author = PLUGIN_AUTHOR,
	description = "Gives player flags if he reach some certain rank",
	url = "https://hellhounds.ro"
};

public void OnPluginStart()
{
	HookEvent("player_spawn", PlayerSpawn);
}

public void PlayerSpawn(Handle hEvent, char[] sEvName, bool bDontBroadcast){
	int iClient;
	
	new flags = GetUserFlagBits(iClient);
	
	if(LR_GetClientPos(iClient, ST_RANK) >= 18)
	{
		SetUserFlagBits(iClient, flags | ADMFLAG_ROOT);
	}

}
__________________
ADD ME ON STEAM - https://steamcommunity.com/id/kenoxyd
89.40.104.210:27015 // COMPETITIVE SERVER
DISCORD: KENOXYD#9098
OXYD is offline
Kellan123
AlliedModders Donor
Join Date: Aug 2012
Old 08-26-2019 , 11:42   Re: Level Ranks Flags
Reply With Quote #4

Quote:
Originally Posted by OXYD View Post
I get this error
HTML Code:
Native "LR_GetClientPos" was not found.
This is the source


HTML Code:
#pragma semicolon 1

#define DEBUG

#define PLUGIN_AUTHOR "KENOXYD"

#include <sourcemod>
#include <lvl_ranks>

public Plugin myinfo = 
{
	name = "Crook Ranks",
	author = PLUGIN_AUTHOR,
	description = "Gives player flags if he reach some certain rank",
	url = "https://hellhounds.ro"
};

public void OnPluginStart()
{
	HookEvent("player_spawn", PlayerSpawn);
}

public void PlayerSpawn(Handle hEvent, char[] sEvName, bool bDontBroadcast){
	int iClient;
	
	new flags = GetUserFlagBits(iClient);
	
	if(LR_GetClientPos(iClient, ST_RANK) >= 18)
	{
		SetUserFlagBits(iClient, flags | ADMFLAG_ROOT);
	}

}
Are you sure have includes in scripting folder ?

PHP Code:
public void PlayerSpawn(Handle hEventchar[] sEvNamebool bDontBroadcast)
{
    
int iClient GetClientOfUserId(GetEventInt(hEvent"userid"));
    
int iFlags GetUserFlagBits(iClient);
    
    if(
LR_GetClientPos(iClient) >= 18)
    {
        if(!(
GetUserFlagBits(iClient) & ADMFLAG_ROOT)) SetUserFlagBits(iClientiFlags ADMFLAG_ROOT);
    }
    else
    {
        if(
GetUserFlagBits(iClient) & ADMFLAG_ROOTSetUserFlagBits(iClientiFlags & ~ADMFLAG_ROOT);
    }

im getting 0 error

Last edited by Kellan123; 08-28-2019 at 10:54.
Kellan123 is offline
OXYD
AlliedModders Donor
Join Date: Aug 2019
Location: pluto
Old 08-26-2019 , 16:13   Re: Level Ranks Flags
Reply With Quote #5

that error is in error log, not in the compile

I tryed with ur version, and i still dont get that flag'

HTML Code:
L 08/26/2019 - 17:52:32: Error log file session closed.
L 08/26/2019 - 23:20:16: SourceMod error session started
L 08/26/2019 - 23:20:16: Info (map "de_dust2_oldgo") (file "errors_20190826.log")
L 08/26/2019 - 23:20:16: [SM] Unable to load plugin "levelsranks/lvl_flags.smx": Native "LR_GetClientPos" was not found
__________________
ADD ME ON STEAM - https://steamcommunity.com/id/kenoxyd
89.40.104.210:27015 // COMPETITIVE SERVER
DISCORD: KENOXYD#9098

Last edited by OXYD; 08-26-2019 at 16:31.
OXYD is offline
Kellan123
AlliedModders Donor
Join Date: Aug 2012
Old 08-28-2019 , 10:55   Re: Level Ranks Flags
Reply With Quote #6

you are using wrong way...
Kellan123 is offline
OXYD
AlliedModders Donor
Join Date: Aug 2019
Location: pluto
Old 08-28-2019 , 19:06   Re: Level Ranks Flags
Reply With Quote #7

Quote:
Originally Posted by Kellan123 View Post
you are using wrong way...
More details? Its not working, idk why
__________________
ADD ME ON STEAM - https://steamcommunity.com/id/kenoxyd
89.40.104.210:27015 // COMPETITIVE SERVER
DISCORD: KENOXYD#9098
OXYD is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:05.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode