Raised This Month: $ Target: $400
 0% 

How do I set a variable on someone I attacked?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Rolnaaba
Veteran Member
Join Date: May 2006
Old 06-03-2006 , 22:54   How do I set a variable on someone I attacked?
Reply With Quote #1

how would I set
Code:
new bool:gotattacked[33]
on the person that got attacked
ex. say I shoot Mike how do I make it so when I shoot Mike I set gotattacked = true on Mike?, I know how to set it true/false on myself but not on others such as people you attacked.
__________________
DO NOT PM me about avp mod.
Rolnaaba is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 06-04-2006 , 01:59  
Reply With Quote #2

simple:
Code:
#include <amxmodx> public plugin_init() {   register_plugin("Got attacked" , "0.1" , "v3x");   register_event("ResetHUD" , "event_ResetHUD" , "b");   register_event("Damage" , "event_Damage" , "b" , "2>0"); } new bool:attacked[33]; public event_ResetHUD(id)   attacked[id] = false; public event_Damage(victim_id) // changed 'id' to 'victim_id' {   new attacker_id = get_user_attacker(victim_id);   if(!is_user_alive(attacker_id))     return PLUGIN_CONTINUE;   attacked[victim_id] = true;   return PLUGIN_CONTINUE; }
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Rolnaaba
Veteran Member
Join Date: May 2006
Old 06-05-2006 , 10:13  
Reply With Quote #3

if I said:
Code:
 new attacked attacked = read_data(1) client_print(attacked, print_chat, "You got attacked")
that would make the message go onto the person how got attacked right?
also putting:
Code:
new bool:gotattacked[33] new attacked attacked = read_data(1) gotattacked[attacked] = true
would set gotattacked true on the person getting shot right?
__________________
DO NOT PM me about avp mod.
Rolnaaba is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 06-06-2006 , 05:12  
Reply With Quote #4

No, that wouldn't work. Look at my code again, I updated it.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Rolnaaba
Veteran Member
Join Date: May 2006
Old 06-10-2006 , 11:10  
Reply With Quote #5

ahh ok now I understand thank you very much
__________________
DO NOT PM me about avp mod.
Rolnaaba 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 16:22.


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