Raised This Month: $ Target: $400
 0% 

I've run out of ideas.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
smdobay
Member
Join Date: Feb 2005
Old 04-23-2005 , 14:10   I've run out of ideas.
Reply With Quote #1

Okay, I'm writing a hostile intent ff plugin involving event_damage.

I use
Code:
new  attacker = get_user_attacker(id)
where id is the victim and then get_user_team to check for ff, but for some reason it never returns that two people are on the same team. The numbers seem almost random.

Here's the code: [Edit]Updated Code[/Edit]

Code:
#include <amxmodx> #include <amxmisc> #include <fun> #include <engine> //new g_iServerHits = 0 new can_tk[33] public plugin_init() {     register_plugin("StopFire","0.7","i r winnar|XeroBlood")     register_event("Damage", "event_damage","b","2!0" )     register_event("DeathMsg", "event_death","b","2!0" )     register_clcmd("amx_setff","settk",ADMIN_KICK," <target> <1 = Enable FF|0 = Disable FF>")     //register_clcmd("tellhp","tellhp") } public client_authorized(id){     can_tk[id] = 1 } public tellhp(id){     new tStr[101]     format(tStr,100,"Your HP is %d",get_user_health(id))     client_print(id,print_console,tStr)     return PLUGIN_HANDLED } public settk(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,1)     if (!is_user_connected(player)) return PLUGIN_HANDLED     new szSwitch[4]     read_argv(2, szSwitch, 4)     new iSwitch = str_to_num(szSwitch)     can_tk[player] = clamp( iSwitch, 0, 1 ) // Min=0   Max=1     new tName[51]     get_user_name(player,tName,50)     new tStr[101]     if( iSwitch == 1 )         format(tStr,100,"FF Enabled on %s",tName)     else         format(tStr,100,"FF Disabled on %s",tName)     client_print(id,print_console,tStr)     return PLUGIN_HANDLED } public event_damage(id){     if( !is_user_connected( id ) )         return PLUGIN_CONTINUE     new attacker = get_user_attacker(id)     if( !is_user_connected( attacker ) )         return PLUGIN_CONTINUE     if (team(id) == team(attacker) && can_tk[attacker] == 0){         set_user_health(id,100)     }     //g_iServerHits++     return PLUGIN_CONTINUE } public event_death(){     new killer = read_data(1)     new victim = read_data(2)         new tSt[101]     format(tSt,100,"Attacker team:%d",team(killer))     client_print(victim,print_chat,tSt)     format(tSt,100,"Your team: %d",team(victim))     client_print(victim,print_chat,tSt)         return PLUGIN_HANDLED } public team(tID){     new tTeam = entity_get_int(tID,EV_INT_team)     return tTeam }
smdobay is offline
 



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 09:57.


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