AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Solved If there are ct in game, apply commands (https://forums.alliedmods.net/showthread.php?t=310466)

Enes05 09-04-2018 17:23

If there are ct in game, apply commands
 
Hello there...

I have a question :oops:

I am developing a plugin for jb.

But,
If there are commands in the game I need an implementation of ct.
How do I do this?

Please help.

I have an code:
PHP Code:

#include <cstrike> 

for (int i 1<= MaxClientsi++) { 
    if (
IsClientInGame(i) && IsPlayerAlive(i) && GetClientTeam(i) == CS_TEAM_CT) { 
        
//do stuff 
    



is it true that this code?

Neuro Toxin 09-04-2018 18:52

Re: If there are ct in game, apply commands
 
Code:

#include <cstrike>

public void OnPluginStart()
{
        RegConsoleCmd("sm_test", OnTestCommand);
}
 
public Action OnTestCommand(int client, int args)
{
        // Skip dead players
        if (!IsPlayerAlive(client))
                return Plugin_Handled;

        // Skip players not on CS_TEAM_CT
        if (GetClientTeam(client) != CS_TEAM_CT)
                return Plugin_Handled;

        PrintToChat(client, "sm_test triggered by CT");
        return Plugin_Handled;
}


Enes05 09-05-2018 08:02

Re: If there are ct in game, apply commands
 
not command, only verification

Enes05 09-05-2018 09:21

Re: If there are ct in game, apply commands
 
I am fixed this plugin, thanks anyway


All times are GMT -4. The time now is 04:39.

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