Syncope.T-*
Published 2011. 12. 8. 20:20
[11] 팀 제한 예제 Steam/Sourcemod
728x90



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

public OnPluginStart()
{
 HookEvent("player_team", EventTeam);
 HookEvent("player_death",EventDeath);
}

public Action:EventTeam(Handle:Event, const String:Name[], bool:Broadcast)
{
 new Client = GetClientOfUserId(GetEventInt(Event, "userid"));
 new Team = GetEventInt(Event, "team");

 if(Team == 2)
 {
  if(GetTeamClientCount(2) >= 2)
  {
   CS_SwitchTeam(Client, 1)
   PrintToChat(Client, "\x04[Melong]\x03 T가 꽉 찼습니다.");
  }
 }
}
public Action:EventDeath(Handle:event,const String:name[],bool:dontBroadcast)
{
 new client = GetClientOfUserId(GetEventInt(event,"userid"));

 new attackerId = GetEventInt(event, "attacker");
 new attacker = GetClientOfUserId(attackerId);

 if (client != 0 && attacker != 0)
 {
  if (GetClientTeam(client) == 2)
  {
   new tplayers = GetTeamClientCount(2);
   if (tplayers == 1)
   {
    CS_SwitchTeam(client, 3)
    CS_SwitchTeam(attacker, 2)
   }
  }
 }
}

profile

Syncope.T-*

@Syncope

포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!

profile on loading

Loading...