AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   Plugin to move all VIPs/Admins with flag "a" to T and everyone else to CT (https://forums.alliedmods.net/showthread.php?t=314297)

TrappaTroopa 02-12-2019 15:01

Plugin to move all VIPs/Admins with flag "a" to T and everyone else to CT
 
This plugin would need to have support for fluffyst's surftimer. It already has a convar to move everyone to CT or evenly split players to CT/T.

But I want a plugin to override this behavior and move all VIPs/Admins with flag "a" to T and everyone else to CT.

Thanks!

Pilo 02-14-2019 08:30

Re: Plugin to move all VIPs/Admins with flag "a" to T and everyone else to CT
 
2 Attachment(s)
You can try this :)
Commands :
sm_event (console)
/event (In chat)
!event (in chat)

Access : Only ADMFLAG_GENERIC, only admins..
Feel free to change anything you want to. :)
And tell me if it works to you ! :)

CliptonHeist 02-14-2019 16:52

Re: Plugin to move all VIPs/Admins with flag "a" to T and everyone else to CT
 
Fixed version
PHP Code:

#include <sourcemod>
#include <sdktools>
#include <cstrike>

#define PREFIX "[SM]"

public Plugin myinfo 
{
    
name "Admins T Clients CT",
    
author "Pilo",
    
description "Move all the normal players to CT and Admins/Vip's to T'",
    
version "1.0",
    
url "https://forums.gamers-israel.co.il/member.php?u=33"
};

public 
void OnPluginStart()
{    
    
RegAdminCmd("sm_event"Command_EventADMFLAG_GENERIC"");
}

public 
Action Command_Event (int clientint args)
{
    for (
int i 1<= MaxClientsi++)
    {
        if(!
IsValidClient(i)) continue;

        if (
CheckCommandAccess(i"sm_null_command"ADMFLAG_RESERVATIONtrue))
            
CS_SwitchTeam(iCS_TEAM_T)
        else
            
CS_SwitchTeam(iCS_TEAM_CT);
    }

    if(
IsValidClient(client))
        
PrintToChatAll("%s \x02%N \x01 moved all players to CT and Admins to T! \x05Have Fun! \x01"PREFIXclient);
    else
        
PrintToChatAll("%s Moved all players to CT and Admins to T! \x05Have Fun! \x01"PREFIX);

    return 
Plugin_Handled;
}

stock bool IsValidClient(int client)
{
    return 
IsClientInGame(client) &&
    !
IsFakeClient(client);




All times are GMT -4. The time now is 10:41.

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