Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include < amxmodx >
- #include < cstrike >
- #include < engine >
- #include < csx >
- #include < fakemeta >
- #include < hamsandwich >
- /* Copyright 2018 © Sorinel / steamcommunity.com/id/jandarmeria */
- /* Credits Hattrick for bullet damage */
- // new const vip_model_t[] = "vip_model_t"
- // new const vip_model_ct[] = "vip_model_ct"
- const WEAPON_BITSUM = ((1<<CSW_GLOCK18)) | ((1<<CSW_USP))
- #pragma tabsize 0
- #define fm_create_entity(%1) engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, %1))
- #define PLUGIN "area.games vip"
- #define VERSION "1.0"
- #define AUTHOR "Sorinel"
- //#define PREFIX "[NUMER SERVER]" // poti pune ce vrei intre paranteze
- #define VIP_FLAG ADMIN_LEVEL_H // flag vip, poti pune ce vrei
- #define KILL_HP 7 // cat hp primesti cand faci kill
- #define HS_HP 14 // cat hp primesti cand dai hs
- #define KILL_MONEY 150 // cati bani primesti cand faci kill
- #define KILL_MONEY_HS 250 // cati bani primesti cand dai hs
- #define FRAG_HP_LIMIT 100 // limita la hp ca sa nu ajunga pe la 300 sau mai mult hp pe runda :))
- new Round[33] = 0
- new g_iPosition[33]
- new g_iSize
- new cvar_jump
- new jumpnum[33]
- new bool: dojump[33]
- new const restricted_maps[ ][ ] =
- {
- "awp_",
- "aim_"
- }
- new const Float: g_flCoords[ ][ ] = {
- { 0.50, 0.40 },
- { 0.56, 0.44 },
- { 0.60, 0.50 },
- { 0.56, 0.56 },
- { 0.50, 0.60 },
- { 0.44, 0.56 },
- { 0.40, 0.50 },
- { 0.44, 0.44 }
- }
- enum {
- SCOREATTRIB_ARG_PLAYERID = 1,
- SCOREATTRIB_ARG_FLAGS
- }
- enum ( <<= 1 ) {
- SCOREATTRIB_FLAG_NONE = 0,
- SCOREATTRIB_FLAG_DEAD = 1,
- SCOREATTRIB_FLAG_BOMB,
- SCOREATTRIB_FLAG_VIP
- }
- public plugin_init() {
- register_plugin(PLUGIN, VERSION, AUTHOR)
- RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawnPost", 1)
- register_event("DeathMsg", "death_msg", "a", "1>0")
- register_message( get_user_msgid( "ScoreAttrib" ), "MessageScoreAttrib")
- g_iSize = sizeof( g_flCoords )
- cvar_jump = register_cvar("vip_jump", "1")
- }
- /*
- public plugin_precache() {
- new ModelOrSoundPath[128]
- formatex( ModelOrSoundPath, sizeof ( ModelOrSoundPath ) -1, "models/player/%s/%s.mdl", vip_model_t, vip_model_t)
- engfunc( EngFunc_PrecacheModel, ModelOrSoundPath)
- formatex( ModelOrSoundPath, sizeof ( ModelOrSoundPath ) -1, "models/player/%s/%s.mdl", vip_model_ct, vip_model_ct)
- engfunc( EngFunc_PrecacheModel, ModelOrSoundPath)
- } */
- public client_putinserver(id)
- {
- if(get_user_flags(id) & VIP_FLAG )
- {
- static name[32]
- get_user_name(id, name, charsmax(name))
- print_color(0, "!eVIP-ul !g%s !es-a conectat", name)
- }
- new map_name[32], i
- get_mapname(map_name, charsmax(map_name))
- for(i = 0; i < sizeof(restricted_maps); i++)
- {
- if(equali(map_name, restricted_maps[i]))
- {
- remove_user_flags(id, VIP_FLAG)
- }
- }
- }
- public MessageScoreAttrib(iMsgId, iDest, iReceiver) {
- new iPlayer = get_msg_arg_int(SCOREATTRIB_ARG_PLAYERID)
- if(get_user_flags(iPlayer) & VIP_FLAG)
- set_msg_arg_int(SCOREATTRIB_ARG_FLAGS, ARG_BYTE, SCOREATTRIB_FLAG_VIP)
- }
- public client_damage( iAttacker, iVictim, iDamage ) {
- if(is_user_alive(iAttacker) && get_user_flags(iAttacker) & VIP_FLAG ) {
- if( ++g_iPosition[ iAttacker ] == g_iSize )
- g_iPosition[ iAttacker ] = 0;
- set_hudmessage(random_num(0, 255), random_num(0, 255), random_num(0, 255), Float: g_flCoords[ g_iPosition[ iAttacker ] ][ 0 ], Float: g_flCoords[ g_iPosition[ iAttacker ] ][ 1 ], 0, 0.1, 2.5, 0.02, 0.02, -1 )
- show_hudmessage( iAttacker, "%i", iDamage )
- }
- }
- bonus_health(id, health)
- {
- if( is_user_bot(id) )
- return PLUGIN_HANDLED
- static limit
- limit = FRAG_HP_LIMIT
- if( is_user_alive( id ) && get_user_flags( id ) & VIP_FLAG )
- {
- limit = FRAG_HP_LIMIT
- }
- fm_set_user_health(id, clamp((get_user_health(id) + health), 1, limit))
- return PLUGIN_HANDLED
- }
- public death_msg()
- {
- new killer = read_data(1)
- new victim = read_data(2)
- new headshot = read_data(3)
- if(killer == victim || !is_user_connected(victim) || !is_user_alive(killer))
- return PLUGIN_HANDLED
- if (headshot)
- {
- bonus_health(killer, HS_HP)
- if(is_user_alive(killer) && get_user_flags(killer) & VIP_FLAG)
- {
- cs_set_user_money(killer, cs_get_user_money(killer) + KILL_MONEY_HS)
- }
- }
- else
- {
- bonus_health(killer, KILL_HP)
- if(is_user_alive(killer) && get_user_flags(killer) & VIP_FLAG)
- {
- cs_set_user_money(killer, cs_get_user_money(killer) + KILL_MONEY)
- }
- }
- return PLUGIN_CONTINUE
- }
- public fwHamPlayerSpawnPost(id) {
- if(is_user_alive(id) && get_user_flags(id) & VIP_FLAG )
- {
- drop_primary(id)
- fm_give_item(id, "weapon_deagle")
- cs_set_user_bpammo(id, CSW_DEAGLE, 35)
- fm_give_item(id, "weapon_hegrenade")
- fm_give_item(id, "weapon_flashbang")
- cs_set_user_bpammo(id, CSW_FLASHBANG, 2)
- cs_set_user_armor(id, 100, CS_ARMOR_VESTHELM)
- /* switch(cs_get_user_team(id))
- {
- case CS_TEAM_T: cs_set_user_model(id, vip_model_t)
- case CS_TEAM_CT: cs_set_user_model(id, vip_model_ct)
- } */
- if(Round[id] > 3) {
- vip_menu(id)
- }
- else {
- Round[id]++
- }
- }
- }
- public client_PreThink(id)
- {
- if(is_user_alive(id)) {
- new BUTON = get_user_button(id)
- new OLDBUTON = get_user_oldbutton(id)
- new JUMP_VIP = get_pcvar_num(cvar_jump)
- if((BUTON & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(OLDBUTON & IN_JUMP))
- {
- if(((get_user_flags(id) & VIP_FLAG) && (jumpnum[id] < JUMP_VIP)))
- {
- dojump[id] = true
- jumpnum[id]++
- }
- }
- if((BUTON & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
- {
- jumpnum[id] = 0
- }
- }
- }
- public client_PostThink(id)
- {
- if(is_user_alive(id)) {
- if(dojump[id] == true)
- {
- new Float: velocity[3]
- entity_get_vector(id, EV_VEC_velocity, velocity)
- velocity[2] = random_float(265.0, 285.0)
- entity_set_vector(id, EV_VEC_velocity, velocity)
- dojump[id] = false
- }
- }
- }
- public vip_menu( id ) {
- new menu = menu_create( "\rVIP MENU", "menu_handler" )
- menu_additem( menu, "\yM4A1", "", 1, VIP_FLAG)
- menu_additem( menu, "\yAK47", "", 1, VIP_FLAG)
- menu_setprop( menu, MPROP_EXIT, MEXIT_ALL)
- menu_display( id, menu, 0 )
- }
- public menu_handler( id, menu, item )
- {
- switch( item )
- {
- case 0:
- {
- fm_give_item(id, "weapon_m4a1")
- cs_set_user_bpammo(id, CSW_M4A1, 90)
- }
- case 1:
- {
- fm_give_item(id, "weapon_ak47")
- cs_set_user_bpammo(id, CSW_AK47, 90)
- }
- }
- menu_destroy( menu )
- return PLUGIN_HANDLED
- }
- drop_primary(id)
- {
- static weapons[32], num
- get_user_weapons(id, weapons, num)
- for (new i = 0; i < num; i++)
- {
- if (WEAPON_BITSUM & (1<<weapons[i]))
- {
- static wname[32];
- get_weaponname(weapons[i], wname, sizeof wname - 1)
- engclient_cmd(id, "drop", wname)
- }
- }
- }
- /* Stock-uri */
- stock fm_set_user_health(index, health) {
- health > 0 ? set_pev(index, pev_health, float(health)) : dllfunc(DLLFunc_ClientKill, index)
- return 1
- }
- stock fm_give_item(index, const item[]) {
- if (!equal(item, "weapon_", 7) && !equal(item, "ammo_", 5) && !equal(item, "item_", 5) && !equal(item, "tf_weapon_", 10))
- return 0
- new ent = fm_create_entity(item)
- if (!pev_valid(ent))
- return 0
- new Float:origin[3]
- pev(index, pev_origin, origin)
- set_pev(ent, pev_origin, origin)
- set_pev(ent, pev_spawnflags, pev(ent, pev_spawnflags) | SF_NORESPAWN)
- dllfunc(DLLFunc_Spawn, ent)
- new save = pev(ent, pev_solid)
- dllfunc(DLLFunc_Touch, ent, index)
- if (pev(ent, pev_solid) != save)
- return ent
- engfunc(EngFunc_RemoveEntity, ent)
- return -1
- }
- stock print_color( const id, const input[ ], any:... )
- {
- new count = 1, players[ 32 ]
- static msg[ 191 ]
- vformat( msg, 190, input, 3 )
- replace_all( msg, 190, "!v", "^4" ) //- verde
- replace_all( msg, 190, "!g", "^1" ) //- galben
- replace_all( msg, 190, "!e", "^3" ) //- echipa
- replace_all( msg, 190, "!n", "^0" ) //- normal
- if( id ) players[ 0 ] = id; else get_players( players, count, "ch" )
- {
- for( new i = 0; i < count; i++ )
- {
- if( is_user_connected( players[ i ] ) )
- {
- message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "SayText" ), _, players[ i ] )
- write_byte( players[ i ] );
- write_string( msg );
- message_end( );
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement