Raised This Month: $51 Target: $400
 12% 

How to run command every time who joins to CT?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Fastmancz
Senior Member
Join Date: Jul 2013
Location: Czech Republic
Old 01-23-2015 , 15:25   How to run command every time who joins to CT?
Reply With Quote #1

Hi Guys,

How to run my command every time who joins to CT?
Example: sm_test (How to run every time who joins to CT)?

Thanks for reply.
Fastmancz is offline
Potato Uno
Veteran Member
Join Date: Jan 2014
Location: Atlanta, Georgia
Old 01-23-2015 , 15:46   Re: How to run command every time who joins to CT?
Reply With Quote #2

You may want this function:

https://sm.alliedmods.net/api/index....d=show&id=389&

[it's a forward]

and this function:

https://sm.alliedmods.net/api/index....d=show&id=411&
Potato Uno is offline
Fastmancz
Senior Member
Join Date: Jul 2013
Location: Czech Republic
Old 01-23-2015 , 16:14   Re: How to run command every time who joins to CT?
Reply With Quote #3

Quote:
Originally Posted by Potato Uno View Post
Yes, but i have:
PHP Code:
public Action:test(clientargs)
{
      if (
GetClientTeam(client) == CS_TEAM_CT)
      {
        new 
String:Error[70]; 
Hmm.. How to run every time who joins to CT? Public Actions not good idea.
Fastmancz is offline
Oshizu
Veteran Member
Join Date: Nov 2012
Location: Warsaw
Old 01-23-2015 , 19:27   Re: How to run command every time who joins to CT?
Reply With Quote #4

Quote:
Originally Posted by Fastmancz View Post
Yes, but i have:
PHP Code:
public Action:test(clientargs)
{
      if (
GetClientTeam(client) == CS_TEAM_CT)
      {
        new 
String:Error[70]; 
Hmm.. How to run every time who joins to CT? Public Actions not good idea.
Something like this perhaps?:
PHP Code:
public OnPluginStart()
{
    
HookEvent("player_team"Event_PlayerTeamEventHookMode_Pre);
}

public 
Action:Event_PlayerTeam(Handle:hEvent, const String:strName[], bool:bDontBroadcast

    new 
client GetClientOfUserId(GetEventInt(hEvent"userid")); 
    new 
team GetEventInt(hEvent"team"); 
    if(
team == CS_TEAM_CT)
    {
    
    }
    
    return 
Plugin_Continue;

__________________
...
Oshizu 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 14:06.


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