Raised This Month: $51 Target: $400
 12% 

How i get Event Vars


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
R4nd0mT!m3r
Junior Member
Join Date: Apr 2008
Old 04-22-2008 , 00:40   How i get Event Vars
Reply With Quote #1

how can i set a string,int or .... to like
PHP Code:
public <eventname> {
 new 
winner eventvar(winner)
 
PrintToServer(winner)

what must i do to set a eventvar?
R4nd0mT!m3r is offline
pRED*
Join Date: Dec 2006
Old 04-22-2008 , 02:06   Re: How i get Event Vars
Reply With Quote #2

Must resist temptation to abuse ES syntax...

http://wiki.alliedmods.net/Events_%2...d_Scripting%29
pRED* is offline
R4nd0mT!m3r
Junior Member
Join Date: Apr 2008
Old 04-22-2008 , 04:59   Re: How i get Event Vars
Reply With Quote #3

PHP Code:
public OnPluginStart()
{
    
HookEvent("round_end"round_endEventHookMode_PostNoCopy)
}
 
public 
round_end(Handle:event, const String:name[], bool:dontBroadcast)
{
    new: 
winner
    GetEventInt
(event"winner"winner)
    
PrintToServer("The Winnter is %s"winner)
    If(
winner == "2")
        
PrintToServer("CT's LOOOSE",)
    If(
GetEventInt(event"winner") == "3")
        
PrintToServer("CT's WIN!",)



work this?
R4nd0mT!m3r is offline
Nican
Veteran Member
Join Date: Jan 2006
Location: NY
Old 04-22-2008 , 10:33   Re: How i get Event Vars
Reply With Quote #4

PHP Code:
public OnPluginStart()
{
    
HookEvent("round_end"round_endEventHookMode_PostNoCopy);
}
 
public 
round_end(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
winner GetEventInt(event"winner");
    
    
PrintToServer("The Winnter is %d"winner);
    
    If(
winner == 2)
        
PrintToServer("CT's LOOOSE");
    If(
winner == 3)
        
PrintToServer("CT's WIN!");

__________________
http://www.nican132.com
I require reputation!

Last edited by Nican; 04-22-2008 at 10:35.
Nican is offline
Send a message via ICQ to Nican Send a message via MSN to Nican
R4nd0mT!m3r
Junior Member
Join Date: Apr 2008
Old 04-22-2008 , 16:22   Re: How i get Event Vars
Reply With Quote #5

Quote:
Originally Posted by Nican View Post
PHP Code:
public OnPluginStart()
{
    
HookEvent("round_end"round_endEventHookMode_PostNoCopy);
}
 
public 
round_end(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
winner GetEventInt(event"winner");
    
    
PrintToServer("The Winnter is %d"winner);
    
    If(
winner == 2)
        
PrintToServer("CT's LOOOSE");
    If(
winner == 3)
        
PrintToServer("CT's WIN!");

don't work
R4nd0mT!m3r is offline
pRED*
Join Date: Dec 2006
Old 04-22-2008 , 17:12   Re: How i get Event Vars
Reply With Quote #6

EventHookMode_Post
pRED* 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 06:59.


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