Raised This Month: $ Target: $400
 0% 

[Request] VIP Privilages


Post New Thread Reply   
 
Thread Tools Display Modes
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 04-06-2020 , 15:53   Re: [Request] VIP Privilages
Reply With Quote #21

Quote:
Originally Posted by OciXCrom View Post
Please read carefully so we can avoid discussing the same thing multiple times.

ARUKARI's code won't work for you because it requires AMXX 1.9+. Use my code from the previous page and show the warning you're getting after your modifications.

Show me the output of "amx_cvar sv_maxspeed" and "amx_cvar speed_VIP".

I Got this [1 warrning] Becasue i change code {} /// Because when i added gravity code it's didn't added for vips only , it added for all players so i edit {} , For make it for vips only and it's worked But I dont know why i got 1 warrning

From:

PHP Code:
public Privilage(id)
{
    if(
get_user_flags(id) & VIP-ACC && cs_get_user_team(id) == CS_TEAM_CT
    {
        
ColorChat(idGREEN"^1[ ^4GameOver ^1] ^3You got^1 150HP ^3-^1 150Armor ^3-^1 Gravity ^3-^1 Speed ^3-^1 Full nade Pack"
    }
    
set_user_health(idget_pcvar_num(VIPhealth))
    
set_user_gravity(idget_user_gravity(id) - 0.5)
    
set_user_armor(idget_pcvar_num(VIParmor))
    
give_item(id"weapon_hegrenade")
    
give_item(id"weapon_flashbang")
    
give_item(id"weapon_flashbang")
    
give_item(id"weapon_smokegrenade")
   

To
PHP Code
:
public 
Privilage(id)
{
    if(
get_user_flags(id) & VIP-ACC && cs_get_user_team(id) == CS_TEAM_CT
    {
        
ColorChat(idGREEN"^1[ ^4GameOver ^1] ^3You got^1 150HP ^3-^1 150Armor ^3-^1 Gravity ^3-^1 Speed ^3-^1 Full nade Pack"
    
    
set_user_health(idget_pcvar_num(VIPhealth))
    
set_user_gravity(idget_user_gravity(id) - 0.5)
    
set_user_armor(idget_pcvar_num(VIParmor))
    
give_item(id"weapon_hegrenade")
    
give_item(id"weapon_flashbang")
    
give_item(id"weapon_flashbang")
    
give_item(id"weapon_smokegrenade")
   }

Your codes is fine but the speed cant be higher than 320
https://i.ibb.co/QcN5rHL/4.png

https://i.ibb.co/sQzsFjD/2.png

[Your plugin after i added gravity and armor]
PHP Code:
#include <amxmodx>
#include <colorchat>
#include <cstrike>
#include <fun>
#include <hamsandwich>

#define VIP-ACC ADMIN_LEVEL_H

new VIPhealthVIParmorVIPspeed

public plugin_init() 
{
    
register_plugin"VIP Privilage""1.0""MrAbdoO")
    
register_event("CurWeapon""OnWeaponChange""be""1=1")
    
RegisterHam(Ham_Spawn"player""Privilage"1)

    
VIPhealth register_cvar("health_VIP""150")
    
VIParmor register_cvar("armor_VIP""150")
    
VIPspeed register_cvar("speed_VIP""400")
}

public 
OnWeaponChange(id)
{
    if(
get_user_flags(id) & VIP-ACC)
    {
        
set_user_maxspeed(idget_pcvar_float(VIPspeed))
    }
}

public 
Privilage(id)
{
    if(
get_user_flags(id) & VIP-ACC && cs_get_user_team(id) == CS_TEAM_CT
    {
        
ColorChat(idGREEN"^1[ ^4GameOver ^1] ^3You got^1 150HP ^3-^1 150Armor ^3-^1 Gravity ^3-^1 Speed ^3-^1 Full nade Pack"
   
    
set_user_health(idget_pcvar_num(VIPhealth))
    
set_user_gravity(idget_user_gravity(id) - 0.5)
    
set_user_armor(idget_pcvar_num(VIParmor))
    
give_item(id"weapon_hegrenade")
    
give_item(id"weapon_flashbang")
    
give_item(id"weapon_flashbang")
    
give_item(id"weapon_smokegrenade")
   }


Last edited by Supremache; 04-06-2020 at 15:56.
Supremache is offline
+ARUKARI-
AlliedModders Donor
Join Date: Jul 2004
Location: Japan
Old 04-06-2020 , 20:25   Re: [Request] VIP Privilages
Reply With Quote #22

According to this post, 1.82 may be able to run my code too.
https://forums.alliedmods.net/showth...=ResetMaxSpeed

Adding the define
PHP Code:
#if !defined Ham_CS_Player_ResetMaxSpeed 
const Ham:Ham_CS_Player_ResetMaxSpeed Ham_Item_PreFrame;
#endif 
Can Compiled.
PHP Code:
#include <amxmodx>
#include <colorchat>
#include <cstrike>
#include <fun>
#include <hamsandwich>

#define VIP-ACC ADMIN_LEVEL_H

new VIPhealthVIParmorVIPspeed;

#if !defined Ham_CS_Player_ResetMaxSpeed
    
const Ham:Ham_CS_Player_ResetMaxSpeed Ham_Item_PreFrame;
#endif 

public plugin_init() 
{
    
register_plugin"VIP Privilage""1.0""MrAbdoO");
    
register_event("CurWeapon""OnWeaponChange""be""1=1");

    
RegisterHam(Ham_Spawn"player""Privilage"1);
    
RegisterHam(Ham_CS_Player_ResetMaxSpeed"player""KeepMaxSpeed"1); 

    
VIPhealth    register_cvar("health_VIP""150");
    
VIParmor    register_cvar("armor_VIP",  "150");
    
VIPspeed    register_cvar("speed_VIP",  "400");
}

public 
OnWeaponChange(id)
{
    if(
get_user_flags(id) & VIP-ACC)
    {
        
set_user_maxspeed(idget_pcvar_float(VIPspeed));
    }
}

public 
Privilage(id)
{
    if(
get_user_flags(id) & VIP-ACC && cs_get_user_team(id) == CS_TEAM_CT
    {
        
ColorChat(idGREEN"^1[ ^4GameOver ^1] ^3You got^1 150HP ^3-^1 150Armor ^3-^1 Gravity ^3-^1 Speed ^3-^1 Full nade Pack");
        
        
set_user_health(idget_pcvar_num(VIPhealth));
        
set_user_gravity(idget_user_gravity(id) - 0.5);
        
        
cs_set_user_armor(idget_pcvar_num(VIParmor), CS_ARMOR_VESTHELM); 

        
give_item(id"weapon_hegrenade");
        
give_item(id"weapon_flashbang");
        
give_item(id"weapon_flashbang");
        
give_item(id"weapon_smokegrenade");
   }


public 
KeepMaxSpeed(id)
{
    if(
get_user_flags(id) & VIP-ACC)
    {
        if (
get_user_maxspeed(id) < get_pcvar_float(VIPspeed))
            
set_user_maxspeed(idget_pcvar_float(VIPspeed));
    }
    
    return 
HAM_IGNORED;

__________________
GitHub
SteamWishlist

六四天安門事件

Last edited by +ARUKARI-; 04-06-2020 at 20:57.
+ARUKARI- is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 04-06-2020 , 21:22   Re: [Request] VIP Privilages
Reply With Quote #23

Quote:
Originally Posted by +ARUKARI- View Post
According to this post, 1.82 may be able to run my code too.
https://forums.alliedmods.net/showth...=ResetMaxSpeed

Adding the define
PHP Code:
#if !defined Ham_CS_Player_ResetMaxSpeed 
const Ham:Ham_CS_Player_ResetMaxSpeed Ham_Item_PreFrame;
#endif 
Can Compiled.
PHP Code:
#include <amxmodx>
#include <colorchat>
#include <cstrike>
#include <fun>
#include <hamsandwich>

#define VIP-ACC ADMIN_LEVEL_H

new VIPhealthVIParmorVIPspeed;

#if !defined Ham_CS_Player_ResetMaxSpeed
    
const Ham:Ham_CS_Player_ResetMaxSpeed Ham_Item_PreFrame;
#endif 

public plugin_init() 
{
    
register_plugin"VIP Privilage""1.0""MrAbdoO");
    
register_event("CurWeapon""OnWeaponChange""be""1=1");

    
RegisterHam(Ham_Spawn"player""Privilage"1);
    
RegisterHam(Ham_CS_Player_ResetMaxSpeed"player""KeepMaxSpeed"1); 

    
VIPhealth    register_cvar("health_VIP""150");
    
VIParmor    register_cvar("armor_VIP",  "150");
    
VIPspeed    register_cvar("speed_VIP",  "400");
}

public 
OnWeaponChange(id)
{
    if(
get_user_flags(id) & VIP-ACC)
    {
        
set_user_maxspeed(idget_pcvar_float(VIPspeed));
    }
}

public 
Privilage(id)
{
    if(
get_user_flags(id) & VIP-ACC && cs_get_user_team(id) == CS_TEAM_CT
    {
        
ColorChat(idGREEN"^1[ ^4GameOver ^1] ^3You got^1 150HP ^3-^1 150Armor ^3-^1 Gravity ^3-^1 Speed ^3-^1 Full nade Pack");
        
        
set_user_health(idget_pcvar_num(VIPhealth));
        
set_user_gravity(idget_user_gravity(id) - 0.5);
        
        
cs_set_user_armor(idget_pcvar_num(VIParmor), CS_ARMOR_VESTHELM); 

        
give_item(id"weapon_hegrenade");
        
give_item(id"weapon_flashbang");
        
give_item(id"weapon_flashbang");
        
give_item(id"weapon_smokegrenade");
   }


public 
KeepMaxSpeed(id)
{
    if(
get_user_flags(id) & VIP-ACC)
    {
        if (
get_user_maxspeed(id) < get_pcvar_float(VIPspeed))
            
set_user_maxspeed(idget_pcvar_float(VIPspeed));
    }
    
    return 
HAM_IGNORED;

Thanks You Bro So Much And You OciXCrom
Solved!!

Last edited by Supremache; 04-06-2020 at 21:26.
Supremache 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 21:37.


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