Raised This Month: $ Target: $400
 0% 

I need help with this plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
k007
BANNED
Join Date: Mar 2006
Location: bacon?
Old 06-11-2006 , 15:17   I need help with this plugin
Reply With Quote #1

k guys this is a plugin i made. it compile fines no errors but like the nades don't work and it keep giving people infit nades so someone help me plz
Code:
#include <amxmodx> #include <fakemeta> #include <engine> #include <fun> #include <cstrike>   new bool:gPauseEntity[1024] new Float:gNadeSpeed new gSpriteTrail new gSuperNade[33][1024] new g_iMaxPlayers   public plugin_init() {         register_plugin("Super nade ", "1.0", "k007")         register_cvar("Supernade_grenademult", "1.0")         register_cvar("Supernade_cooldown", "120.0")         register_cvar("Supernade_nadespeed", "900")         register_srvcmd("Supernade_init", "Supernade_init")         register_event("Damage", "Supernade_damage", "b", "2!0")         register_event("CurWeapon", "Supernade_weapons", "be", "1=1")         register_forward(FM_Think, "fw_entity_think", 0)         register_logevent("round_start", 2, "1=Round_Start")                 g_iMaxPlayers = get_maxplayers() }   public plugin_precache()         gSpriteTrail = precache_model("sprites/smoke.spr")   public Supernade_init() {         new temp[6]         read_argv(1,temp,5)         new id = str_to_num(temp)                 if ( is_user_alive(id) ) {                 Supernade_weapons(id)         } }   public Supernade_weapons(id) {         if ( is_user_alive(id) ) {                 give_item(id, "weapon_hegrenade")         } }   public find_target(parm[]) {         new grenadeID = parm[0]         new grenadeOwner = parm[1]                 if ( is_valid_ent(grenadeID) ) {                 new shortestDistance = 9999                 new nearestPlayer = 0                 new distance, team[33], rgb[3], players[32], pnum                                 get_user_team(grenadeOwner, team, 32)                                                 if ( cs_get_user_team(grenadeOwner) == CS_TEAM_CT ) {                         get_players(players, pnum, "ae", "TERRORIST")                         rgb = {50, 50, 175}                 }                 else {                         get_players(players, pnum, "ae", "CT")                         rgb = {175, 50, 50}                 }                                                 for (new i = 0; i < pnum; i++) {                         if ( !is_user_alive(players[i]) ) continue                                                 distance =  get_entity_distance(players[i], grenadeID)                                                 if ( distance <= shortestDistance ) {                                 shortestDistance = distance                                 nearestPlayer = players[i]                         }                 }                                                 if ( nearestPlayer > 0 ) {                                                 message_begin(MSG_BROADCAST, SVC_TEMPENTITY)                         write_byte(22)                                         write_short(grenadeID)                                 write_short(gSpriteTrail)                           write_byte(10)                                 write_byte(3)                                 write_byte(rgb[0])                             write_byte(rgb[1])                           write_byte(rgb[2])                             switch(random_num(0,2)) {                                 case 0:write_byte(64)                                     case 1:write_byte(128)                                 case 2:write_byte(192)                         }                         message_end()                                                 parm[2] = nearestPlayer                         set_task(0.1, "seek_target", grenadeID+1000, parm, 3, "b")                 }         } }   //---------------------------------------------------------------------------------------------- public seek_target(parm[]) {         new grenade = parm[0]         new target = parm[2]                 if ( !is_valid_ent(grenade) ) {                 remove_task(grenade+1000)                 return         }                 if ( is_user_alive(target) ) {                 entity_set_follow(grenade, target)         }         else {                                 remove_task(grenade+1000)                                                 message_begin(MSG_BROADCAST, SVC_TEMPENTITY)                 write_byte(99)                             write_short(grenade)                     message_end()                                                 set_task(0.1, "find_target", 0, parm, 3)         } }   //---------------------------------------------------------------------------------------------- stock entity_set_follow(entity, target) {         if ( !is_valid_ent(entity) || !is_user_alive(target) ) return 0                 new Float:fl_Origin[3], Float:fl_EntOrigin[3]         entity_get_vector(target, EV_VEC_origin, fl_Origin)         entity_get_vector(entity, EV_VEC_origin, fl_EntOrigin)                 new Float:fl_InvTime = (gNadeSpeed / vector_distance(fl_Origin, fl_EntOrigin))                 new Float:fl_Distance[3]         fl_Distance[0] = fl_Origin[0] - fl_EntOrigin[0]         fl_Distance[1] = fl_Origin[1] - fl_EntOrigin[1]         fl_Distance[2] = fl_Origin[2] - fl_EntOrigin[2]                 new Float:fl_Velocity[3]         fl_Velocity[0] = fl_Distance[0] * fl_InvTime         fl_Velocity[1] = fl_Distance[1] * fl_InvTime         fl_Velocity[2] = fl_Distance[2] * fl_InvTime                 entity_set_vector(entity, EV_VEC_velocity, fl_Velocity)                 new Float:fl_NewAngle[3]         vector_to_angle(fl_Velocity, fl_NewAngle)         entity_set_vector(entity, EV_VEC_angles, fl_NewAngle)                 return 1 } //---------------------------------------------------------------------------------------------- public pfn_touch(ptr, ptd) {               if ( !is_valid_ent(ptr) || !is_valid_ent(ptd) ) return                 new szClassNamePtr[32], szClassNamePtd[32]         entity_get_string(ptr, EV_SZ_classname, szClassNamePtr, 31)         entity_get_string(ptd, EV_SZ_classname, szClassNamePtd, 31)                 if ( !equal(szClassNamePtr, "grenade") && !equal(szClassNamePtd, "player") ) return         if ( !gPauseEntity[ptr] ) return                 if ( !is_user_connected(ptd) || get_user_godmode(ptd) ) return                 new grenadeOwner = entity_get_edict(ptr, EV_ENT_owner)                 if ( cs_get_user_team(grenadeOwner) == cs_get_user_team(ptd) ) return                 new parm[2]         parm[0] = ptr         parm[1] = grenadeOwner         unpause_nade(parm) } //---------------------------------------------------------------------------------------------- public unpause_nade(parm[]) {         new ent = parm[0]         new id = parm[1]                 remove_task(ent)                 gSuperNade[id][ent] = true         set_task(0.4, "nade_reset", 0, parm, 2)                 gPauseEntity[ent] = false } //---------------------------------------------------------------------------------------------- public nade_reset(parm[]) {         new ent = parm[0]         new id = parm[1]                 gSuperNade[id][ent] = false } //---------------------------------------------------------------------------------------------- public fw_entity_think(ent) {         if (ent > sizeof(gPauseEntity)-1 ) return FMRES_IGNORED                 if ( gPauseEntity[ent] ) {                 new Float:nextThink = entity_get_float(ent, EV_FL_nextthink)                 set_pev(ent, pev_nextthink, nextThink + 0.1)                 return FMRES_SUPERCEDE         }                 return FMRES_IGNORED } //---------------------------------------------------------------------------------------------- public Supernade_damage(id) {         if ( is_user_connected(id) ) return                 new damage = read_data(2)         new weapon, bodypart, attacker = get_user_attacker(id, weapon, bodypart)                 if ( attacker == 0 && weapon == 0 && is_user_connected(id) ) {                 for ( new atkr = 1; atkr <= g_iMaxPlayers; atkr++ ) {                         if ( is_user_connected(atkr) ) {                                 for(new i = g_iMaxPlayers + 1; i < sizeof(gPauseEntity)-1; i++) {                                         if ( gSuperNade[atkr][i] ) {                                                 if ( is_user_alive(id) ) {                                                                                                                 new extraDamage = floatround(damage * get_cvar_float("supernade_grenademult") - damage)                                                         if (extraDamage > 0 && get_user_health(id) < extraDamage) shExtraDamage(id, atkr, "grenade")                                                         else if(extraDamage > 0)                                                                 fakedamage(id,"grenade",float(extraDamage),DMG_CRUSH)                                                 }                                                                                                 new parm[2]                                                 parm[0] = i                                                 parm[1] = atkr                                                                                                 set_task(0.2, "cooldown", 0, parm, 2)                                                                                                 return                                         }                                 }                         }                 }         }                 if ( attacker <= 0 || attacker > g_iMaxPlayers ) return                 if (is_user_connected(id) && weapon == CSW_HEGRENADE ) {                 if ( is_user_alive(id) ) {                         new extraDamage = floatround(damage * get_cvar_float("supernade_grenademult") - damage)                         if (extraDamage > 0 && get_user_health(id) < extraDamage) shExtraDamage(id, id, "grenade")                         else if(extraDamage > 0)                                 fakedamage(id,"grenade",float(extraDamage),DMG_CRUSH)                 }                 for(new i = g_iMaxPlayers; i < sizeof(gPauseEntity)-1; i++) {                         if ( gSuperNade[attacker][i] ) {                                 new parm[2]                                 parm[0] = i                                 parm[1] = attacker                                                                 set_task(0.2, "cooldown", 0, parm, 2)                         }                 }         } } //---------------------------------------------------------------------------------------------- public cooldown(parm[]) {         new grenade = parm[0]         new id = parm[1]                 gSuperNade[id][grenade] = false                 if ( !is_user_alive(id) ) return                 } //---------------------------------------------------------------------------------------------- public round_start() {               for(new i = g_iMaxPlayers; i < sizeof(gPauseEntity)-1; i++) {                 gPauseEntity[i] = false         } }   shExtraDamage(id, victim, weaponDescription[] ) {           new namea[32],namev[32],authida[35],authidv[35],teama[16],teamv[16]           //Info On Attacker         get_user_name(id,namea,31)         get_user_team(id,teama,15)         get_user_authid(id,authida,34)           //Info On Victim         get_user_name(victim,namev,31)         get_user_team(victim,teamv,15)         get_user_authid(victim,authidv,34)                 user_kill(victim,0)           //Log This Kill         if ( id != victim ) {                 log_message("^"%s<%d><%s><%s>^" killed ^"%s<%d><%s><%s>^" with ^"%s^"",                         namea,get_user_userid(id),authida,teama,namev,get_user_userid(victim),authidv,teamv, weaponDescription )         }         else {                 log_message("^"%s<%d><%s><%s>^" committed suicide with ^"%s^"",                         namea,get_user_userid(id),authida,teama, weaponDescription )         } }
k007 is offline
Send a message via MSN to k007
VEN
Veteran Member
Join Date: Jan 2005
Old 06-11-2006 , 15:24  
Reply With Quote #2

Code:
register_event("CurWeapon", "Supernade_weapons", "be", "1=1")
That gives nade on every weapon select/shot. Isn't you expected that?
VEN is offline
k007
BANNED
Join Date: Mar 2006
Location: bacon?
Old 06-11-2006 , 15:25  
Reply With Quote #3

oh lol. ok how about the nades how come they don't work? you know what i mean by work right i mean sneek
k007 is offline
Send a message via MSN to k007
VEN
Veteran Member
Join Date: Jan 2005
Old 06-12-2006 , 00:07  
Reply With Quote #4

what
VEN is offline
k007
BANNED
Join Date: Mar 2006
Location: bacon?
Old 06-12-2006 , 00:17  
Reply With Quote #5

could fix me the nades. cuz they don't seek.
k007 is offline
Send a message via MSN to k007
VEN
Veteran Member
Join Date: Jan 2005
Old 06-12-2006 , 00:32  
Reply With Quote #6

What's the idea and what's exactly do you expected from the nade and what is work in other way?
VEN is offline
k007
BANNED
Join Date: Mar 2006
Location: bacon?
Old 06-12-2006 , 00:55  
Reply With Quote #7

the idea is that you get infit nades and the nades look for your enemies they seek and like have cool down after each nade and nades don't just exploide after you throw them they wait for a few second there is a cvar for it
k007 is offline
Send a message via MSN to k007
Kensai
Veteran Member
Join Date: Aug 2005
Location: San Diego, California
Old 06-12-2006 , 01:11  
Reply With Quote #8

VEN this was an exact copy fromt he Superhero Penguin. He's trying to do that.
Kensai is offline
Send a message via AIM to Kensai Send a message via MSN to Kensai
k007
BANNED
Join Date: Mar 2006
Location: bacon?
Old 06-12-2006 , 01:14  
Reply With Quote #9

Quote:
Originally Posted by Kensai
VEN this was an exact copy fromt he Superhero Penguin. He's trying to do that.
I changed alot of things. Go look at the orginaly one and come look at this
k007 is offline
Send a message via MSN to k007
Spanky McNutnut
AMX Mod X Beta Tester
Join Date: Feb 2006
Old 06-12-2006 , 01:23  
Reply With Quote #10

You cant just copy and paste things from other plugins, change 2 things, then call it yours. You need to give the origional writer some credit.

Also as Brad would say, please change the topic to be more descriptive or it will be trashed.
Spanky McNutnut 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 08:08.


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