Raised This Month: $ Target: $400
 0% 

New weapon for Admin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Tonda
Senior Member
Join Date: Aug 2009
Old 08-29-2009 , 02:32   New weapon for Admin
Reply With Quote #1

Hi, i have plugin bazooka. This plugin get weapon Bazooka for all players on the server. But i need edit this script, if its possible i want edit to: Bazooka only for Admins

This is code:

Code:
#include <amxmodx>
#include <fakemeta>
#include <weaponmod>
new PLUGIN[] = "WPN RPG"
new VERSION[] = "0.1"
new AUTHOR[] = "DevconeS(Edited by Humming Bird)"
new WPN_NAME[] = "RPG"
new WPN_SHORT[] = "rpg"
new P_MODEL[] = "models/p_rpg.mdl"
new V_MODEL[] = "models/v_rpg.mdl"
new W_MODEL[] = "models/w_rpg.mdl"
new ROCKET_MDL[] = "models/rpgrocket.mdl"
new ROCKET_SOUND[] = "weapons/rocketfire1.wav"
#define ROCKET_SPEED 1400
#define ROCKET_RADIUS 270.0
#define ROCKET_DAMAGE 200.0
// Sequences
enum
{
 anim_idle1,
 anim_fidget1,
 anim_altfireon,
 anim_altfirecycle,
 anim_altfireoff,
 anim_fire1,
 anim_fire2,
 anim_fire3,
 anim_fire4,
 anim_draw,
 anim_holster
}
new g_wpnid
new g_trail,g_explosion
public plugin_precache() {
 precache_model(P_MODEL)
 precache_model(V_MODEL)
 precache_model(W_MODEL)
 
 precache_model(ROCKET_MDL)
 precache_sound(ROCKET_SOUND)
 
 g_trail = precache_model("sprites/smoke.spr")
 g_explosion = precache_model("sprites/zerogxplode.spr")
}
public plugin_init() {
 register_plugin(PLUGIN,VERSION,AUTHOR)
 
 register_forward(FM_Touch,"fwd_Touch")
 
 create_weapon()
}
create_weapon() {
  if (get_user_flags(id) & ADMIN_LEVEL_T
 new wpnid = wpn_register_weapon(WPN_NAME,WPN_SHORT)
 if(wpnid == -1) return PLUGIN_CONTINUE
 
 wpn_set_string(wpnid,wpn_viewmodel,V_MODEL)
 wpn_set_string(wpnid,wpn_weaponmodel,P_MODEL)
 wpn_set_string(wpnid,wpn_worldmodel,W_MODEL)
 
 wpn_register_event(wpnid,event_attack1,"ev_attack1")
 wpn_register_event(wpnid,event_draw,"ev_draw")
 
 wpn_set_float(wpnid,wpn_refire_rate1,1.0)
 wpn_set_float(wpnid,wpn_reload_time,2.0)
 wpn_set_float(wpnid,wpn_recoil1,4.0)
 wpn_set_float(wpnid,wpn_run_speed,210.0)
 
 wpn_set_integer(wpnid,wpn_ammo1,4)
 wpn_set_integer(wpnid,wpn_ammo2,20)
 wpn_set_integer(wpnid,wpn_bullets_per_shot1,1)
 wpn_set_integer(wpnid,wpn_cost,6000)
 
 g_wpnid = wpnid
 return PLUGIN_CONTINUE
}
// vector_to_angle port
stock vec_to_angle(Float:vector[3],Float:output[3]) {
 new Float:angles[3]
 engfunc(EngFunc_VecToAngles, vector, angles)
 output[0] = angles[0]
 output[1] = angles[1]
 output[2] = angles[2]
}
public ev_attack1(id) {
 wpn_playanim(id,random_num(anim_fire3,anim_fire4))
 
 new rocket = engfunc(EngFunc_CreateNamedEntity,engfunc(EngFunc_AllocString,"info_target"))
 if(!rocket) return PLUGIN_CONTINUE
 
 // Strings
 set_pev(rocket,pev_classname,"wpn_rpg")
 engfunc(EngFunc_SetModel,rocket,ROCKET_MDL)
 
 // Integer
 set_pev(rocket,pev_owner,id)
 set_pev(rocket,pev_movetype,MOVETYPE_FLY)
 set_pev(rocket,pev_solid,SOLID_BBOX)
 
 // Floats
 set_pev(rocket,pev_mins,Float:{-1.0,-1.0,-1.0})
 set_pev(rocket,pev_maxs,Float:{1.0,1.0,1.0})
 
 new Float:fStart[3]
 wpn_projectile_startpos(id,40,0,0,fStart)
 set_pev(rocket,pev_origin,fStart)
 
 new Float:fVel[3]
 velocity_by_aim(id,ROCKET_SPEED,fVel)  
 set_pev(rocket,pev_velocity,fVel)
 
 new Float:fAngles[3]
 vec_to_angle(fVel,fAngles)
 set_pev(rocket,pev_angles,fAngles)
 
 message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
 write_byte(TE_BEAMFOLLOW)
 write_short(rocket)
 write_short(g_trail)
 write_byte(25)
 write_byte(5)
 write_byte(224)
 write_byte(224)
 write_byte(255)
 write_byte(255)
 message_end()
 
 emit_sound(rocket, CHAN_WEAPON, ROCKET_SOUND, 1.0, ATTN_NORM, 0, PITCH_NORM)
 
 return PLUGIN_CONTINUE
}
public ev_draw(id)
 wpn_playanim(id,anim_draw)
public fwd_Touch(ptr, ptd) {
 if(pev_valid(ptr)) {
  new classname[32]
  pev(ptr,pev_classname,classname,31)
  
  if(equal(classname,"wpn_rpg")) {
   new Float:fOrigin[3],iOrigin[3]
   pev(ptr,pev_origin,fOrigin)
   
   iOrigin[0] = floatround(fOrigin[0])
   iOrigin[1] = floatround(fOrigin[1])
   iOrigin[2] = floatround(fOrigin[2])
   
   message_begin(MSG_BROADCAST,SVC_TEMPENTITY,iOrigin)
   write_byte(TE_EXPLOSION)
   write_coord(iOrigin[0])
   write_coord(iOrigin[1])
   write_coord(iOrigin[2])
   write_short(g_explosion)
   write_byte(30)
   write_byte(15)
   write_byte(0)
   message_end()
   
   new attacker = pev(ptr,pev_owner)
   wpn_radius_damage(g_wpnid,attacker,fOrigin,ROCKET_RADIUS,ROCKET_DAMAGE,DMG_BLAST)
   if(pev_valid(ptd)) {
    pev(ptd,pev_classname,classname,31)
    
    if(equal(classname,"func_breakable"))
     dllfunc(DLLFunc_Use,ptd,ptr)
   }
   set_pev(ptr,pev_flags,FL_KILLME)
  }
 }
}
Tonda is offline
hzqst
Senior Member
Join Date: Jul 2008
Old 08-29-2009 , 02:38   Re: New weapon for Admin
Reply With Quote #2

if (get_user_flags(id) & ADMIN_BAN)
hzqst is offline
Tonda
Senior Member
Join Date: Aug 2009
Old 08-29-2009 , 03:24   Re: New weapon for Admin
Reply With Quote #3

Quote:
Originally Posted by hzqst View Post
if (get_user_flags(id) & ADMIN_BAN)
OK THX, but where is must be placed ?
Tonda is offline
Tonda
Senior Member
Join Date: Aug 2009
Old 08-29-2009 , 03:25   Re: New weapon for Admin
Reply With Quote #4

Quote:
Originally Posted by Tonda View Post
OK THX, but where must be placed ?
Tonda is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 08-29-2009 , 08:32   Re: New weapon for Admin
Reply With Quote #5

You rly need to bump your thread when only ONE MINUTE have passed? =/

Also, this section is not for request, is for learn about scripting.
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
Tonda
Senior Member
Join Date: Aug 2009
Old 08-29-2009 , 09:39   Re: New weapon for Admin
Reply With Quote #6

Quote:
Originally Posted by Alucard^ View Post
You rly need to bump your thread when only ONE MINUTE have passed? =/

Also, this section is not for request, is for learn about scripting.
This is wrong, i dont send 2x post in one minute.
Tonda is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 08-29-2009 , 11:55   Re: New weapon for Admin
Reply With Quote #7

Today , 02:24 AM Re: New weapon for Admin

Today , 02:25 AM Re: New weapon for Admin
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
Tonda
Senior Member
Join Date: Aug 2009
Old 08-29-2009 , 13:08   Re: New weapon for Admin
Reply With Quote #8

Quote:
Originally Posted by Alucard^ View Post
Today , 02:24 AM Re: New weapon for Admin

Today , 02:25 AM Re: New weapon for Admin
OMG ... you realy mean out of 2x post in one minute? Why i do this? You dont have lag never? Stop spam .. i need realy help!
Tonda is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 08-29-2009 , 14:07   Re: New weapon for Admin
Reply With Quote #9

lol, lag? so why you posted 2 DIFFERENT posts?

Spam? haha

And...

Quote:
Also, this section is not for request, is for learn about scripting.
You want to learn or you want to ppl do your job?
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
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 15:10.


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