Raised This Month: $89 Target: $400
 22% 

[CSGO]Vip activated message


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Sajmooooon
Member
Join Date: Nov 2018
Location: Slovakia
Old 09-10-2019 , 05:06   [CSGO]Vip activated message
Reply With Quote #1

Hi, I'm looking for plugin that will check if player has flag a on every spawn and if he has that, it will write in chat "You have VIP features" or something like that and it will not check him again.
Sajmooooon is offline
DiogoOnAir
Senior Member
Join Date: Jul 2018
Location: Portugal
Old 09-10-2019 , 08:39   Re: [CSGO]Vip activated message
Reply With Quote #2

Quote:
Originally Posted by Sajmooooon View Post
Hi, I'm looking for plugin that will check if player has flag a on every spawn and if he has that, it will write in chat "You have VIP features" or something like that and it will not check him again.
Code:
#pragma semicolon 1

#define DEBUG

#define PLUGIN_AUTHOR "DiogoOnAir"
#define PLUGIN_VERSION "1.00"

#include <sourcemod>
#include <sdktools>

#pragma newdecls required

public Plugin myinfo = 
{
	name = "",
	author = PLUGIN_AUTHOR,
	description = "",
	version = PLUGIN_VERSION,
	url = "https://www.steamcommunity.com/id/diogo218dv"
};

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

public Action PlayerSpawn(Handle event, const char[] name, bool dontBroadcast)
{
	int client = GetClientOfUserId(GetEventInt(event, "userid"));
	if(CheckCommandAccess(client, "anything", ADMFLAG_GENERIC))
    	    PrintToChat(client, "You have VIP features");
}
__________________
I accept Private(Paid) plugins requests
If you like my job donate me via Paypal
Feel free to add me on Steam
Feel free to add me on Discord DiogoOnAir | Config & Developer#7961
Check my website

Last edited by DiogoOnAir; 09-10-2019 at 08:40.
DiogoOnAir is offline
Sajmooooon
Member
Join Date: Nov 2018
Location: Slovakia
Old 09-10-2019 , 09:07   Re: [CSGO]Vip activated message
Reply With Quote #3

Quote:
Originally Posted by DiogoOnAir View Post
Code:
#pragma semicolon 1

#define DEBUG

#define PLUGIN_AUTHOR "DiogoOnAir"
#define PLUGIN_VERSION "1.00"

#include <sourcemod>
#include <sdktools>

#pragma newdecls required

public Plugin myinfo = 
{
	name = "",
	author = PLUGIN_AUTHOR,
	description = "",
	version = PLUGIN_VERSION,
	url = "https://www.steamcommunity.com/id/diogo218dv"
};

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

public Action PlayerSpawn(Handle event, const char[] name, bool dontBroadcast)
{
	int client = GetClientOfUserId(GetEventInt(event, "userid"));
	if(CheckCommandAccess(client, "anything", ADMFLAG_GENERIC))
    	    PrintToChat(client, "You have VIP features");
}
Thanks I will try it.

Edit: It works good but little problem, it's writting that message on every spawn it's possible edit that it will write only once, like it will save that one with flag in databes or something like that ?

Last edited by Sajmooooon; 09-10-2019 at 09:18.
Sajmooooon is offline
DiogoOnAir
Senior Member
Join Date: Jul 2018
Location: Portugal
Old 09-11-2019 , 09:21   Re: [CSGO]Vip activated message
Reply With Quote #4

Code:
#pragma semicolon 1

#define DEBUG

#define PLUGIN_AUTHOR "DiogoOnAir"
#define PLUGIN_VERSION "1.00"

#include <sourcemod>
#include <sdktools>

#pragma newdecls required

bool g_anybool[MAXPLAYERS + 1];

public Plugin myinfo = 
{
	name = "",
	author = PLUGIN_AUTHOR,
	description = "",
	version = PLUGIN_VERSION,
	url = "https://www.steamcommunity.com/id/diogo218dv"
};

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

public Action PlayerSpawn(Handle event, const char[] name, bool dontBroadcast)
{
	int client = GetClientOfUserId(GetEventInt(event, "userid"));
	if(CheckCommandAccess(client, "anything", ADMFLAG_RESERVATION))
			if(!g_anybool[client])
			{
				PrintToChat(client, "You have VIP features");
    	    	                g_anybool[client] = true;
		        }
}

public void OnClientPutInServer(int client)
{
    g_anybool[client] = false;
}
__________________
I accept Private(Paid) plugins requests
If you like my job donate me via Paypal
Feel free to add me on Steam
Feel free to add me on Discord DiogoOnAir | Config & Developer#7961
Check my website

Last edited by DiogoOnAir; 09-11-2019 at 09:22.
DiogoOnAir is offline
Reply


Thread Tools
Display Modes

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 21:03.


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