Raised This Month: $ Target: $400
 0% 

survivor @ roudend.


Post New Thread Reply   
 
Thread Tools Display Modes
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-15-2009 , 13:05   Re: survivor @ roudend.
Reply With Quote #11

Quote:
Originally Posted by grimvh2 View Post
he only wants terror survivors
I don't see him finding Terrorist survivors.

Quote:
Originally Posted by One View Post
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? or maybe is my code not correct ?
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 10-15-2009 , 13:10   Re: survivor @ roudend.
Reply With Quote #12

yea. just forgot to check it:
PHP Code:
for ( new iiNumi++ ) 
    { 
        if(
is_user_alive(i) && get_user_team(i) == CS_TEAM_T
        { 
so checked the team
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
tpt
Member
Join Date: Jun 2009
Location: Scripting help section
Old 10-15-2009 , 13:18   Re: survivor @ roudend.
Reply With Quote #13

Quote:
Originally Posted by grimvh2 View Post
he only wants terror survivors

PHP Code:
new iPlayers32 ], iSurvivedPlayers
get_playersiPlayersiSurvivedPlayers"ae""TERRORIST"); 

// iSurvivedPlayers = alive count (terrorists) 
I think it might be best to use only a flag and then check if team is terrorist.
tpt is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-15-2009 , 13:28   Re: survivor @ roudend.
Reply With Quote #14

Quote:
Originally Posted by tpt View Post
I think it might be best to use only a flag and then check if team is terrorist.
You think wrong, sir.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
vitorrd
Senior Member
Join Date: Jul 2009
Old 10-15-2009 , 14:17   Re: survivor @ roudend.
Reply With Quote #15

Quote:
Originally Posted by One View Post
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? or maybe is my code not correct ?
Get playersnum returns the amount of players connected and, if the flag 1 is specified, players connecting to the server (in your case you shouldn't use it anyway).
Your loop is wrong because it returns, as I said, the amount of players connected to the server, but the players connected are not those in the range of i (which is 0) to (iNum - 1). First, 0 is the specific identifier for "not an entity", second the players can have arbitrary IDs in the range of 1 to get_maxplayers(). get_players or a loop from 1 to get_maxplayes() (inclusive) are the only ways to list players.
vitorrd is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 10-15-2009 , 15:29   Re: survivor @ roudend.
Reply With Quote #16

i read you'r post around 10 times but sorry, i can't understand what you mean. can you please explain it what you exactly mean?
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 10-15-2009 , 15:31   Re: survivor @ roudend.
Reply With Quote #17

Quote:
Originally Posted by Exolent[jNr] View Post
I don't see him finding Terrorist survivors.
Ah , I misunderstood it then :p ( my english sucks )
__________________
I am out of order!
grimvh2 is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-15-2009 , 15:37   Re: survivor @ roudend.
Reply With Quote #18

Quote:
Originally Posted by One View Post
i read you'r post around 10 times but sorry, i can't understand what you mean. can you please explain it what you exactly mean?
He means you don't know how to find players.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 10-15-2009 , 15:40   Re: survivor @ roudend.
Reply With Quote #19

ok. but maybe anyone know it and maybe he can post how i do it
sorry this sounds maybe very easy but it's after rallymod my biggest mod which i write.
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-15-2009 , 15:43   Re: survivor @ roudend.
Reply With Quote #20

To get players... you can search for that.
There is no reason for someone to explain to you how to get a list of players.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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:43.


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