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

Become VIP Plus


Post New Thread Reply   
 
Thread Tools Display Modes
Alber9091
Veteran Member
Join Date: Jun 2014
Location: Karachi, Pakistan
Old 07-30-2018 , 14:31   Re: Become VIP Plus
Reply With Quote #31

Quote:
Originally Posted by OciXCrom View Post
This hasn't happened to anyone else. Probably some other plugin is causing problems.

Try this simple code:

PHP Code:
#include <amxmodx>

public plugin_init()
{
    
register_clcmd("say /flags""change")
}

public 
change(id)
{
    
set_user_flags(idread_flags("abcdei"))
    
client_print(idprint_chat"changed flags")
    return 
PLUGIN_HANDLED

Type /flags in the chat and see if your flags changed.
I haven't tested this plugin, but before this I was using another plguin like this, but as it had some more features, so I adopted this one. Where as that plugin was working fine. [I have pmed u the source code of my that plugin]

Last edited by Alber9091; 07-30-2018 at 14:49.
Alber9091 is offline
Alber9091
Veteran Member
Join Date: Jun 2014
Location: Karachi, Pakistan
Old 07-30-2018 , 14:32   Re: Become VIP Plus
Reply With Quote #32

Quote:
Originally Posted by OciXCrom View Post
Post your BecomeVIP.ini file too.
Quote:
#============================================ ====#
# BecomeVIP Plus by OciXCrom: Configuration file #
#============================================ ====#

# The main prefix for plugin messages.
PLUGIN_PREFIX = &x04[KC]

# How to save players' kills?
# 0 = name <default>; 1 = IP; 2 = SteamID
SAVE_TYPE = 2

# Amount of kills needed to become VIP.
# default: 1000
KILLS_NEEDED = 150

# Which flags will players that become VIP receive.
# default: m
VIP_FLAGS = t

# Commands that will show how many kills you have.
# Those starting with "/" or "!" are considered as chat commands.
# default: /becomevip, /kills
CHECK_KILLS_COMMANDS = /becomevip, /kills, /points, /point

# The vault file where the players' kills are stored.
# default: BecomeVIP
VAULT_FILE = BecomeVIP

# If set to 1, bots won't receive any flags.
IGNORE_BOTS = 1

# Who should see a chat message when a player becomes VIP.
# 0 = nobody; 1 = only the player; 2 = all players <default>
VIP_SUCCESS_MESSAGE = 2

# Enabled the HUD message on spawn?
# default: 1
HUD_MESSAGE_ENABLED = 1

# HUD message color (use -1 for a random value).
# default: 0 255 -1
HUD_MESSAGE_COLOR = 0 255 -1

# HUD message position.
# default: 0.1 0.2
HUD_MESSAGE_POSITION = 0.1 0.2

# HUD message duration.
# default: 5.0
HUD_MESSAGE_DURATION = 5.0

# HUD message effects, fxtime, fade-in time, fade-out time.
# default: 2 2.0 0.03 0.2
HUD_MESSAGE_EFFECTS = 2 2.0 0.03 0.2

Last edited by Alber9091; 07-30-2018 at 14:32.
Alber9091 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 07-30-2018 , 15:13   Re: Become VIP Plus
Reply With Quote #33

Try disabling the IGNORE_BOTS option since I didn't really test it out.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Alber9091
Veteran Member
Join Date: Jun 2014
Location: Karachi, Pakistan
Old 07-30-2018 , 15:49   Re: Become VIP Plus
Reply With Quote #34

Quote:
Originally Posted by OciXCrom View Post
Try disabling the IGNORE_BOTS option since I didn't really test it out.
Same Results.
Alber9091 is offline
Old 08-05-2018, 14:08
Shadowless
This message has been deleted by Shadowless.
Old 08-05-2018, 14:10
Shadowless
This message has been deleted by Shadowless.
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 08-05-2018 , 14:16   Re: Become VIP Plus
Reply With Quote #35

Quote:
Originally Posted by Shadowless View Post
2 questions..

FIRST - what about to add function how many days keep ppl in VIP list
SECOND - which VIP models module do u advice for this plugin?
1. That will be very complicated to make so I don't have such plans for now.

2. Any simple and properly coded plugin. Here's one that I made:

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>

#define SKIN_FLAG ADMIN_RESERVATION
#define SKIN_CT "admin_ct"
#define SKIN_T "admin_t"

new bool:g_bHasCustomSkin[33]

public 
plugin_init()
{
    
register_plugin("Simple VIP Model""1.0""OciXCrom")
    
RegisterHam(Ham_Spawn"player""OnPlayerSpawn"1)
}

public 
plugin_precache()
{    
    
precache_player_model(SKIN_CT)
    
precache_player_model(SKIN_T)
}

public 
client_putinserver(id)
    
g_bHasCustomSkin[id] = false

public OnPlayerSpawn(id)
{
    if(
is_user_alive(id))
    {
        if(
get_user_flags(id) & SKIN_FLAG)
        {
            switch(
cs_get_user_team(id))
            {
                case 
CS_TEAM_CTset_model(idSKIN_CT)
                case 
CS_TEAM_Tset_model(idSKIN_T)
            }
        }
        else if(
g_bHasCustomSkin[id])
            
cs_reset_user_model(id)
    }
}

set_model(const id, const szModel[])
{
    
cs_set_user_model(idszModel)
    
g_bHasCustomSkin[id] = true
}

precache_player_model(szModel[])
{
    static 
szFile[128]
    
formatex(szFilecharsmax(szFile), "models/player/%s/%s.mdl"szModelszModel)
    
precache_model(szFile)
    
replace(szFilecharsmax(szFile), ".mdl""T.mdl")
    
    if(
file_exists(szFile))
        
precache_model(szFile)

__________________

Last edited by OciXCrom; 08-05-2018 at 14:16.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Old 08-05-2018, 14:27
Shadowless
This message has been deleted by Shadowless.
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 08-05-2018 , 14:42   Re: Become VIP Plus
Reply With Quote #36

No, people with the flag set in #define SKIN_FLAG will do (ADMIN_RESERVATION is flag "b"). Change the flag if you have a different flag set in BecomeVIP.ini and set the model names.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Old 08-05-2018, 15:12
Shadowless
This message has been deleted by Shadowless.
Old 08-05-2018, 15:14
Shadowless
This message has been deleted by Shadowless.
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-05-2018 , 15:15   Re: Become VIP Plus
Reply With Quote #37

About the expiration time, if you ever decide to give it a shot, here's an idea:
1.Use http://amxmodx.org/api/amxmodx/parse_time to convert from date to timestamp.
2.Retrieve current timestamp.
3.Compare both timestamps and if current timestamp is bigger remove the vip.

Shouldn't be that hard if you use this method.
__________________
HamletEagle is offline
Old 08-05-2018, 15:19
Shadowless
This message has been deleted by Shadowless.
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 08-05-2018 , 16:41   Re: Become VIP Plus
Reply With Quote #38

@HamletEagle - I know how to compare the dates, my only worry is when to actually save and load the timestamp because right now the only thing that the plugin saves is the amount of kills the player has. I'll need to change more stuff if in order to do it.

@Shadowless - it's correct assuming that you have flag "c" in BecomeVIP.ini.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Old 08-06-2018, 04:21
Shadowless
This message has been deleted by Shadowless.
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 08-06-2018 , 08:19   Re: Become VIP Plus
Reply With Quote #39

Change:

Code:
if(is_user_alive(id))

With:

Code:
if(is_user_alive(id) && !is_user_bot(id))
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-06-2018 , 09:58   Re: Become VIP Plus
Reply With Quote #40

You could use a separate vault file if you want to implement this without minimal changes to the code. Lazy way, but not that bad.
__________________

Last edited by HamletEagle; 08-06-2018 at 09:59.
HamletEagle 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 13:16.


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