test.sp

mail@pastecode.io avatar
unknown
php
2 years ago
943 B
5
Indexable
Never
#pragma semicolon 1
#pragma newdecls required

#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#include <multicolors>
#define PLUGIN_VERSION "1.0"

public Plugin myinfo =
{
	name = "test",
	version = PLUGIN_VERSION,
	description = "test",
	author = "test",
	url = "https://forums.alliedmods.net"
}

public void OnPluginStart()
{
	LoadTranslations("test.phrases");

	RegConsoleCmd("sm_test", Cmd_test);
}

public Action Cmd_test(int client, int args)
{
	// 只有這位玩家能看到訊息,對象只有一位,使用%T
	CPrintToChat(client, "你會看到的語言為 %T", "TEST_1", client);

	// 全體玩家能看到訊息,對象有包含兩位以上,使用%t
	CPrintToChatAll("你會看到的語言為 %t", "TEST_1");


	CPrintToChat(client, "%T", "TEST_2", client, client, "ABCD", 123, 2.56);
	CPrintToChatAll("%t", "TEST_2", client, "ABCD", 123, 2.56);

	return Plugin_Handled;
}