Raised This Month: $32 Target: $400
 8% 

Non-Prime player tag CS:GO


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BulgarianPL
Member
Join Date: Dec 2013
Old 12-08-2018 , 14:53   Non-Prime player tag CS:GO
Reply With Quote #1

Hello. Is there a possibility to create a cs go plugin which would change the player's nickname: for example, if the player was called "Fred" his nickname would be changed to "F2P Fred" or "Non-Prime Fred". This tag would make it much easier for the admins to do their job. I also do not want to block Non-Prime/F2P players from playing on my server.
BulgarianPL is offline
Cruze
Veteran Member
Join Date: May 2017
Old 12-08-2018 , 15:06   Re: Non-Prime player tag CS:GO
Reply With Quote #2

You gotta ask root88
__________________
Taking paid private requests! Contact me
Cruze is offline
Papero
Veteran Member
Join Date: Aug 2016
Location: Italy
Old 12-08-2018 , 15:48   Re: Non-Prime player tag CS:GO
Reply With Quote #3

I've added this feature into HexTags, ping me if you'd like a standalone version
__________________
My Plugins
SPCode


Steam: hexer504
Telegram: Hexah
Discord: Hexah#6903

If you like my work you can donate here!

Last edited by Papero; 12-08-2018 at 15:48.
Papero is offline
BulgarianPL
Member
Join Date: Dec 2013
Old 12-08-2018 , 16:33   Re: Non-Prime player tag CS:GO
Reply With Quote #4

I'd prefer if this standalone version would change the name not the Tags.
BulgarianPL is offline
Wacci
AlliedModders Donor
Join Date: May 2017
Location: Hungary
Old 12-10-2018 , 09:41   Re: Non-Prime player tag CS:GO
Reply With Quote #5

Quote:
Originally Posted by Papero View Post
I've added this feature into HexTags, ping me if you'd like a standalone version
I would be interested.
How do you filter them out?
__________________
Wacci is offline
freak.exe_uLow
AlliedModders Donor
Join Date: Jul 2012
Location: Germany
Old 12-10-2018 , 10:44   Re: Non-Prime player tag CS:GO
Reply With Quote #6

I hope it's allowed to post it from a discord server (not my script) credits too OkyHp & Wend4r

If that is against the rules, please delete my post

Code:
#include <sourcemod>
#include <SteamWorks>
#include <cstrike>
#pragma semicolon 1
#pragma newdecls required

bool g_bNoPrime[MAXPLAYERS+1];

public Plugin myinfo =
{
    name        = "No Prime Clan Tag",
    author        = "OkyHp & Wend4r",
    description = "Setting clan tags for NO PRIME players.",
};

public void OnPluginStart()
{
    if(GetEngineVersion() != Engine_CSGO)
    {
        SetFailState("This plugin works only on CS:GO");
    }
}

public void OnMapStart()
{
    CreateTimer(5.0, Timer_SetClanTags, _, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
}

public void OnClientPostAdminCheck(int iClient)
{
    g_bNoPrime[iClient] = SteamWorks_HasLicenseForApp(iClient, 624820) ? true : false;
    SetClientClanTag(iClient);
}

public Action Timer_SetClanTags(Handle hTimer)
{
    for(int i = 1; i <= MaxClients; i++)
    {
        if (g_bNoPrime[i] && IsClientInGame(i) && !IsFakeClient(i))
        {
            SetClientClanTag(i);
        }
    }
    return Plugin_Continue;
}

public Action SetClientClanTag(int iClient)
{
    if (g_bNoPrime[iClient] && !IsFakeClient(iClient) && IsClientInGame(iClient))
    {
        CS_SetClientClanTag(iClient, "[NO PRIME]");
    }
}
Attached Files
File Type: smx f2prename.smx (4.4 KB, 294 views)
File Type: sp Get Plugin or Get Source (f2prename.sp - 365 views - 1.2 KB)

Last edited by freak.exe_uLow; 12-13-2018 at 10:04.
freak.exe_uLow is offline
vERKE
Junior Member
Join Date: Sep 2018
Location: Hungary
Old 12-10-2018 , 15:06   Re: Non-Prime player tag CS:GO
Reply With Quote #7

Quote:
Originally Posted by freak.exe_uLow View Post
I hope it's allowed to post it from a discord server (not my script) credits too OkyHp & Wend4r

If that is against the rules, please delete my post

Code:
#include <sourcemod>
#include <SteamWorks>
#include <cstrike>
#pragma semicolon 1
#pragma newdecls required

bool g_bNoPrime[MAXPLAYERS+1];

public Plugin myinfo =
{
    name        = "No Prime Clan Tag",
    author        = "OkyHp & Wend4r",
    description = "Setting clan tags for NO PRIME players.",
};

public void OnPluginStart()
{
    if(GetEngineVersion() != Engine_CSGO)
    {
        SetFailState("This plugin works only on CS:GO");
    }
}

public void OnMapStart()
{
    CreateTimer(5.0, Timer_SetClanTags, _, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
}

public void OnClientPostAdminCheck(int iClient)
{
    g_bNoPrime[iClient] = SteamWorks_HasLicenseForApp(iClient, 624820) ? true : false;
    SetClientClanTag(iClient);
}

public Action Timer_SetClanTags(Handle hTimer)
{
    for(int i = 1; i <= MaxClients; i++)
    {
        if (g_bNoPrime[i] && !IsFakeClient(i) && IsClientInGame(i))
        {
            SetClientClanTag(i);
        }
    }
    return Plugin_Continue;
}

public Action SetClientClanTag(int iClient)
{
    if (g_bNoPrime[iClient] && !IsFakeClient(iClient) && IsClientInGame(iClient))
    {
        CS_SetClientClanTag(iClient, "[NO PRIME]");
    }
}
It works, but I have error spam in my log:
L 12/10/2018 - 2095: [SM] Exception reported: Client 7 is not connected
L 12/10/2018 - 2095: [SM] Blaming: f2prename.smx
L 12/10/2018 - 2095: [SM] Call stack trace:
L 12/10/2018 - 2095: [SM] [0] IsFakeClient
L 12/10/2018 - 2095: [SM] [1] Line 39, f2prename.sp::Timer_SetClanTags
__________________
vERKE is offline
freak.exe_uLow
AlliedModders Donor
Join Date: Jul 2012
Location: Germany
Old 12-10-2018 , 15:48   Re: Non-Prime player tag CS:GO
Reply With Quote #8

Quote:
Originally Posted by vERKE View Post
It works, but I have error spam in my log:
L 12/10/2018 - 2095: [SM] Exception reported: Client 7 is not connected
L 12/10/2018 - 2095: [SM] Blaming: f2prename.smx
L 12/10/2018 - 2095: [SM] Call stack trace:
L 12/10/2018 - 2095: [SM] [0] IsFakeClient
L 12/10/2018 - 2095: [SM] [1] Line 39, f2prename.sp::Timer_SetClanTags
maybe you need HexTags for that? I'm not sure :/
Link: removed the link, that was not correct

Last edited by freak.exe_uLow; 12-10-2018 at 19:58.
freak.exe_uLow is offline
DarkDeviL
SourceMod Moderator
Join Date: Apr 2012
Old 12-10-2018 , 16:27   Re: Non-Prime player tag CS:GO
Reply With Quote #9

Quote:
Originally Posted by freak.exe_uLow View Post
I hope it's allowed to post it from a discord server (not my script) credits too OkyHp & Wend4r

If that is against the rules, please delete my post
There is nothing wrong with posting plugins that someone else have made according to the rules, however good etiquette would be to keep / give appropriate credit like you do.

One of the biggest things would more likely be whether or not you actually support the plugins you post or not. If not, I'd suggest you leave it to the original authors post them.

Quote:
Originally Posted by freak.exe_uLow View Post
maybe you need HexTags for that? I'm not sure :/
"I'm not sure"?

No offence, but especially this thing is one of the "good" reason for not blindly sharing plugins you don't know whether they work or not, or produce errors.

In the end, you will be the one spreading bad quality :'(



For the error though, I suggest trying to re-order the !IsFakeClient and IsClientInGame, e.g. from:

Code:
!IsFakeClient(i) && IsClientInGame(i)
to

Code:
IsClientInGame(i) && !IsFakeClient(i)
There are also chances that SteamWorks_HasLicenseForApp may also return 2, if there are some odd issues (e.g. connectivity issues). And it will always if you run it on a bot.

So this part:

Code:
    g_bNoPrime[iClient] = SteamWorks_HasLicenseForApp(iClient, 624820) ? true : false;
could obviously also be made a better, as it does not account for this.
__________________
Mostly known as "DarkDeviL".

Dropbox FastDL: Public folder will no longer work after March 15, 2017!
For more info, see the [SRCDS Thread], or the [HLDS Thread].
DarkDeviL is offline
freak.exe_uLow
AlliedModders Donor
Join Date: Jul 2012
Location: Germany
Old 12-10-2018 , 18:13   Re: Non-Prime player tag CS:GO
Reply With Quote #10

Quote:
Originally Posted by arne1288 View Post
There is nothing wrong with posting plugins that someone else have made according to the rules, however good etiquette would be to keep / give appropriate credit like you do.

One of the biggest things would more likely be whether or not you actually support the plugins you post or not. If not, I'd suggest you leave it to the original authors post them.



"I'm not sure"?

No offence, but especially this thing is one of the "good" reason for not blindly sharing plugins you don't know whether they work or not, or produce errors.

In the end, you will be the one spreading bad quality :'(



For the error though, I suggest trying to re-order the !IsFakeClient and IsClientInGame, e.g. from:

Code:
!IsFakeClient(i) && IsClientInGame(i)
to

Code:
IsClientInGame(i) && !IsFakeClient(i)
There are also chances that SteamWorks_HasLicenseForApp may also return 2, if there are some odd issues (e.g. connectivity issues). And it will always if you run it on a bot.

So this part:

Code:
    g_bNoPrime[iClient] = SteamWorks_HasLicenseForApp(iClient, 624820) ? true : false;
could obviously also be made a better, as it does not account for this.
Thanks for the info, so i was not sure anymore and i dont wanted to break the rules^^ I had seen that, and just wanted to help. For me, the code looked pretty good, and I've noticed nothing bad. The script was so far, according to the statements of the user in Discord and run perfect. But thanks again for the information, so i change the code too fix that error. ^^

Last edited by freak.exe_uLow; 12-13-2018 at 10:02.
freak.exe_uLow 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 15:18.


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