Witam, chcialbym dodac prefix[VIP] i vip chat pod u*, ale cos mi nie dziala:
Spoiler
#include <amxmodx>
#include <fakemeta_util>
#include <fakemeta>
#include <fun>
#include <codmod>
#include <hamsandwich>
#include <cstrike>
#define fm_get_user_money(%1) get_pdata_int(%1, MONEY_F)
#define THE_VIP ADMIN_LEVEL_H
#define SCOREATTRIB_VIP (1 << 2)
#define SCOREATTRIB_DEAD (1 << 0)
#define MONEY_F 115
new cod_vexp, cod_vmoney, cod_vkillhp, cod_vgranaty, cod_vhsxp, cod_vhshp, cod_vhsmoney, cod_vinfo;
new cod_vwyt, cod_vint, cod_vkon, cod_vhp;
new g_MsgScoreAttrib = 0;
new nick_gracza[32]
/* STOKI */
stock fm_set_user_money(index, money, flash = 1)
{
set_pdata_int(index, MONEY_F, money)
message_begin(MSG_ONE, get_user_msgid("Money"), _, index);
write_long(money);
write_byte(flash ? 1 : 0);
message_end();
}
/* END OF STOKI */
public plugin_init()
{
register_plugin("VIP", "0.99Ev", "NERO31");
g_MsgScoreAttrib = get_user_msgid("ScoreAttrib");
register_message(g_MsgScoreAttrib, "messageScoreAttrib");
RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawnPost", 1);
register_message(get_user_msgid("SayText"),"handleSayText");
/*================CVARY======================*/
//Dodatkowa ilosc doswiadczenia za zabicie innego gracza:
cod_vexp = register_cvar("cod_vexp","50");
//Dodatkowa ilosc pieniedzy za zabicie innego gracza:
cod_vmoney = register_cvar("cod_vmoney","200");
//Dodatkowa ilosc zycia za zabicie innego gracza:
cod_vkillhp = register_cvar("cod_vkillhp","30");
//Dodatkowa kondycja gracza:
cod_vkon = register_cvar("cod_vkon","0");
//Dodatkowa inteligecja gracza:
cod_vint = register_cvar("cod_vint","0");
//Dodatkowa wytrzymalosc gracza:
cod_vwyt = register_cvar("cod_vwyt","0");
//Dodatkowe zycie gracza:
cod_vhp = register_cvar("cod_vhp","0");
//VIP ma dostawac wszystkie granaty po 2 sztuki (2he, 2flash, 2smoke) 0nie 1tak
cod_vgranaty = register_cvar("cod_vgranaty","1");
//Dodatkowa ilosc doswiadczenia za zabicie innego gracza headshootem:
cod_vhsxp = register_cvar("cod_vhsxp","65");
//Dodatkowa ilosc zycia za zabicie innego gracza headshootem:
cod_vhshp = register_cvar("cod_vhshp","50");
//Dodatkowa ilosc kasy za zabicie innego gracza headshootem:
cod_vhsmoney = register_cvar("cod_vhsmoney","350");
//Informacja (Na serwer wszedl VIP (nick) ) przy wejsciu gracza, 0nie 1tak
cod_vinfo = register_cvar("cod_vinfo","1");
/*==============KONIEC CVARÓW===============*/
}
public fwHamPlayerSpawnPost(id){
if (is_user_connected(id) && is_user_alive(id) && get_user_flags(id) & THE_VIP)
{
new granaty = get_pcvar_num(cod_vgranaty)
if (granaty == 1)
{
cod_give_weapon(id, CSW_HEGRENADE);
cod_give_weapon(id, CSW_FLASHBANG);
cod_give_weapon(id, CSW_FLASHBANG);
cod_give_weapon(id, CSW_SMOKEGRENADE);
cs_set_user_bpammo(id, CSW_SMOKEGRENADE, 2);
cs_set_user_bpammo(id, CSW_HEGRENADE, 2);
}
new hp = get_pcvar_num(cod_vhp);
new bonus = cod_get_user_health(id, 0, 0, 1);
if(is_user_alive(id) && bonus < hp)
{
cod_set_user_bonus_health(id, cod_get_user_health(id)+ get_pcvar_num(cod_vhp));
cod_set_user_bonus_trim(id, cod_get_user_trim(id) + get_pcvar_num(cod_vkon));
cod_set_user_bonus_intelligence(id, cod_get_user_intelligence(id) + get_pcvar_num(cod_vint));
cod_set_user_bonus_stamina(id, cod_get_user_stamina(id) + get_pcvar_num(cod_vwyt));
}
}
}
public client_death(killer, victim, wpnindex, hitplace, TK)
{
if (is_user_alive(killer) && (get_user_flags(killer) & THE_VIP))
{
if(hitplace == HIT_HEAD)
{
new hs_xp = get_pcvar_num(cod_vhsxp)
new hs_hp = get_pcvar_num(cod_vhshp)
new hs_money = get_pcvar_num(cod_vhsmoney)
cod_set_user_xp(killer, cod_get_user_xp(killer) + hs_xp);
fm_set_user_money(killer, fm_get_user_money(killer) + hs_money, 1)
set_user_health(killer, get_user_health(killer) + hs_hp);
new sync = CreateHudSyncObj();
set_hudmessage(255, 212, 0, 0.53, 0.33, 1, 6.0, 4.0);
ShowSyncHudMsg(killer, sync, "VIP: ZA HS DOSTALES +%i XP", hs_xp);
}
else
{
cod_set_user_xp(killer, cod_get_user_xp(killer) + get_pcvar_num(cod_vexp));
fm_set_user_money(killer, fm_get_user_money(killer) + get_pcvar_num(cod_vmoney), 1);
set_user_health(killer, get_user_health(killer) + get_pcvar_num(cod_vkillhp));
new add_exp = get_pcvar_num(cod_vexp);
new sync = CreateHudSyncObj();
set_hudmessage(255, 212, 0, 0.50, 0.33, 1, 6.0, 4.0);
ShowSyncHudMsg(killer, sync, "VIP: ZA KILL DOSTALES +%i XP", add_exp);
}
}
}
public client_disconnect(id)
{
new info_vip_con = get_pcvar_num(cod_vinfo)
if(info_vip_con == 1)
{
if (get_user_flags(id) & THE_VIP)
{
get_user_name(id, nick_gracza, 32);
set_hudmessage(255, 0, 0, 0.04, 0.28, 0, 6.0, 12.0)
show_hudmessage(0, "Serwer opuscil wlasnie nasz VIP (%s)", nick_gracza)
}}
}
public client_authorized(id)
{
new info_vip_con = get_pcvar_num(cod_vinfo)
if(info_vip_con == 1)
{
if (get_user_flags(id) & THE_VIP)
{
get_user_name(id, nick_gracza, 32);
set_hudmessage(255, 0, 0, 0.04, 0.28, 0, 6.0, 12.0)
show_hudmessage(0, "Na serwer wchodzi VIP! (%s)", nick_gracza);}}
}
public messageScoreAttrib(iMsgID, iDest, iReceiver)
{
new iPlayer = get_msg_arg_int(1);
if(is_user_connected(iPlayer) && (get_user_flags(iPlayer) & THE_VIP))
set_msg_arg_int(2, ARG_BYTE, is_user_alive(iPlayer) ? SCOREATTRIB_VIP : SCOREATTRIB_DEAD);
}
public g_Chat(id){
if(g_Vip[id]){
new g_Msg[256],
g_Text[256];
read_args(g_Msg,charsmax(g_Msg));
remove_quotes(g_Msg);
if(g_Msg[0] == '*' && g_Msg[1]){
replace(g_Msg,charsmax(g_Msg),"*","");
new g_Name[64];
get_user_name(id,g_Name,charsmax(g_Name));
formatex(g_Text,charsmax(g_Text),"^x01(%s) ^x03%s : ^x04%s",g_Prefix, g_Name, g_Msg);
for(new i=1;i<33;i++){
if(is_user_connected(i) && g_Vip[i])
ColorChat(i, GREEN, "%s", g_Text);
}
return PLUGIN_HANDLED_MAIN;
}
}
return PLUGIN_CONTINUE;
}
public handleSayText(msgId,msgDest,msgEnt){
new id = get_msg_arg_int(1);
if(!is_user_connected(id)) return PLUGIN_CONTINUE;
new szTmp[256],szTmp2[256];
get_msg_arg_string(2,szTmp, charsmax( szTmp ) )
new szPrefix[64] = "[VIP]";
if(!equal(szTmp,"#Cstrike_Chat_All")){
add(szTmp2,charsmax(szTmp2),szPrefix);
add(szTmp2,charsmax(szTmp2)," ");
add(szTmp2,charsmax(szTmp2),szTmp);
}
else{
add(szTmp2,charsmax(szTmp2),szPrefix);
add(szTmp2,charsmax(szTmp2),"^x03 %s1^x01 : %s2");
}
set_msg_arg_string(2,szTmp2);
return PLUGIN_CONTINUE;
}
#include <fakemeta_util>
#include <fakemeta>
#include <fun>
#include <codmod>
#include <hamsandwich>
#include <cstrike>
#define fm_get_user_money(%1) get_pdata_int(%1, MONEY_F)
#define THE_VIP ADMIN_LEVEL_H
#define SCOREATTRIB_VIP (1 << 2)
#define SCOREATTRIB_DEAD (1 << 0)
#define MONEY_F 115
new cod_vexp, cod_vmoney, cod_vkillhp, cod_vgranaty, cod_vhsxp, cod_vhshp, cod_vhsmoney, cod_vinfo;
new cod_vwyt, cod_vint, cod_vkon, cod_vhp;
new g_MsgScoreAttrib = 0;
new nick_gracza[32]
/* STOKI */
stock fm_set_user_money(index, money, flash = 1)
{
set_pdata_int(index, MONEY_F, money)
message_begin(MSG_ONE, get_user_msgid("Money"), _, index);
write_long(money);
write_byte(flash ? 1 : 0);
message_end();
}
/* END OF STOKI */
public plugin_init()
{
register_plugin("VIP", "0.99Ev", "NERO31");
g_MsgScoreAttrib = get_user_msgid("ScoreAttrib");
register_message(g_MsgScoreAttrib, "messageScoreAttrib");
RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawnPost", 1);
register_message(get_user_msgid("SayText"),"handleSayText");
/*================CVARY======================*/
//Dodatkowa ilosc doswiadczenia za zabicie innego gracza:
cod_vexp = register_cvar("cod_vexp","50");
//Dodatkowa ilosc pieniedzy za zabicie innego gracza:
cod_vmoney = register_cvar("cod_vmoney","200");
//Dodatkowa ilosc zycia za zabicie innego gracza:
cod_vkillhp = register_cvar("cod_vkillhp","30");
//Dodatkowa kondycja gracza:
cod_vkon = register_cvar("cod_vkon","0");
//Dodatkowa inteligecja gracza:
cod_vint = register_cvar("cod_vint","0");
//Dodatkowa wytrzymalosc gracza:
cod_vwyt = register_cvar("cod_vwyt","0");
//Dodatkowe zycie gracza:
cod_vhp = register_cvar("cod_vhp","0");
//VIP ma dostawac wszystkie granaty po 2 sztuki (2he, 2flash, 2smoke) 0nie 1tak
cod_vgranaty = register_cvar("cod_vgranaty","1");
//Dodatkowa ilosc doswiadczenia za zabicie innego gracza headshootem:
cod_vhsxp = register_cvar("cod_vhsxp","65");
//Dodatkowa ilosc zycia za zabicie innego gracza headshootem:
cod_vhshp = register_cvar("cod_vhshp","50");
//Dodatkowa ilosc kasy za zabicie innego gracza headshootem:
cod_vhsmoney = register_cvar("cod_vhsmoney","350");
//Informacja (Na serwer wszedl VIP (nick) ) przy wejsciu gracza, 0nie 1tak
cod_vinfo = register_cvar("cod_vinfo","1");
/*==============KONIEC CVARÓW===============*/
}
public fwHamPlayerSpawnPost(id){
if (is_user_connected(id) && is_user_alive(id) && get_user_flags(id) & THE_VIP)
{
new granaty = get_pcvar_num(cod_vgranaty)
if (granaty == 1)
{
cod_give_weapon(id, CSW_HEGRENADE);
cod_give_weapon(id, CSW_FLASHBANG);
cod_give_weapon(id, CSW_FLASHBANG);
cod_give_weapon(id, CSW_SMOKEGRENADE);
cs_set_user_bpammo(id, CSW_SMOKEGRENADE, 2);
cs_set_user_bpammo(id, CSW_HEGRENADE, 2);
}
new hp = get_pcvar_num(cod_vhp);
new bonus = cod_get_user_health(id, 0, 0, 1);
if(is_user_alive(id) && bonus < hp)
{
cod_set_user_bonus_health(id, cod_get_user_health(id)+ get_pcvar_num(cod_vhp));
cod_set_user_bonus_trim(id, cod_get_user_trim(id) + get_pcvar_num(cod_vkon));
cod_set_user_bonus_intelligence(id, cod_get_user_intelligence(id) + get_pcvar_num(cod_vint));
cod_set_user_bonus_stamina(id, cod_get_user_stamina(id) + get_pcvar_num(cod_vwyt));
}
}
}
public client_death(killer, victim, wpnindex, hitplace, TK)
{
if (is_user_alive(killer) && (get_user_flags(killer) & THE_VIP))
{
if(hitplace == HIT_HEAD)
{
new hs_xp = get_pcvar_num(cod_vhsxp)
new hs_hp = get_pcvar_num(cod_vhshp)
new hs_money = get_pcvar_num(cod_vhsmoney)
cod_set_user_xp(killer, cod_get_user_xp(killer) + hs_xp);
fm_set_user_money(killer, fm_get_user_money(killer) + hs_money, 1)
set_user_health(killer, get_user_health(killer) + hs_hp);
new sync = CreateHudSyncObj();
set_hudmessage(255, 212, 0, 0.53, 0.33, 1, 6.0, 4.0);
ShowSyncHudMsg(killer, sync, "VIP: ZA HS DOSTALES +%i XP", hs_xp);
}
else
{
cod_set_user_xp(killer, cod_get_user_xp(killer) + get_pcvar_num(cod_vexp));
fm_set_user_money(killer, fm_get_user_money(killer) + get_pcvar_num(cod_vmoney), 1);
set_user_health(killer, get_user_health(killer) + get_pcvar_num(cod_vkillhp));
new add_exp = get_pcvar_num(cod_vexp);
new sync = CreateHudSyncObj();
set_hudmessage(255, 212, 0, 0.50, 0.33, 1, 6.0, 4.0);
ShowSyncHudMsg(killer, sync, "VIP: ZA KILL DOSTALES +%i XP", add_exp);
}
}
}
public client_disconnect(id)
{
new info_vip_con = get_pcvar_num(cod_vinfo)
if(info_vip_con == 1)
{
if (get_user_flags(id) & THE_VIP)
{
get_user_name(id, nick_gracza, 32);
set_hudmessage(255, 0, 0, 0.04, 0.28, 0, 6.0, 12.0)
show_hudmessage(0, "Serwer opuscil wlasnie nasz VIP (%s)", nick_gracza)
}}
}
public client_authorized(id)
{
new info_vip_con = get_pcvar_num(cod_vinfo)
if(info_vip_con == 1)
{
if (get_user_flags(id) & THE_VIP)
{
get_user_name(id, nick_gracza, 32);
set_hudmessage(255, 0, 0, 0.04, 0.28, 0, 6.0, 12.0)
show_hudmessage(0, "Na serwer wchodzi VIP! (%s)", nick_gracza);}}
}
public messageScoreAttrib(iMsgID, iDest, iReceiver)
{
new iPlayer = get_msg_arg_int(1);
if(is_user_connected(iPlayer) && (get_user_flags(iPlayer) & THE_VIP))
set_msg_arg_int(2, ARG_BYTE, is_user_alive(iPlayer) ? SCOREATTRIB_VIP : SCOREATTRIB_DEAD);
}
public g_Chat(id){
if(g_Vip[id]){
new g_Msg[256],
g_Text[256];
read_args(g_Msg,charsmax(g_Msg));
remove_quotes(g_Msg);
if(g_Msg[0] == '*' && g_Msg[1]){
replace(g_Msg,charsmax(g_Msg),"*","");
new g_Name[64];
get_user_name(id,g_Name,charsmax(g_Name));
formatex(g_Text,charsmax(g_Text),"^x01(%s) ^x03%s : ^x04%s",g_Prefix, g_Name, g_Msg);
for(new i=1;i<33;i++){
if(is_user_connected(i) && g_Vip[i])
ColorChat(i, GREEN, "%s", g_Text);
}
return PLUGIN_HANDLED_MAIN;
}
}
return PLUGIN_CONTINUE;
}
public handleSayText(msgId,msgDest,msgEnt){
new id = get_msg_arg_int(1);
if(!is_user_connected(id)) return PLUGIN_CONTINUE;
new szTmp[256],szTmp2[256];
get_msg_arg_string(2,szTmp, charsmax( szTmp ) )
new szPrefix[64] = "[VIP]";
if(!equal(szTmp,"#Cstrike_Chat_All")){
add(szTmp2,charsmax(szTmp2),szPrefix);
add(szTmp2,charsmax(szTmp2)," ");
add(szTmp2,charsmax(szTmp2),szTmp);
}
else{
add(szTmp2,charsmax(szTmp2),szPrefix);
add(szTmp2,charsmax(szTmp2),"^x03 %s1^x01 : %s2");
}
set_msg_arg_string(2,szTmp2);
return PLUGIN_CONTINUE;
}
Chcialbym takze
-informacje o vipie w motd ( komenda /vip ) na chacie: Chcesz dowiedziec sie co posiada vip ? Napisz na say'u /vip
-Pokazuj vipy online na komendę
proszę o pomoc.