Raised This Month: $ Target: $400
 0% 

Passing ID from event to event without execution of second event


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Rolnaaba
Veteran Member
Join Date: May 2006
Old 10-25-2006 , 10:09   Passing ID from event to event without execution of second event
Reply With Quote #1

how to pass an ID from one event to another without activating the second event at the time of passing so the event will be called normally?
e.i.:
Code:
#include <amxmodx> #include <amxmisc> public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_event("DeathMsg", "Death", "a")     register_event("HLTV", "event_new_round", "a", "1=0", "2=0") } public Death() {     new killer = read_data(2) } public event_new_round() {     //how to pass the ID variable "killer"     //to this func without activating it until     //it is called upon naturally? }
__________________
DO NOT PM me about avp mod.

Last edited by Rolnaaba; 10-25-2006 at 11:12.
Rolnaaba is offline
schnitzelmaker
Senior Member
Join Date: Apr 2006
Location: HERE
Old 10-25-2006 , 11:25   Re: Passing ID from event to event without execution of second event
Reply With Quote #2

A way is using a global variable as temp.This Plugin store the last killer for every player,until "event_new_round".
Code:
#include <amxmodx> #include <amxmisc> new tempkiller[33] public plugin_init() {      register_plugin(PLUGIN, VERSION, AUTHOR)      register_event("DeathMsg", "Death", "a")      register_event("HLTV", "event_new_round", "a", "1=0", "2=0") } public Death() {      new killer = read_data(2)      tempkiller[killer] = killer } public event_new_round() {      for(new i=0;i<=get_maxplayers();i++)      {           new killer = tempkiller[i]           tempkiller[i]=0           if(is_user_connected(i) && killer)           {               //do anything with killer           }      } }
__________________
schnitzelmaker is offline
Rolnaaba
Veteran Member
Join Date: May 2006
Old 10-25-2006 , 12:36   Re: Passing ID from event to event without execution of second event
Reply With Quote #3

wow thanks a lot man helped me out ;) +karma
__________________
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 04:55.


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