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

Simple VIP Icon


Post New Thread Reply   
 
Thread Tools Display Modes
condolent
AlliedModders Donor
Join Date: Jan 2016
Location: gc_sLocation;
Old 05-31-2020 , 06:09   Re: Simple VIP Icon
Reply With Quote #21

Quote:
Originally Posted by Nickolay View Post
Did a full restart and found this? Unknown command "sm_vipicon_flag"
Every file I got from the download was added.
Found nothing other than that.
Can't replicate the failure. Which version are you running? Type sm_vipicon_version in server console and the reply should be the plugin version.
__________________
condolent is offline
Nickolay
Member
Join Date: Jan 2020
Old 05-31-2020 , 10:11   Re: Simple VIP Icon
Reply With Quote #22

"sm_vipicon_version" = "1.2.2"

Did a restart today and seems like the command is working, though I've hit another brick wall.
Even with the flag set towards z, it doesn't show, nor does it on "a" when I try.
"sm_vipicon_flag" = "z"

I found a message regarding the material, though It's greek for me, could this have any mean to the cause?
Late precache of materials/decals/vipicon/vip.vmt
Nickolay is offline
condolent
AlliedModders Donor
Join Date: Jan 2016
Location: gc_sLocation;
Old 05-31-2020 , 10:15   Re: Simple VIP Icon
Reply With Quote #23

Quote:
Originally Posted by Nickolay View Post
"sm_vipicon_version" = "1.2.2"

Did a restart today and seems like the command is working, though I've hit another brick wall.
Even with the flag set towards z, it doesn't show, nor does it on "a" when I try.
"sm_vipicon_flag" = "z"

I found a message regarding the material, though It's greek for me, could this have any mean to the cause?
Late precache of materials/decals/vipicon/vip.vmt
Outdated version. Latest version is 1.2.5
__________________
condolent is offline
Nickolay
Member
Join Date: Jan 2020
Old 05-31-2020 , 10:23   Re: Simple VIP Icon
Reply With Quote #24

Quote:
Originally Posted by condolent View Post
Outdated version. Latest version is 1.2.5
I removed the old files, unloaded the plugin from sourcemod, downloaded the new files from attachments on this page, then loaded the plugin with all the new files.
Yet I'm still getting the same version?
"sm_vipicon_version" = "1.2.2"

Edit 02/06: I downloaded the files again and got the version 1.2.4, though still doesn't work with that either.

Last edited by Nickolay; 06-02-2020 at 14:01.
Nickolay is offline
iNvidie
New Member
Join Date: Jun 2020
Old 06-21-2020 , 02:35   Re: Simple VIP Icon
Reply With Quote #25

Hi, I have a small problem.. when someone with vipicon dies, the icon still remains where the player died, how can I remove that?
iNvidie is offline
Cruze
Veteran Member
Join Date: May 2017
Old 06-21-2020 , 03:51   Re: Simple VIP Icon
Reply With Quote #26

PHP Code:
#pragma semicolon 1
#pragma newdecls required

#define PLUGIN_AUTHOR "Hypr"
#define PLUGIN_VERSION "1.2.5"

#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#include <condostocks>
#include <autoexecconfig>

ConVar gc_sVipFlag;
ConVar gc_sIconPath;

int g_iIcon[MAXPLAYERS +1] = {-1, ...};

char g_sIconPath[256];
char g_sAdmflag[64];

public 
Plugin myinfo = {
    
name "VIP Icon",
    
author PLUGIN_AUTHOR,
    
description "Puts a VIP-icon above the player models",
    
version PLUGIN_VERSION,
    
url "https://github.com/condolent/vip-icon"
};

public 
void OnPluginStart() {
    
AutoExecConfig_SetFile("vipicon"); // What's the configs name and location?
    
AutoExecConfig_SetCreateFile(true); // Create config if it does not exist
    
    
AutoExecConfig_CreateConVar("sm_vipicon_version"PLUGIN_VERSION"Current version running of vip-icon"FCVAR_DONTRECORD);
    
gc_sVipFlag AutoExecConfig_CreateConVar("sm_vipicon_flag""a""The flag needed for getting the VIP-icon."FCVAR_NOTIFY);
    
gc_sIconPath AutoExecConfig_CreateConVar("sm_vipicon_path""decals/vipicon/vip""The path and filename for the icon"FCVAR_NOTIFY);
    
    
AutoExecConfig_ExecuteFile(); // Execute the config
    
AutoExecConfig_CleanFile(); // Clean the .cfg from spaces etc.
    
    
HookEvent("player_spawn"OnPlayerSpawnEventHookMode_Pre);
    
HookEvent("player_death"OnPlayerDeathEventHookMode_Post);
    
    
// Retrieve the path for the icon
    
GetConVarString(gc_sIconPathg_sIconPathsizeof(g_sIconPath));
    
// Retrieve the admin flag required for the icon
    
GetConVarString(gc_sVipFlagg_sAdmflagsizeof(g_sAdmflag));
}

public 
void OnMapStart() {
    
// Add files to download
    
PrecacheMaterialAnyDownload(g_sIconPath);
}

public 
void OnPlayerDeath(Event event, const char[] namebool dontBroadcast) {
    
int client GetClientOfUserId(GetEventInt(event"userid"));
    if(
IsValidClient(client))
    {
        
RemoveIcon(client);
    }
}

public 
void OnPlayerSpawn(Event event, const char[] namebool dontBroadcast) {
    
int client GetClientOfUserId(GetEventInt(event"userid"));
    
    if(
IsValidClient(client)) {
        if((
GetUserFlagBits(client) & ReadFlagString(g_sAdmflag) == ReadFlagString(g_sAdmflag))) { // Make sure the user has the correct flag(s) for the icon
            
CreateIcon(client); // Sets the icon on top of the client
        
}
    }
}

public 
void CreateIcon(int client) {
    if(!
IsValidClient(client))
        return;
    
    
RemoveIcon(client);
    
    
char iTarget[16];
    
Format(iTarget16"client%d"client);
    
DispatchKeyValue(client"targetname"iTarget);
    
    
g_iIcon[client] = CreateEntityByName("env_sprite");
    
    if (!
g_iIcon[client]) 
        return;
    
    
char iconbuffer[256];
    
    
Format(iconbuffersizeof(iconbuffer), "materials/%s.vmt"g_sIconPath);
    
    
DispatchKeyValue(g_iIcon[client], "model"iconbuffer);
    
DispatchKeyValue(g_iIcon[client], "classname""env_sprite");
    
DispatchKeyValue(g_iIcon[client], "spawnflags""1");
    
DispatchKeyValue(g_iIcon[client], "scale""0.3");
    
DispatchKeyValue(g_iIcon[client], "rendermode""1");
    
DispatchKeyValue(g_iIcon[client], "rendercolor""255 255 255");
    
DispatchSpawn(g_iIcon[client]);
    
    
float origin[3];
    
GetClientAbsOrigin(clientorigin);
    
origin[2] = origin[2] + 90.0;
    
    
TeleportEntity(g_iIcon[client], originNULL_VECTORNULL_VECTOR);
    
SetVariantString(iTarget);
    
AcceptEntityInput(g_iIcon[client], "SetParent"g_iIcon[client], g_iIcon[client], 0);
    
    
SDKHook(g_iIcon[client], SDKHook_SetTransmitShould_TransmitW);
}

public 
void RemoveIcon(int client) {
    if(
g_iIcon[client] > && IsValidEdict(g_iIcon[client])) {
        
AcceptEntityInput(g_iIcon[client], "Kill");
        
g_iIcon[client] = -1;
    }
}

public 
Action Should_TransmitW(int entityint client) {
    
char m_ModelName[PLATFORM_MAX_PATH];
    
char iconbuffer[256];

    
Format(iconbuffersizeof(iconbuffer), "materials/%s.vmt"g_sIconPath);

    
GetEntPropString(entityProp_Data"m_ModelName"m_ModelNamesizeof(m_ModelName));

    if (
StrEqual(iconbufferm_ModelName))
    {
        return 
Plugin_Continue;
    }

    return 
Plugin_Handled;

__________________
Taking paid private requests! Contact me
Cruze is offline
zwetch
Senior Member
Join Date: Aug 2015
Location: South Africa
Old 06-25-2020 , 10:15   Re: Simple VIP Icon
Reply With Quote #27

Quote:
Originally Posted by Nickolay View Post
I've tried to add the icon without any luck, anyone who might have an idea?
Players download the vip vmt/vtf in bz2 successfully, and the flag is set to flag a.
Though users can't see it?

Config is default:
sm_vipicon_path "decals/vipicon/vip"
sm_vipicon_flag "z"

Icon:
csgo/materials/decals/vipicon/((files))
Files being vip.vmt & vip.vtf
The Path is "decals/vipicon" , not "decals/vipicon/vip"
__________________
https://forums.alliedmods.net/signaturepics/sigpic262740_1.gif
zwetch is offline
Nickolay
Member
Join Date: Jan 2020
Old 06-27-2020 , 19:53   Re: Simple VIP Icon
Reply With Quote #28

Quote:
Originally Posted by zwetch View Post
The Path is "decals/vipicon" , not "decals/vipicon/vip"
Sure?
The default is "decals/vipicon/vip", as the config says it requires the filename as well.
Nickolay is offline
venter25
Member
Join Date: Jul 2019
Old 08-13-2020 , 10:46   Re: Simple VIP Icon
Reply With Quote #29

Does this work on tf2? I am trying to get it to show up on ctf_2fort, but nothing.

Thank you.
venter25 is offline
Sandervraun
Senior Member
Join Date: May 2019
Location: Denmark
Old 08-14-2020 , 13:57   Re: Simple VIP Icon
Reply With Quote #30

Any way to make this display in the ground underneath the player between the legs? I find it very stupid and obvious, to blow your cover, if you got this above your head.
Sandervraun 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 02:32.


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