Raised This Month: $60 Target: $400
 15% 

Golden Deagle For VIP


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sPed
Junior Member
Join Date: May 2017
Location: Earth
Old 04-19-2018 , 19:16   Golden Deagle For VIP
Reply With Quote #1

Can any one edit this i want this only fort VIP. (ADMIN_LEVEL_H) and only for CT Team cuz i use biohzard mod
Sorry if my english bad
Quote:
/* Plugin generated by AMXX-Studio

Original Plugin By AlejandroSk (For Ak47)

Remaked By me Alicx (for Deagle)

Changelog:

V 1.0 Initial relase

*/



#include <amxmodx>

#include <fakemeta>

#include <fun>

#include <hamsandwich>

#include <cstrike>

#include <amxmisc>



#define is_valid_player(%1) (1 <= %1 <= 32)

#define PLUGIN "Golden Deagle"

#define VERSION "1.0"

#define AUTHOR "alicx"





new DEAGLE_V_MODEL[64] = "models/v_golden_deagle.mdl"

new DEAGLE_P_MODEL[64] = "models/p_golden_deagle.mdl"



/* Pcvars */

new cvar_dmgmultiplier, cvar_goldbullets, cvar_custommodel, cvar_cost, cvar_bullets, cvar_keepdeagle, cvar_zoom_type;



new bool:g_HasDeagle[33]



new g_hasZoom[ 33 ]

new g_ZoomDist[ 33 ] = 0

new bullets[ 33 ]



// Sprite

new m_spriteTexture



const Wep_deagle = ((1<<CSW_DEAGLE))





public plugin_init() {

register_plugin(PLUGIN, VERSION, AUTHOR)



// The Cvars //

cvar_dmgmultiplier = register_cvar("goldendeagle_dmg_multiplier", "5")

cvar_custommodel = register_cvar("goldendeagle_custom_model", "1")

cvar_goldbullets = register_cvar("goldendeagle_gold_bullets", "1")

cvar_cost = register_cvar("goldendeagle_cost", "4000")

cvar_bullets = register_cvar("goldendeagle_bullets", "200")

cvar_keepdeagle = register_cvar("goldendeagle_keep", "1")

cvar_zoom_type = register_cvar("goldendeagle_zoom_type", "4")





// Register The Buy Cmd

register_clcmd("say /goldendeagle", "CmdBuyDeagle")

register_clcmd("say_team /goldendeagle", "CmdBuyDeagle")

register_concmd("amx_goldendeagle", "CmdGiveDeagle", ADMIN_BAN, "<name>")



//Death Msg

register_event("DeathMsg", "Death", "a")



// Weapon Pick Up

register_event("WeapPickup","checkModel","b", "1=19")



// Current Weapon Event

register_event("CurWeapon", "make_tracer", "be", "1=1", "3>0")



// Ham TakeDamage

RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")

register_forward( FM_CmdStart, "fw_CmdStart")

register_forward(FM_CmdStart, "fwCmdStart")

RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawnPost", 1)

}



public plugin_precache()

{

precache_model(DEAGLE_V_MODEL)

precache_model(DEAGLE_P_MODEL)

m_spriteTexture = precache_model("sprites/dot.spr")

precache_sound("weapons/zoom.wav")

}



public client_connect(id)

{

g_HasDeagle[id] = false

}



public client_disconnect(id)

{

g_HasDeagle[id] = false

}



public Death()

{

g_HasDeagle[read_data(2)] = false

}



public fwHamPlayerSpawnPost(id)

{

if( !is_user_alive( id ) )

return;



if( get_pcvar_num( cvar_keepdeagle ) )

{

if( user_has_weapon( id, CSW_DEAGLE ) )

{

g_HasDeagle[id] = true

}

else {

g_HasDeagle[id] = false;

}

}

else {

g_HasDeagle[id] = false;

}

}



public checkModel(id)

{

if ( !g_HasDeagle[id] )

return PLUGIN_HANDLED



new szWeapID = read_data(2)



if ( szWeapID == CSW_DEAGLE && g_HasDeagle[id] == true && get_pcvar_num(cvar_custommodel) )

{

set_pev(id, pev_viewmodel2, DEAGLE_V_MODEL)

set_pev(id, pev_weaponmodel2, DEAGLE_P_MODEL)

}

return PLUGIN_HANDLED

}





public fw_TakeDamage(victim, inflictor, attacker, Float:damage)

{

if ( is_valid_player( attacker ) && get_user_weapon(attacker) == CSW_DEAGLE && g_HasDeagle[attacker] )

{

SetHamParamFloat(4, damage * get_pcvar_float( cvar_dmgmultiplier ) )

}

}



public fw_CmdStart( id, uc_handle, seed )

{

if( !is_user_alive( id ) )

return PLUGIN_HANDLED



if( ( get_uc( uc_handle, UC_Buttons ) & IN_ATTACK2 ) && !( pev( id, pev_oldbuttons ) & IN_ATTACK2 ) )

{

new szClip, szAmmo

new szWeapID = get_user_weapon( id, szClip, szAmmo )



if( szWeapID == CSW_DEAGLE && g_HasDeagle[id] && !g_hasZoom[ id ] )

{

golden_deagle_zoom( id, get_pcvar_num( cvar_zoom_type ) )

}

else if ( szWeapID == CSW_DEAGLE && g_HasDeagle[id] && g_hasZoom[id])

{

g_hasZoom[ id ] = false

cs_set_user_zoom( id, CS_RESET_ZOOM, 1 )

}

}

return PLUGIN_HANDLED

}



public make_tracer(id)

{

if (get_pcvar_num(cvar_goldbullets))

{

new clip,ammo

new wpnid = get_user_weapon(id,clip,ammo)

new pteam[16]



get_user_team(id, pteam, 15)



if ((bullets[id] > clip) && (wpnid == CSW_DEAGLE) && g_HasDeagle[id])

{

new vec1[3], vec2[3]

get_user_origin(id, vec1, 1) // origin; your camera point.

get_user_origin(id, vec2, 4) // termina; where your bullet goes (4 is cs-only)





//BEAMENTPOINTS

message_begin( MSG_BROADCAST,SVC_TEMPENTITY)

write_byte (0) //TE_BEAMENTPOINTS 0

write_coord(vec1[0])

write_coord(vec1[1])

write_coord(vec1[2])

write_coord(vec2[0])

write_coord(vec2[1])

write_coord(vec2[2])

write_short( m_spriteTexture )

write_byte(1) // framestart

write_byte(5) // framerate

write_byte(2) // life

write_byte(10) // width

write_byte(0) // noise

write_byte( 255 ) // r, g, b

write_byte( 215 ) // r, g, b

write_byte( 0 ) // r, g, b

write_byte(200) // brightness

write_byte(150) // speed

message_end()

}



bullets[id] = clip

}



}



public CmdBuyDeagle(id)

{

if ( !is_user_alive(id) )

{

client_print(id,print_chat, "[AMXX] To buy golden Deagle You need to be alive!")

return PLUGIN_HANDLED

}



new money = cs_get_user_money(id)



if (money >= get_pcvar_num(cvar_cost) && get_pcvar_num(cvar_bullets))

{

cs_set_user_money(id, money - get_pcvar_num(cvar_cost))

give_item(id, "weapon_deagle")

give_item(id, "ammo_50ae")

cs_set_user_bpammo(id, CSW_DEAGLE, get_pcvar_num(cvar_bullets))

g_HasDeagle[id] = true

}



else

{

client_print(id, print_chat, "[AMXX] You dont hav enough money to buy Golden Deagle. Cost $%d ", get_pcvar_num(cvar_cost))

}

return PLUGIN_HANDLED

}



public CmdGiveDeagle(id,level,cid)

{

if (!cmd_access(id,level,cid,2))

return PLUGIN_HANDLED;

new arg[32];

read_argv(1,arg,31);



new player = cmd_target(id,arg,7);

if (!player)

return PLUGIN_HANDLED;



new name[32];

get_user_name(player,name,31);



give_item(player, "weapon_deagle")

g_HasDeagle[player] = true



return PLUGIN_HANDLED

}



stock drop_prim(id)

{

new weapons[32], num

get_user_weapons(id, weapons, num)

for (new i = 0; i < num; i++) {

if (Wep_deagle & (1<<weapons))

{

static wname[32]

get_weaponname(weapons, wname, sizeof wname - 1)

engclient_cmd(id, "drop", wname)

}

}

}



stock golden_deagle_zoom( id, type )

{

g_hasZoom[ id ] = true;

switch( type )

{

case 0: cs_set_user_zoom( id, CS_RESET_ZOOM, 1 )

case 1: cs_set_user_zoom( id, CS_SET_AUGSG552_ZOOM, 1 )

case 2:

{

cs_set_user_zoom( id, CS_SET_FIRST_ZOOM, 1 )

emit_sound( id, CHAN_ITEM, "weapons/zoom.wav", 0.20, 2.40, 0, 100 )

}

case 3:

{

cs_set_user_zoom( id, CS_SET_SECOND_ZOOM, 1 )

emit_sound( id, CHAN_ITEM, "weapons/zoom.wav", 0.20, 2.40, 0, 100 )

}

case 4:

{

g_ZoomDist[ id ]++

g_hasZoom[ id ] = false;

switch( g_ZoomDist[ id ] )

{

case 1: cs_set_user_zoom( id, CS_SET_AUGSG552_ZOOM, 1 )

case 2:

{

cs_set_user_zoom( id, CS_SET_FIRST_ZOOM, 1 )

emit_sound( id, CHAN_ITEM, "weapons/zoom.wav", 0.20, 2.40, 0, 100 )

}

case 3:

{

cs_set_user_zoom( id, CS_SET_SECOND_ZOOM, 1 )

emit_sound( id, CHAN_ITEM, "weapons/zoom.wav", 0.20, 2.40, 0, 100 )

}

case 4:

{

g_ZoomDist[ id ] = 0;

cs_set_user_zoom( id, CS_RESET_ZOOM, 1 )

}

}

}

}

}

/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE

*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1034\\ f0\\ fs16 \n\\ par }

*/

Last edited by sPed; 04-19-2018 at 19:25.
sPed is offline
Mohamed null
BANNED
Join Date: Sep 2020
Location: Algeria
Old 10-17-2020 , 17:01   Re: Golden Deagle For VIP
Reply With Quote #2

Its Easy
Mohamed null is offline
r0ma
Senior Member
Join Date: Apr 2012
Location: AddToFullPack
Old 10-17-2020 , 19:37   Re: Golden Deagle For VIP
Reply With Quote #3

in CmdBuyDeagle add

PHP Code:
if(!(get_user_flags(id) & ADMIN_LEVEL_H) || cs_get_user_team(id) != CS_TEAM_CT)
    return 
PLUGIN_HANDLED
__________________
Quote:
Originally Posted by Chihuahuax View Post
If you want to apply these settings to all players, try: (shouldnt be considered as slow-hacking==)
Quote:
Originally Posted by rak View Post
ayudamos.. pero no de la forma que quiere la mayoria
r0ma is offline
Send a message via MSN to r0ma
Mohamed null
BANNED
Join Date: Sep 2020
Location: Algeria
Old Yesterday , 14:05   Re: Golden Deagle For VIP
Reply With Quote #4

add it and send me it bro
Mohamed null is offline
Mohamed null
BANNED
Join Date: Sep 2020
Location: Algeria
Old Yesterday , 14:07   Re: Golden Deagle For VIP
Reply With Quote #5

Like this ?
Quote:
public CmdBuyDeagle(id)

if(!(get_user_flags(id) & ADMIN_LEVEL_H) || cs_get_user_team(id) != CS_TEAM_CT)
return PLUGIN_HANDLED;
{

if ( !is_user_alive(id) )

{

client_print(id,print_chat, "[AMXX] To buy golden Deagle You need to be alive!")

return PLUGIN_HANDLED
Mohamed null is offline
Mohamed null
BANNED
Join Date: Sep 2020
Location: Algeria
Old Yesterday , 14:10   Re: Golden Deagle For VIP
Reply With Quote #6

send me it bro pls
Mohamed null is offline
Reply


Thread Tools
Display Modes

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 22:46.


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