發新話題
打印

Hello,死神又來了!

[Close]

Hello,死神又來了!

Hi,最近工作忙,又搞緊sourcemod 擴展鏈接庫,所以無乜時間,一上vlan,短消息一大堆。。。。請原諒我吾可以一一解決你地既問題。實在太忙,先隨便解決一個朋友既問題:(顯示誰打爆煙花盒源碼)

#pragma semicolon 1
#include <sourcemod>
#include <sdktools>

public Plugin:myinfo =
{
name    = "L4D2_MultiTips",
author    = "MicroLeo",
description  = "Multi Tips",
version   = "1.0",
url    = "N/A"
}

public OnPluginStart()
{
   HookEvent("break_prop", Event_BreakProp, EventHookMode_Pre);
}

public Action:Event_BreakProp(Handle:event, const String:name[], bool:dontBroadcast)
{
decl String:sTemp[42];
new entity = GetEventInt(event, "entindex");
new client = GetClientOfUserId(GetEventInt(event, "userid"));
GetEdictClassname(entity, sTemp, sizeof(sTemp));

if(IsValidClient(client))
  if( strcmp(sTemp, "prop_physics") == 0 && GetClientTeam(client)==2)
   if(IsFireworkcrate(entity))
    PrintToChatAll("\x04%N \x01發神經打爆煙花盒.拉出去槍斃十個鍾!",client);
}

bool:IsValidClient(client)
{
if(client>0&&client<=MaxClients)
  if(IsValidEntity(client))
   if(IsClientConnected(client))
    if(IsClientInGame(client))
     return true;
return false;
}

bool:IsFireworkcrate(entity)
{
if(IsValidEntity(entity))
{
  new String:EdictModelName[128];
  GetEntPropString( entity, Prop_Data, "m_ModelName", EdictModelName, sizeof( EdictModelName ) );
  if(StrEqual( EdictModelName, "models/props_junk/explosive_box001.mdl"))
   return true;
}
return false;
}

[ 本帖最後由 MicroLeo 於 2015-5-24 21:49 編輯 ]

TOP

點解你係死神呢 ?
唔通用左你呢個插件會有死神來了
不過都收下....參考語法....

TOP

引用:
原帖由 lovertony 於 2015-5-25 19:17 發表
點解你係死神呢 ?
唔通用左你呢個插件會有死神來了
不過都收下....參考語法....
Come on!God of dead.

TOP

發新話題