AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   survivor @ roudend. (https://forums.alliedmods.net/showthread.php?t=106439)

One 10-15-2009 05:04

survivor @ roudend.
 
http://forums.alliedmods.net/search....archid=4601817

before you say SEARCH see the link.

how to get the round survivor?

xPaw 10-15-2009 05:43

Re: survivor @ roudend.
 
What?

One 10-15-2009 05:57

Re: survivor @ roudend.
 
i want to know who survived the round.
& print :

%s has survived the round!

xPaw 10-15-2009 05:59

Re: survivor @ roudend.
 
Who you mean under survivor

One 10-15-2009 06:17

Re: survivor @ roudend.
 
which players are alive & not dead. do i have to just check which players are alive @ roundend or is there a better way to do this?

minimiller 10-15-2009 10:36

Re: survivor @ roudend.
 
the way i would do it would be to hook round end, create a loop though to get_playersnum(), and check is_user_alive()

allthough there might be more than 1 survivor so it could cause a few problems

One 10-15-2009 10:52

Re: survivor @ roudend.
 
i had the same idea but how you say, this can be a mini problem.

i want to check survivor/s @ round end and set 1 T to ct for new round ( if there are < 10 players) or set 2 Ts to CT when there are more then 10 players.

thats what i wanted to do :

PHP Code:

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_logevent("round_end"2"1=Round_End")
}
public 
round_end()
{
    new 
survived_players
    
new p_playernum;
    
p_playernum get_playersnum(1);
    
    for ( new 
iiNumi++ )
    {
        if(
is_user_alive(i))
        {
            
survived_players++
        }
    }
    if(
survived_players >= && p_playernum 10)
    {
        
//set 1 T to CT
    
}
    else if(
survived_players >= && p_playernum 10)
    {
        
//set 2 T's to CT
    
}


i think this code is correct but i want to know if is there a better way to do this or not? :P or maybe is my code not correct ?

grimvh2 10-15-2009 12:54

Re: survivor @ roudend.
 
You used magic to create iNum?

PHP Code:

new players[32], pnumplayer;
get_players(playerspnum);

for( new 
ii<pnumi++ )
{
    
player players[i]
    
// then do ur stuff



xPaw 10-15-2009 12:58

Re: survivor @ roudend.
 
PHP Code:

new iPlayers32 ], iSurvivedPlayers;
get_playersiPlayersiSurvivedPlayers"a" );

// iSurvivedPlayers = alive count 


grimvh2 10-15-2009 13:02

Re: survivor @ roudend.
 
Quote:

Originally Posted by xPaw (Post 962859)
PHP Code:

new iPlayers32 ], iSurvivedPlayers;
get_playersiPlayersiSurvivedPlayers"a" );

// iSurvivedPlayers = alive count 


he only wants terror survivors

PHP Code:

new iPlayers32 ], iSurvivedPlayers
get_playersiPlayersiSurvivedPlayers"ae""TERRORIST"); 

// iSurvivedPlayers = alive count (terrorists) 



All times are GMT -4. The time now is 22:43.

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