This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

[solved] detect press m or transfer team


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
indraraj striker
Veteran Member
Join Date: Mar 2014
Location: Under the water
Old 06-15-2015 , 03:51   [solved] detect press m or transfer team
Reply With Quote #1

i want to show him one msg
how can i detect players transfer to ct/ts/spec
__________________
Thanks everyone. #miss_you_all

Last edited by indraraj striker; 06-17-2015 at 03:54.
indraraj striker is offline
K1d0x
Senior Member
Join Date: Apr 2012
Location: Copenhagen, Denmark
Old 06-15-2015 , 04:24   Re: detect press m or transfer team
Reply With Quote #2

PHP Code:
#include <amxmodx>

#define PLUGIN "Team join info"
#define VERSION "1.0"
#define AUTHOR "AMXX Community"


public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_event"TeamInfo""join_team""a")
}


public 
join_team()
{    
    new 
id read_data(1)
    static 
user_team[32]
    
    
read_data(2user_team31)    
    
    if(!
is_user_connected(id))
        return 
PLUGIN_CONTINUE    
    
    
switch(user_team[0])
    {
        case 
'C':  
        {
            
// player join to ct's        
        
}
            
        case 
'T'
        {
            
// player join to terrorist
        
}
        
        
        case 
'S':  
        {
            
// player join to spectators
        
}
        
        
    }
    return 
PLUGIN_CONTINUE
    

__________________
I Hate people who can hate me !
K1d0x is offline
Send a message via Yahoo to K1d0x Send a message via Skype™ to K1d0x
indraraj striker
Veteran Member
Join Date: Mar 2014
Location: Under the water
Old 06-16-2015 , 00:02   Re: detect press m or transfer team
Reply With Quote #3

Now its showing two time msg
When he will join team and spawn on that team
i want show him msg only once after change team or join team

Server Print:
Quote:
[Test] Fluke are in ts
[Test] Fluke are in ts
PHP Code:
#include <amxmodx>

#define PLUGIN "Team join info" 
#define VERSION "1.0" 
#define AUTHOR "AMXX Community" 

public plugin_init()  

    
register_plugin(PLUGINVERSIONAUTHOR
    
register_event"TeamInfo""join_team""a"


public 
join_team() 
{     
    new 
id read_data(1
    static 
user_team[32
     
     new 
nick[32]
     
get_user_name(id,nick,31)
    
read_data(2user_team31)     
     
    if(!
is_user_connected(id)) 
        return 
PLUGIN_CONTINUE     
     
    
switch(user_team[0]) 
    { 
        case 
'C':   
        { 
            
client_print(id,print_chat,"[Test] %s are in cts",nick)
            
server_print("[Test] %s are in cts",nick)
        } 
             
        case 
'T':  
        { 
        
client_print(id,print_chat,"[Test] %s are in ts",nick)
        
server_print("[Test] %s are in ts",nick)
        } 
         
        case 
'S':   
        { 
        
client_print(id,print_chat,"[Test] %s are in spec",nick)
        
server_print("[Test] %s are in spec",nick)
        } 
         
         
    } 
    return 
PLUGIN_CONTINUE 

Attached Files
File Type: sma Get Plugin or Get Source (transfer.sma - 525 views - 1.1 KB)
__________________
Thanks everyone. #miss_you_all
indraraj striker is offline
xxxperts
Senior Member
Join Date: Oct 2013
Location: India
Old 06-16-2015 , 03:07   Re: detect press m or transfer team
Reply With Quote #4

i think you should check if user is alive before you show him message. but doing that will not work when player switch to spec.
__________________
All my work is here

Last edited by xxxperts; 06-16-2015 at 03:07.
xxxperts is offline
indraraj striker
Veteran Member
Join Date: Mar 2014
Location: Under the water
Old 06-16-2015 , 10:48   Re: detect press m or transfer team
Reply With Quote #5

^^ Current sma it will work for both case if user is alive or dead why should we need to check is user alive or dead ? that will prevent for two time msg ? i think no :p
__________________
Thanks everyone. #miss_you_all
indraraj striker is offline
Shiina.Mashiro
Senior Member
Join Date: Sep 2014
Location: Vietnam
Old 06-16-2015 , 12:17   Re: detect press m or transfer team
Reply With Quote #6

https://forums.alliedmods.net/showpo...21&postcount=3
try this.
__________________
Shiina.Mashiro is offline
indraraj striker
Veteran Member
Join Date: Mar 2014
Location: Under the water
Old 06-17-2015 , 03:54   Re: detect press m or transfer team
Reply With Quote #7

Quote:
Originally Posted by Shiina.Mashiro View Post
Thank you S.M.
Solved
__________________
Thanks everyone. #miss_you_all
indraraj striker 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 12:12.


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