Quote:
Originally Posted by OciXCrom
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(id, GREEN, "^1[ ^4GameOver ^1] ^3You got^1 150HP ^3-^1 150Armor ^3-^1 Gravity ^3-^1 Speed ^3-^1 Full nade Pack")
}
set_user_health(id, get_pcvar_num(VIPhealth))
set_user_gravity(id, get_user_gravity(id) - 0.5)
set_user_armor(id, get_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(id, GREEN, "^1[ ^4GameOver ^1] ^3You got^1 150HP ^3-^1 150Armor ^3-^1 Gravity ^3-^1 Speed ^3-^1 Full nade Pack")
set_user_health(id, get_pcvar_num(VIPhealth))
set_user_gravity(id, get_user_gravity(id) - 0.5)
set_user_armor(id, get_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 VIPhealth, VIParmor, VIPspeed
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(id, get_pcvar_float(VIPspeed))
}
}
public Privilage(id)
{
if(get_user_flags(id) & VIP-ACC && cs_get_user_team(id) == CS_TEAM_CT)
{
ColorChat(id, GREEN, "^1[ ^4GameOver ^1] ^3You got^1 150HP ^3-^1 150Armor ^3-^1 Gravity ^3-^1 Speed ^3-^1 Full nade Pack")
set_user_health(id, get_pcvar_num(VIPhealth))
set_user_gravity(id, get_user_gravity(id) - 0.5)
set_user_armor(id, get_pcvar_num(VIParmor))
give_item(id, "weapon_hegrenade")
give_item(id, "weapon_flashbang")
give_item(id, "weapon_flashbang")
give_item(id, "weapon_smokegrenade")
}
}