Raised This Month: $ Target: $400
 0% 

#include <cstrike> problem.


Post New Thread Reply   
 
Thread Tools Display Modes
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 09-07-2011 , 13:22   Re: #include <cstrike> problem.
Reply With Quote #21

if (!user_is_alive(id)) , no need to check if they are connected. If they are dead/alive, they are already connected.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
andre neves
Junior Member
Join Date: Mar 2011
Old 09-07-2011 , 15:08   Re: #include <cstrike> problem.
Reply With Quote #22

test this:
PHP Code:
public respawn(id)
{
    if (
is_user_admin(id))
    {
        new 
menu menu_create("\rRespawn:""respawn_handler")
        
menu_additem(menu"Respawn Everyone!""1"ADMIN_KICK)
        
menu_additem(menu"Respawn Terrorists!""2"ADMIN_KICK)
        
menu_additem(menu"Respawn Counter-Terrorists!""3"ADMIN_KICK)
        
menu_setprop(menuMPROP_EXITMEXIT_ALL)
        
menu_display(idmenu0)
    }
}

public 
respawn_handler(idmenuitem)
{
    new 
iiMaxPlayers get_maxplayers()
    if (
is_user_admin(id))
    {
        switch(
item)
        {
            case 
0:
            {
                
ColorChat(0TEAM_COLOR"^x04[^x03Respawn^x04]^x01 Everyone has been^x03 respawned.")
            }
            case 
1:
            {
                
ColorChat(0TEAM_COLOR"^x04[^x03Respawn^x04]^x01 The Terrprists has been^x03 respawned.")
            }
            case 
2:
            {
                
ColorChat(0TEAM_COLOR"^x04[^x03Respawn^x04]^x01 The Counter-Terrorists has been^x03 respawned.")
            }
        }
        
        for(
i=1i<= iMaxPlayersi++)
        {
            if(!
is_user_connected(i) || is_user_alive(i))
                continue
            switch(
item)
            {
                case 
0:
                {
                    
ExecuteHamB(Ham_CS_RoundRespawni)
                }
                case 
1:
                {
                    if (
get_user_team(i) == 1)
                    {
                        
ExecuteHamB(Ham_CS_RoundRespawni)
                    }
                }
                case 
2:
                {
                    if (
get_user_team(i) == 2)
                    {
                        
ExecuteHamB(Ham_CS_RoundRespawni)
                    }
                }
            }
        }
        
    }
    return 
PLUGIN_HANDLED


Last edited by andre neves; 09-07-2011 at 15:13. Reason: correcting error in post
andre neves is offline
reinert
Veteran Member
Join Date: Feb 2007
Old 09-08-2011 , 05:12   Re: #include <cstrike> problem.
Reply With Quote #23

Quote:
Originally Posted by ConnorMcLeod View Post
This is completely false.
So how to get the number of players playing ?

Like this ?:
PHP Code:
for(new ii<MaxPlayersi++)
{
if(!
is_user_connected(i))
continue;
}

if(
5)
{
//there are less than 5 players playing

Could someone create a stock with which I could check the count of players playing right now.

Last edited by reinert; 09-08-2011 at 05:15.
reinert is offline
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 09-08-2011 , 05:31   Re: #include <cstrike> problem.
Reply With Quote #24

Quote:
Originally Posted by reinert View Post
So how to get the number of players playing ?

Like this ?:
PHP Code:
for(new ii<MaxPlayersi++)
{
if(!
is_user_connected(i))
continue;
}

if(
5)
{
//there are less than 5 players playing

Could someone create a stock with which I could check the count of players playing right now.
No! It nots like that, if you dont know scripting then dont teach others!
Code:
GetConnectedCount() {     new iNum, id         for (id = 1; id <= g_iMaxPlayers; id++)     {         if (is_user_connected(id))             iNum++     }         return iNum; } // Usage new player_count = GetConnectedCount() if (player_count > 5) your_function()
You can cache is_user_connected to make this more effecient.
__________________

My Plugins For ZP

Inactive due to College and Studies

Last edited by abdul-rehman; 09-08-2011 at 05:36.
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
reinert
Veteran Member
Join Date: Feb 2007
Old 09-08-2011 , 05:40   Re: #include <cstrike> problem.
Reply With Quote #25

Well, I'm asking how to do this. I'm not teaching anyone thank you sir

also, is this right for saving SQLx information for every player in server ?
PHP Code:
    new Players[32]
    new 
playerCountiplayer
    get_players
(PlayersplayerCount"a")
    for (
i=0i<playerCounti++)
    {
        
player Players[i]
        
Save_MySql(player)
    } 

Last edited by reinert; 09-08-2011 at 05:47.
reinert is offline
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 09-08-2011 , 06:55   Re: #include <cstrike> problem.
Reply With Quote #26

Quote:
Originally Posted by reinert View Post
Well, I'm asking how to do this. I'm not teaching anyone thank you sir

also, is this right for saving SQLx information for every player in server ?
PHP Code:
    new Players[32]
    new 
playerCountiplayer
    get_players
(PlayersplayerCount"a")
    for (
i=0i<playerCounti++)
    {
        
player Players[i]
        
Save_MySql(player)
    } 
Yes, it would work.
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
Xellath
Veteran Member
Join Date: Dec 2007
Location: Sweden
Old 09-08-2011 , 07:13   Re: #include <cstrike> problem.
Reply With Quote #27

Quote:
Originally Posted by reinert View Post
Well, I'm asking how to do this. I'm not teaching anyone thank you sir

also, is this right for saving SQLx information for every player in server ?
PHP Code:
    new Players[32]
    new 
playerCountiplayer
    get_players
(PlayersplayerCount"a")
    for (
i=0i<playerCounti++)
    {
        
player Players[i]
        
Save_MySql(player)
    } 
Quote:
Originally Posted by abdul-rehman View Post
Yes, it would work.
It will not save for every player in the server. Only players that are alive.
Xellath is offline
reinert
Veteran Member
Join Date: Feb 2007
Old 09-08-2011 , 07:20   Re: #include <cstrike> problem.
Reply With Quote #28

oh yeah I forgot to change flags to ch. But it's correct yeah ?
reinert is offline
Xellath
Veteran Member
Join Date: Dec 2007
Location: Sweden
Old 09-08-2011 , 07:28   Re: #include <cstrike> problem.
Reply With Quote #29

You should try it yourself, but yes, it's correct.
Xellath is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 09-15-2011 , 11:39   Re: #include <cstrike> problem.
Reply With Quote #30

Can someone help me? The cstrike isn't working yet and i checked my modules.ini and activated cstrike but it doesn't work..
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
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 09:44.


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