Raised This Month: $ Target: $400
 0% 

weapon help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Extremeone
Senior Member
Join Date: Jan 2005
Old 02-15-2005 , 21:03   weapon help
Reply With Quote #1

im trying to make a duplicate of green arrow on my server only called black arrow and with a ct auto-snipe instead of a scout heres wat i have now
Code:
// BLACK ARROW! - Exploding Arrows (bullets from sg550) /* CVARS - copy and paste to shconfig.cfg // Black Arrow barrow_level 10 barrow_arrows 90 barrow_getsg550 0 */ #include <amxmod> #include <superheromod> // VARIABLES new gHeroName[]="Black Arrow" new gHasGarrowPower[SH_MAXSLOTS+1] new gArrows[SH_MAXSLOTS+1] // Test new gLastWeapon[SH_MAXSLOTS+1] new gLastClipCount[SH_MAXSLOTS+1] // Sprites new laser,laser_impact,blast_shroom //---------------------------------------------------------------------------------------------- public plugin_init() {     // Plugin Info     register_plugin("SUPERHERO Black Arrow","1.2","AssKicR / ArtofDrowning07")       // DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG     register_cvar("barrow_level","10")     register_cvar("barrow_arrows", "10")     register_cvar("barrow_getsg550", "0")       // FIRE THE EVENT TO CREATE THIS SUPERHERO!     shCreateHero(gHeroName, "Black Arrows", "You get some Explosive Arrows for your bow(sg550)!", false, "garrow_level" )       // REGISTER EVENTS THIS HERO WILL RESPOND TO! (AND SERVER COMMANDS)         // INIT     register_srvcmd("garrow_init", "garrow_init")     shRegHeroInit(gHeroName, "garrow_init")         // NEW ROUND     register_event("ResetHUD","newRound","b")       // GREEN ARROW DAMAGE     register_event("Damage", "garrow_damage", "b", "2!0")       // ARROW FIRED     register_event("CurWeapon","garrow_fire", "be", "1=1", "3>0") } //---------------------------------------------------------------------------------------------- public garrow_init() {     // First Argument is an id     new temp[128]     read_argv(1,temp,5)     new id = str_to_num(temp)       // 2nd Argument is 0 or 1 depending on whether the id has garrow     read_argv(2,temp,5)     new hasPowers = str_to_num(temp)         gHasGarrowPower[id]=(hasPowers!=0)         if ( gHasGarrowPower[id] )     {         gArrows[id] = get_cvar_num("barrow_arrows")                 if ( get_cvar_num("barrow_getsg550") == 1 )             shGiveWeapon(id,"weapon_sg550")     } } //---------------------------------------------------------------------------------------------- public plugin_precache() {     laser = precache_model("sprites/laserbeam.spr")     laser_impact = precache_model("sprites/zerogxplode.spr")     blast_shroom = precache_model("sprites/mushroom.spr") } //---------------------------------------------------------------------------------------------- public newRound(id) {     if ( gHasGarrowPower[id] )     {         gArrows[id] = get_cvar_num("barrow_arrows")         gLastWeapon[id] = -1  // I think the change Weapon automatically gets called on spawn death too...         if ( get_cvar_num("barrow_getsg550") == 1 )             shGiveWeapon(id,"weapon_sg550")     } } //---------------------------------------------------------------------------------------------- public garrow_damage(id) {     new damage = read_data(2)     new weapon, bodypart, attacker = get_user_attacker(id,weapon,bodypart)         if ( attacker < 0 || attacker > SH_MAXSLOTS ) return PLUGIN_CONTINUE       if ( gHasGarrowPower[attacker] && weapon == CSW_SG550 && gArrows[attacker] >= 0 && is_user_alive(id) )     {         new health = get_user_health(id)                 // damage is less than 10%         if ( ( (1.0 * damage) / (1.0 * (health + damage) ) ) < 0.01 ) return PLUGIN_CONTINUE         new origin[3]         get_user_origin(id, origin)         // player fades..         set_user_rendering(id, kRenderFxFadeSlow, 255, 255, 255, kRenderTransColor, 4);         // beeeg explody!         message_begin(MSG_ALL, SVC_TEMPENTITY)         write_byte(3)           // TE_EXPLOSION         write_coord(origin[0])         write_coord(origin[1])         write_coord(origin[2]-22)         write_short(blast_shroom)   // mushroom cloud         write_byte(40)          // scale in 0.1's         write_byte(12)          // frame rate         write_byte(12)          // TE_EXPLFLAG_NOPARTICLES & TE_EXPLFLAG_NOSOUND         message_end()         // do turn down that awful racket..to be replaced by a blood spurt!         message_begin(MSG_ALL, SVC_TEMPENTITY)         write_byte(10)  // TE_LAVASPLASH         write_coord(origin[0])         write_coord(origin[1])         write_coord(origin[2]-26)         message_end()         // kill victim         user_kill(id, 1)                 message_begin( MSG_ALL, get_user_msgid("DeathMsg"),{0,0,0},0 )         write_byte(attacker)         write_byte(id)         write_byte(0)         write_string("sg550")         message_end()                 //Save Hummiliation         new namea[24],namev[24],authida[20],authidv[20],teama[8],teamv[8]         //Info On Attacker         get_user_name(attacker,namea,23)         get_user_team(attacker,teama,7)         get_user_authid(attacker,authida,19)         //Info On Victim         get_user_name(id,namev,23)         get_user_team(id,teamv,7)         get_user_authid(id,authidv,19)         //Log This Kill         log_message("^"%s<%d><%s><%s>^" killed ^"%s<%d><%s><%s>^" with ^"Black Arrow^"",         namea,get_user_userid(attacker),authida,teama,namev,get_user_userid(id),authidv,teamv)                        // team check!         new attacker_team[2], victim_team[2]         get_user_team(attacker, attacker_team, 1)         get_user_team(id, victim_team, 1)         // for some reason this doesn't update in the hud until the next round.. whatever.         if (!equali(attacker_team, victim_team))         {             // diff. team;  $attacker gets credited for the kill and $250 and XP.             //      $id gets their suicidal -1 frag back.             set_user_frags(attacker, get_user_frags(attacker)+1)                         #if defined AMXX_VERSION                 cs_set_user_money(attacker, cs_get_user_money(attacker)+150)             #else                 set_user_money(attacker, get_user_money(attacker)+150)             #endif                         shAddXP(attacker, id, 1)         }         else         {             // same team;   $attacker loses a frag and $500 and XP.             set_user_frags(attacker, get_user_frags(attacker)-1)                         #if defined AMXX_VERSION                 cs_set_user_money(attacker, cs_get_user_money(attacker)-500, 0)             #else                 set_user_money(attacker, get_user_money(attacker)-500, 0)             #endif                         shAddXP(attacker, id, -1)         }     }     return PLUGIN_CONTINUE } //----------------------------------------------------------------------------------------------, public garrow_fire(id) {     if ( !gHasGarrowPower[id] ) return PLUGIN_CONTINUE             new weap = read_data(2)     // id of the weapon     new ammo = read_data(3)     // ammo left in clip     if ( weap == CSW_SG550 && is_user_alive(id) )     {         if (gLastWeapon[id] == 0) gLastWeapon[id] = weap         if ( gLastClipCount[id] > ammo && gLastWeapon[id] == weap && gArrows[id] > 0 )         {             new vec1[3], vec2[3]             get_user_origin(id, vec1, 1) // origin; where you are             get_user_origin(id, vec2, 4) // termina; where your bullet goes             // tracer beam             message_begin(MSG_PAS, SVC_TEMPENTITY, vec1)             write_byte(0)       // TE_BEAMPOINTS             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(laser)  // laserbeam sprite             write_byte(0)       // starting frame             write_byte(10)      // frame rate             write_byte(2)       // life in 0.1s             write_byte(4)       // line width in 0.1u             write_byte(1)       // noise in 0.1u             write_byte(50)      // red             write_byte(50)      // green             write_byte(50)      // blue             write_byte(100)     // brightness             write_byte(100)     // scroll speed             message_end()             // bullet impact explosion             message_begin(MSG_PAS, SVC_TEMPENTITY, vec2)             write_byte(3)       // TE_EXPLOSION             write_coord(vec2[0])    // end point of beam             write_coord(vec2[1])             write_coord(vec2[2])             write_short(laser_impact)   // blast sprite             write_byte(10)          // scale in 0.1u             write_byte(30)          // frame rate             write_byte(8)           // TE_EXPLFLAG_NOPARTICLES             message_end()           // ..unless i'm mistaken, noparticles helps avoid a crash                         gArrows[id]--             new message[128]             format(message, 127, "You Have %d arrow(s) left",gArrows[id])             set_hudmessage(255,0,0,-1.0,0.3,0,0.25,1.0,0.0,0.0,4)             show_hudmessage(id, message)                         if ( gArrows[id] == 0 ) gArrows[id] = -1         }                 gLastClipCount[id] = ammo         gLastWeapon[id] = weap     }     return PLUGIN_CONTINUE }
Questions:

1 do i have the right weapon abbreviation for ct auto-snipe?

2 when im in game it still gives a scout How can i fix that?

thanks to anyone who helps
Extremeone is offline
jtp10181
Veteran Member
Join Date: May 2004
Location: Madison, WI
Old 02-15-2005 , 21:08  
Reply With Quote #2

its impossible it gives a scout, you dont have it in your code, the weapon names are in the amxconst.inc for the CSW defines, otherwise you just have to know them.... I'm sure someone has listed them someplace.
__________________
jtp10181 is offline
Send a message via ICQ to jtp10181 Send a message via AIM to jtp10181 Send a message via MSN to jtp10181 Send a message via Yahoo to jtp10181
Extremeone
Senior Member
Join Date: Jan 2005
Old 02-15-2005 , 21:11  
Reply With Quote #3

but wats the abbreviation for the ct auto-snipe sg550? sg552? g3somethig?

*******EDIT********
nvm its sg550

*******EDIT2********
the reason it gave a scout is i never changed the cvars(i changed em right b4 i posted this)
Extremeone is offline
Reply



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 19:37.


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