Raised This Month: $32 Target: $400
 8% 

[Help] Switch player To T/Ct


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Zaidbt
Senior Member
Join Date: Jun 2014
Location: Morroco
Old 04-03-2015 , 07:03   [Help] Switch player To T/Ct
Reply With Quote #1

Hi ,
PHP Code:
/* Script generated by Pawn Studio */

#include <amxmodx>
#include <amxmisc>
#include 

#define PLUGIN    "New Plugin"
#define AUTHOR    "Unknown"
#define VERSION    "1.0"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
        
register_logevent("mod"2"1=Round_Start")
    
}
public 
mod()
{
set_task(2.0"randommod")
}
public 
randommod(id)

    switch(
random_num(02))
    {
        case 
0:
        {
        
client_printidprint_chat" mod1" );
        new 
players[32], count;     
    
get_players(playerscount"a");     

    if(
count)               
    { 
        new 
iPlayer players[random(count)]; 
         
        new 
Name[32]; 
        
get_user_name(iPlayerNamecharsmax(Name)) 
        
set_user_health(iPlayerget_user_health(iPlayer) + 25); 
         
        
    } 
        }
        
        case 
1:
        {
            
client_printidprint_chat" mod2" );
            
        new 
players[32], count;     
    
get_players(playerscount"a");     

    if(
count)               
    { 
        new 
iPlayer players[random(count)]; 
         
        new 
Name[32]; 
        
get_user_name(iPlayerNamecharsmax(Name)) 
        
set_user_health(iPlayerget_user_health(iPlayer) - 99); 
         
        
    } 
        }
        case 
2:
        
client_printidprint_chat" Nothing happened" );
    
}    

How To switch this player to T , And all the others to Ct ( Case 0 ) ? ty
__________________
http://steamcommunity.com/profiles/76561198044821965
=========Working On Naruto Mod========
Zaidbt is offline
Shiina.Mashiro
Senior Member
Join Date: Sep 2014
Location: Vietnam
Old 04-03-2015 , 10:18   Re: [Help] Switch player To T/Ct
Reply With Quote #2

PHP Code:
new player[32], num
get_players
(playernum"ac")
new 
randomplayer player[random(num)]
for(new 
inumi++)
{
     
set_user_team(player[i], 1)
}
set_user_team(randomplayer2
__________________
Shiina.Mashiro is offline
~Ice*shOt
Veteran Member
Join Date: Mar 2009
Location: Lithuania
Old 04-03-2015 , 14:21   Re: [Help] Switch player To T/Ct
Reply With Quote #3

I don't think that there is something like set_user_team() I have heard only cs_set_user_team() so:

PHP Code:
new player[32], num
get_players
(playernum"ac")
new 
randomplayer player[random(num)]
for(new 
inumi++)
{
     
cs_set_user_team(player[i], CS_TEAM_T)
}
cs_set_user_team(randomplayerCS_TEAM_CT

Last edited by ~Ice*shOt; 04-03-2015 at 14:21.
~Ice*shOt is offline
Send a message via Skype™ to ~Ice*shOt
Zaidbt
Senior Member
Join Date: Jun 2014
Location: Morroco
Old 04-03-2015 , 17:22   Re: [Help] Switch player To T/Ct
Reply With Quote #4

Ty
__________________
http://steamcommunity.com/profiles/76561198044821965
=========Working On Naruto Mod========

Last edited by Zaidbt; 04-03-2015 at 17:45.
Zaidbt is offline
Shiina.Mashiro
Senior Member
Join Date: Sep 2014
Location: Vietnam
Old 04-04-2015 , 01:30   Re: [Help] Switch player To T/Ct
Reply With Quote #5

@Iceshot:
ah sorry my bad, I thought is was get_user_team xD
__________________
Shiina.Mashiro is offline
Reply


Thread Tools
Display Modes

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:52.


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