Sprawdz. Robione na szybko.
#include <amxmodx>
#include <hamsandwich>
#include <fun>
#include <fakemeta>
#include <cstrike>
native cs_set_player_model(id, model[]); // potrzebne od ustawienia modeli skina
native get_user_exp(id);
native set_user_exp(id, ilosc);
// TU KONFIGURUJESZ PLUGIN //
#define VIP ADMIN_LEVEL_G // FLAGA VIPA
#define SVIP ADMIN_LEVEL_H // FLAGA SVIPA
#define dodajexp set_user_exp //od ustawiania expa
#define pobierzexp get_user_exp //od pobieranie expa
//////////////////////////////////////////////////////////
forward amxbans_admin_connect(id);
new bool:g_Vip[33], g_SVIP[33];
new tIleExpaVIP, tIleExpaSVIP;
new HamHook:tKill;
public plugin_init(){
register_plugin("VIP Ultimate", "12.3.0.2", "benio101 & speedkill");
RegisterHam(Ham_Spawn, "player", "SpawnedEventPre", 1);
register_message(get_user_msgid("SayText"),"handleSayText");
tIleExpaVIP = register_cvar("vip_exp", "3");
tIleExpaSVIP = register_cvar("svip_exp", "6");
RegisterHam(Ham_Item_Deploy, "weapon_knife", "knife", 1);
RegisterHam(Ham_Spawn, "player", "Odrodzenie", 1);
}
public plugin_precache() {
precache_model("models/player/skin/skin.mdl") // SCIEZKA SKINA
precache_model("models/player/kosa/kosa.mdl") // KOSY
}
public client_authorized(id){
if(get_vip(id) == 1 || get_vip(id) == 2){
client_authorized_vip(id);
}
}
public client_authorized_vip(id){
new Vip = get_vip(id);
switch(Vip) {
case 1: g_Vip[id]=true;
case 2: g_SVIP[id]=true;
}
if(!tKill)
tKill = RegisterHam(Ham_Killed, "player", "exp", 1);
else
EnableHamForward(tKill);
}
public knife(ent)
{
new id = get_pdata_cbase(ent, 41, 4);
if(!is_user_alive(id))
return;
if(cs_get_user_shield(id))
return;
if(g_SVIP[id])
{
set_pev(id, pev_viewmodel2, "models/player/kosa/kosa.mdl");
}
}
public Odrodzenie(id) {
if(!is_user_alive(id)) {
return HAM_IGNORED;
}
if(!g_SVIP[id]) {
return HAM_IGNORED;
}
cs_set_player_model(id, "skin");
return HAM_IGNORED;
}
public exp(id, enemy)
{
if(!is_user_connected(id) || !g_Vip[id] || !g_SVIP[id])
return;
if(is_user_connected(enemy) && id != enemy) {
if(g_Vip[enemy]) {
dodajexp(enemy, pobierzexp(enemy)+get_pcvar_num(tIleExpaVIP));
}
if(g_SVIP[enemy]) {
dodajexp(enemy, pobierzexp(enemy)+get_pcvar_num(tIleExpaSVIP));
}
}
}
public client_disconnect(id){
if(g_Vip[id] || g_SVIP[id]){
client_disconnect_vip(id);
}
}
public client_disconnect_vip(id){
g_Vip[id]=false;
g_SVIP[id]=false;
}
public SpawnedEventPre(id){
if(g_Vip[id] || g_SVIP[id]){
if(is_user_alive(id)){
SpawnedEventPreVip(id);
}
}
}
public SpawnedEventPreVip(id){
set_user_health(id, g_Vip[id] ? get_user_health(id)+50 : g_SVIP[id] ? get_user_health(id)+100 : 100);
}
public handleSayText(msgId,msgDest,msgEnt){
new id = get_msg_arg_int(1);
if(!is_user_connected(id)) return PLUGIN_CONTINUE;
new szTmp[192], szTmp2[192];
get_msg_arg_string(2, szTmp, charsmax(szTmp));
new Vip = get_vip(id), szPrefix[64];
switch(Vip)
{
case 1: formatex(szPrefix, 63, "^x04[VIP]")
case 2: formatex(szPrefix, 63, "^x04[SVIP]")
default: return PLUGIN_CONTINUE;
}
if(!equal(szTmp,"#Cstrike_Chat_All")){
add(szTmp2, charsmax(szTmp2), "^x01");
add(szTmp2, charsmax(szTmp2), szPrefix);
add(szTmp2, charsmax(szTmp2), " ");
add(szTmp2, charsmax(szTmp2), szTmp);
}
else{
new szPlayerName[64];
get_user_name(id, szPlayerName, charsmax(szPlayerName));
get_msg_arg_string(4, szTmp, charsmax(szTmp)); //4. argument zawiera treść wysłanej wiadomości
set_msg_arg_string(4, ""); //Musimy go wyzerować, gdyż gra wykorzysta wiadomość podwójnie co może skutkować crash'em 191+ znaków.
add(szTmp2, charsmax(szTmp2), "^x01");
add(szTmp2, charsmax(szTmp2), szPrefix);
add(szTmp2, charsmax(szTmp2), "^x03 ");
add(szTmp2, charsmax(szTmp2), szPlayerName);
add(szTmp2, charsmax(szTmp2), "^x01 : ");
add(szTmp2, charsmax(szTmp2), szTmp)
}
set_msg_arg_string(2, szTmp2);
return PLUGIN_CONTINUE;
}
stock get_vip(id)
{
if(get_user_flags(id) & VIP && !(get_user_flags(id) & SVIP))
return 1;
else if(get_user_flags(id) & SVIP)
return 2;
return 0;
}
public amxbans_admin_connect(id){
client_authorized(id);
}