/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <fun>
#include <cstrike>
#include <colorchat>
#include <hamsandwich>
/*---------------EDIT ME------------------*/
#define ADMIN_CHECK ADMIN_LEVEL_H
static const COLOR[] = "^x04" //green
static const CONTACT[] = ""
/*----------------------------------------*/
new maxplayers
new gmsgSayText
#define PLUGIN "VIP"
#define VERSION "1.0"
#define AUTHOR "Nup"
#define vip(%1) is_user_alive(%1) && (get_user_flags(%1) & ADMIN_LEVEL_H)
new bool:uzyte[32], Float: speeds[32];
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
register_clcmd("say /grawitacja","grawitacja");
register_clcmd("say /speed","speed");
register_clcmd("say /info","info");
register_event("CurWeapon", "event_curweapon", "be", "1=1");
RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawnPost", 0);
maxplayers = get_maxplayers()
gmsgSayText = get_user_msgid("SayText")
register_clcmd("say", "handle_say")
register_cvar("amx_contactinfo", CONTACT, FCVAR_SERVER)
}
public plugin_precache()
{
precache_model("models/player/vip/vip.mdl")
}
public grawitacja(id)
{
if(vip(id))
{
set_user_gravity(id, 0.6);
ColorChat(id, RED, "[VIP]^x04 Twoja grawitacja zostala zmieniona!");
}
}
public speed(id)
{
if(vip(id) && !uzyte[id])
{
speeds[id] = get_user_maxspeed(id) * 1.8;
set_user_maxspeed(id, speeds[id]);
ColorChat(id, RED, "[VIP]^x04 Twoja predkosc zostala zwiekszona!");
uzyte[id] = true;
}
}
public event_curweapon(id)
{
if(is_user_alive(id) && uzyte[id])
set_user_maxspeed(id, speeds[id]);
return PLUGIN_CONTINUE;
}
public fwHamPlayerSpawnPost(id)
{
cs_reset_user_model(id)
if(vip(id))
{
cs_set_user_model(id, "vip")
uzyte[id] = false;
switch(cs_get_user_team(id))
{
case CS_TEAM_T : { give_item(id, "weapon_deagle"); }
case CS_TEAM_CT :
{
give_item(id, "weapon_smokegrenade");
give_item(id, "weapon_hegrenade");
}
}
}
}
public handle_say(id) {
new said[192]
read_args(said,192)
if( ( containi(said, "who") != -1 && containi(said, "admin") != -1 ) || contain(said, "/vips") != -1 )
set_task(0.1,"print_adminlist",id)
return PLUGIN_CONTINUE
}
public print_adminlist(user)
{
new adminnames[33][32]
new message[256]
new contactinfo[256], contact[112]
new id, count, x, len
for(id = 1 ; id <= maxplayers ; id++)
if(is_user_connected(id))
if(get_user_flags(id) & ADMIN_LEVEL_H)
get_user_name(id, adminnames[count++], 31)
len = format(message, 255, "%s VIP's: ",COLOR)
if(count > 0) {
for(x = 0 ; x < count ; x++) {
len += format(message[len], 255-len, "%s%s ", adminnames[x], x < (count-1) ? ", ":"")
if(len > 96 ) {
print_message(user, message)
len = format(message, 255, "%s ",COLOR)
}
}
print_message(user, message)
}
else {
len += format(message[len], 255-len, "Brak VIP'ow")
print_message(user, message)
}
get_cvar_string("amx_contactinfo", contact, 63)
if(contact[0]) {
format(contactinfo, 111, "%s Contact Server Admin -- %s", COLOR, contact)
print_message(user, contactinfo)
}
}
print_message(id, msg[]) {
message_begin(MSG_ONE, gmsgSayText, {0,0,0}, id)
write_byte(id)
write_string(msg)
message_end()
}
public info(id)
{
show_motd(id, "info.txt", "VIP INFO");
}
A spróbuj tak?