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

How to detect


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
vermillioN25
Member
Join Date: Apr 2009
Location: Brazil
Old 08-14-2009 , 14:09   How to detect
Reply With Quote #1

How do I detect if have a Last T alive?

This is for Last Request system, for JailBreak.
__________________
vermillioN25 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-14-2009 , 14:20   Re: How to detect
Reply With Quote #2

Open miscstats.sma and look how it is coded.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
VMAN
Senior Member
Join Date: Oct 2007
Location: California, US
Old 08-14-2009 , 18:55   Re: How to detect
Reply With Quote #3

The method I used probably isn't the best, but I used get_players and looped through alive T's and counted them. If it was 1 T, it would compare the ID with the person who typed the command.

Hope this helps
VMAN is offline
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 08-14-2009 , 19:14   Re: How to detect
Reply With Quote #4

PHP Code:
new iPlayers[32], iT
get_players
(iPlayersiT"ae""TERRORIST")
if(
iT == 1)
{
        
//...
 

__________________
alan_el_more is offline
Jon
Veteran Member
Join Date: Dec 2007
Old 08-14-2009 , 19:14   Re: How to detect
Reply With Quote #5

Quote:
Originally Posted by VMAN View Post
The method I used probably isn't the best, but I used get_players and looped through alive T's and counted them. If it was 1 T, it would compare the ID with the person who typed the command.

Hope this helps
Why not use the flags and only retrive alive terrorists and check if the num is 1?

PHP Code:
// hns.sma
new iPlayers32 ], iNum;
get_playersiPlayersiNum"ae""TERRORIST" );
            
if( 
iNum == )
{
    
// ....

Jon is offline
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 08-14-2009 , 19:15   Re: How to detect
Reply With Quote #6

First hahaha
__________________
alan_el_more is offline
VMAN
Senior Member
Join Date: Oct 2007
Location: California, US
Old 08-14-2009 , 19:36   Re: How to detect
Reply With Quote #7

@Jon: The way you showed is how I do it
VMAN is offline
Bad_Bud
Senior Member
Join Date: Oct 2006
Location: The internet
Old 08-14-2009 , 20:49   Re: How to detect
Reply With Quote #8

You could call a function on each player death that subtracts from a total team players number for terrorists, then you'd know immediately when only one is left..?

Assuming they can't join in the middle of a round.
__________________
Bad_Bud 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 22:40.


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