Raised This Month: $ Target: $400
 0% 

HELP Best way to do


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
GuskiS
Veteran Member
Join Date: Aug 2007
Location: Latvia
Old 06-25-2014 , 06:00   Re: HELP Best way to do
Reply With Quote #5

Quote:
Originally Posted by HamletEagle View Post
You want to know which duel is currently running ? Then, do it with a simple boolean.

PHP Code:
enum _eDuels
{
    
DUEL_NONE,
    
DUEL_SCOUT,
    
DUEL_KNIFE

}

new 
boolIsDuel eDuels 
When he choose knife duel:
PHP Code:
IsDuel DUEL_NONE   ] = false
IsDuel 
DUEL_SCOUT  ] = false
IsDuel 
DUEL_KNIFE  ] = true 
When he choose a scout duel:
PHP Code:
IsDuel DUEL_NONE   ] = false
IsDuel 
DUEL_SCOUT  ] = true
IsDuel 
DUEL_KNIFE  ] = false 
When a duel ends:
PHP Code:
IsDuel DUEL_NONE   ] = true
IsDuel 
DUEL_SCOUT  ] = false
IsDuel 
DUEL_KNIFE  ] = false 
When you give weapons or sth like this, just check which bool is true.

PHP Code:
if ( ! IsDuel DUEL_NONE ] ) {

    if ( 
IsDuel DUEL_SCOUT ] ) {
        
//we have a scout duel
        
        
    
}   
    
    if ( 
IsDuel DUEL_KNIFE ] ){
       
//we have a knife duel
    
    
    
}

I don't know what you want to do with duel_none, but based on your previous example, this is how you should do it, whatever it is.
Stupid and wrong.
PHP Code:
enum _eDuels
{
    
DUEL_NONE,
    
DUEL_SCOUT,
    
DUEL_KNIFE

}

new 
IsDuel;

// when you need, set duel
IsDuel DUEL_SCOUT;

// when you need, check duel
if(IsDuel == DUEL_SCOUT
__________________
Finished mods:
Trouble in Terrorist Town
MurderMod
The Hidden
Cowboys vs Indians
JailBreak Supreme
Survival Madness
GuskiS 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 21:07.


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