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

Help if Vip Flag


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
shoki123
Senior Member
Join Date: Apr 2011
Old 08-24-2011 , 05:48   Help if Vip Flag
Reply With Quote #1

Hi I have Vip Plugins and i dont wont cvar to add vip i wont flag to add vip in user.ini

the flag is be - a
ty,

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <colorchat>
#include <nvault>
#include <fakemeta_util>
#include <hamsandwich>
 
#define VIPTAG   "* Vip *"
#define DEADVIPTAG  "* Dead Vip *"
new Vip[33], g_max_clientsVipVault;
new 
VipCvarVipList;
public 
plugin_init() {
 
register_plugin("Jailbreak VIP""1.0""lolz123")
 
 
VipCvar register_cvar"jb_vip""1" )
 
VipList register_cvar"jb_vip_list""1" )
 
 
register_clcmd("jb_set_user_vip""SetVip")
 
register_clcmd("jb_remove_user_vip""RemoveVip")
 
 
register_clcmd("say /vip""print_viplist")
 
register_clcmd("say !vip""print_viplist")
 
 
register_clcmd("say""HandleSay")
 
 
RegisterHam(Ham_Spawn"player""HamPlayerSpawn"1
 
 
g_max_clients get_maxplayers();
}
public 
plugin_cfg()
{
 
VipVault nvault_open"Vip" );
 
 if ( 
VipVault == INVALID_HANDLE )
  
set_fail_state"Error opening Vip Vault" );
}
 
public 
plugin_precache() 
{
 
precache_model("models/player/vip/vip.mdl")
 return 
PLUGIN_CONTINUE
}
 
public 
plugin_end()
{
 
nvault_close(VipVault);
}
public 
plugin_natives()
{
 
register_library("Vip");
 
register_native("is_user_vip""_user_vip");
}
public 
_user_vip(pluginparams)
{
 return 
IsVip(get_param(1));

public 
client_putinserver(id)
{
 
LoadVip(id);
}
public 
HamPlayerSpawn(id)
{
 if(!
get_pcvar_num(VipCvar))
  return 
PLUGIN_HANDLED;
 
 if(
cs_get_user_team(id) == CS_TEAM_T && IsVip(id))
 {
  
cs_set_user_armor(id100CS_ARMOR_VESTHELM);
  
fm_set_user_health(id120)
 }
 return 
PLUGIN_HANDLED;
}
public 
SetVip(id)
{
 if(!
get_pcvar_num(VipCvar))
  return 
PLUGIN_HANDLED;
 
 if(!(
get_user_flags(id) & ADMIN_CVAR))
 {
  
client_print(idprint_console"You don't have access to this command.");
  return 
PLUGIN_HANDLED;
 }
 
 new 
arg[32], name[32];
 
read_argv (1arg31);
 
 new 
player cmd_target(id,arg,3);
 
 
get_user_name(playername31);
 
 if(!
player)
 {
  
client_print(idprint_console"There is no player Called like that.");
  return 
PLUGIN_HANDLED;
 }
 if(
IsVip(player))
 {
  
client_print(idprint_console"%s is Already a Vip player."name);
  return 
PLUGIN_HANDLED;
 }
 
set_player_vip(player)
 
 return 
PLUGIN_HANDLED;
}
public 
RemoveVip(id)
{
 if(!
get_pcvar_num(VipCvar))
  return 
PLUGIN_HANDLED;
 
 if(!(
get_user_flags(id) & ADMIN_CVAR))
 {
  
client_print(idprint_console"You don't have access to this command.");
  return 
PLUGIN_HANDLED;
 }
 
 new 
arg[32], name[32];
 
read_argv (1arg31);
 
 new 
player cmd_target(id,arg,3);
 
 
get_user_name(playername31);
 
 if(!
player)
 {
  
client_print(idprint_console"There is no player Called like that.");
  return 
PLUGIN_HANDLED;
 }
 if(!
IsVip(player))
 {
  
client_print(idprint_console"%s is Already a Non-Vip player."name);
  return 
PLUGIN_HANDLED;
 }
 
remove_player_vip(player)
 
 return 
PLUGIN_HANDLED;
}
set_player_vip(player)
{
 if(
is_user_connected(player) && Vip[player] == 0)
 {
  
Vip[player] = 1;
 
  new 
name[32];
  
get_user_name(playername31);
 
  
client_print(playerprint_center"You promoted to a VIP player !");
  
client_print(0print_chat"%s promoted to a VIP player !"name);
  
SaveVip(player);
 }
}
remove_player_vip(player)
{
 if(
is_user_connected(player) && Vip[player] == 1)
 {
  
Vip[player] = 0;
 
  new 
name[32];
  
get_user_name(playername31);
 
  
client_print(playerprint_center"You are no longer a VIP player.");
  
client_print(0print_chat"%s is no longer a VIP player."name);
 
  
SaveVip(player);
 }
}
public 
SaveVip(id)
{
 new 
authid[32]; 
 
get_user_authid(id,authid,31); 
 new 
vaultkey[64], vaultdata[64]; 
 
 
format(vaultkey,63,"Vip-%s",authid)
 
format(vaultdata,63,"%d"Vip[id]); 
 
 
nvault_setVipVault vaultkey vaultdata );

public 
LoadVip(id)
{
 new 
authid[32], vaultkey[64];
 
get_user_authid(id,authid,31); 
 
 
formatexvaultkey charsmaxvaultkey ) , "Vip-%s" authid);
 
Vip[id] = nvault_getVipVaultvaultkey );
}  
public 
HandleSay(id)
{
 if(!
get_pcvar_num(VipCvar))
  return 
PLUGIN_CONTINUE;
 
 new 
message[192], VipName[32], none[2][32], chat[192];
 
 
read_args (message191)
 
remove_quotes (message)
 
 
formatex(none[0], 31""), formatex(none[1], 31" ")
 
 if (
message[0] == '@' || message[0] == '!' || equal (message""))
  return 
PLUGIN_HANDLED;
 
 if(
IsVip(id) && !equali(messagenone[0]) && !equali(messagenone[1]) && cs_get_user_team(id) != CS_TEAM_SPECTATOR)
 {
  
get_user_name(idVipName31);
 
  if(
is_user_alive(id))
   
formatex(chat191"^4%s^3 %s^1 :  %s"VIPTAGVipNamemessage)
  else
   
formatex(chat191"^4%s^3 %s^1 :  %s"DEADVIPTAGVipNamemessage)
 
  switch(
cs_get_user_team(id))
  {
   case 
1ColorChat(0REDchat)
   case 
2ColorChat(0BLUEchat)
  }
  return 
PLUGIN_HANDLED;
 }
 return 
PLUGIN_CONTINUE;
}
public 
print_viplist(user
{
 if(!
get_pcvar_num(VipCvar) || !get_pcvar_num(VipList))
  return 
PLUGIN_HANDLED;
 
 new 
vipnames[33][32]
 new 
message[256]
 new 
idcountxlen
 
 
for(id id <= g_max_clients id++)
 {
  if(
is_user_connected(id))
  {
   if(
IsVip(id))
   {
    
get_user_name(idvipnames[count++], 31)
   }
  }
 }
 
len format(message255"^x04 Vip's Online:^x03 ")
 
 if(
count 0)
 {
  
len format(message255"^x04Vip's Online:")
  for(
count x++)
  {
   
len += format(message[len], 255-len"^x03 %s%s "vipnames[x], < (count-1) ? " ,":"")
  }
  
ColorChat(userBLUEmessage)
 }
 else
 {
  
len += format(message255"^x04 No vip's online.")
  
ColorChat(userBLUEmessage)
 }
 return 
PLUGIN_HANDLED;
}
bool:IsVip(player)
{
 if(
Vip[player] == 1)
 {
  return 
true;
 }
 return 
false;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ fbidis\\ ansi\\ ansicpg1252\\ deff0{\\ fonttbl{\\ f0\\ fnil\\ fcharset0 Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ ltrpar\\ lang1037\\ f0\\ fs16 \n\\ par }
*/ 
shoki123 is offline
plowed
Senior Member
Join Date: Oct 2010
Location: germany
Old 08-24-2011 , 06:30   Re: Help if Vip Flag
Reply With Quote #2

I dont understand 1 word and this is scripting help not request o.O
plowed 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:44.


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