forum.hrvatski-hosting.com
Gameserveri => Counter Strike Source & Ostale Half Life 2 Igre => Topic started by: antrax_RTF on May 06, 2012, 04:27:34 PM
-
Treba mi code za sourcemod kada neki igrac ude da mu pise poruka , ne plugin nego code
-
Hm zašto ?. imaš 2 plugina welcome message, uzmi njihov kod ako već hoćeš ;).
Prvi (https://forums.alliedmods.net/showthread.php?p=880791)
Drugi (https://forums.alliedmods.net/showthread.php?p=1184461)
EDIT: ili ako hoćeš pojednostavljeni evo ti, malo sam zahrđao potom što nisam dugo radio plugin.
#include <sourcemod>
#include <sdktools>
#define PLUGIN_VERSION "1.0"
public Plugin:myinfo =
{
name = "Welcome Message",
author = "Pijanista [CRO]",
description = "ništa posebno",
version = PLUGIN_VERSION,
url = "http://rebirthofbalkan.com"
};
public OnPluginStart()
{
HookEvent("round_start", GameStart);
}
new WelcomeMessage = 1; // Change to 0 to disable welcome message (Not Recommended)
new RoundMessage = 1; // Change to 0 to disable reminder messages each round
public OnClientPostAdminCheck(client)
{
if (WelcomeMessage == 1)
{
PrintToChat(client, "\x03 TEXT Linija 1 \x03");
PrintToChat(client, "\x03 TEXT LINIJA 2 \x03");
}
}
public Action:GameStart(Handle:Event, const String:Name[], bool:Broadcast)
{
if (RoundMessage == 1)
{
PrintToChatAll("\x03 TEXT SVAKE RUNDE \x03");
}
}
Ako ćeš ovo koristiti, molio bi te da nemičeš ovo.
#include <sourcemod>
#include <sdktools>
#define PLUGIN_VERSION "1.0"
public Plugin:myinfo =
{
name = "Welcome Message",
author = "Pijanista [CRO]",
description = "ništa posebno",
version = PLUGIN_VERSION,
url = "http://rebirthofbalkan.com"
};
-
Meni treba code radim jedan plugin pa neznam treba mi code za kada se ude da prikaze poruku
-
kako radiš plugin, ako neznaš sam to napraviti ?, code imaš gore.
-
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#define PLUGIN_VERSION "3.0.0"
public Plugin:myinfo = {
name = "Stop Spamming Commands",
author = "antrax_RTF",
description = "Block Spamming Commands",
version = PLUGIN_VERSION,
url = "itd"
};
new lastUsedTime[MAXPLAYERS + 1];
public OnPluginStart() {
RegConsoleCmd("status", Command_Status);
RegConsoleCmd("ping", Command_Status);
RegConsoleCmd("heartbeat", Command_Status);
RegConsoleCmd("groundlist", Command_Status);
RegConsoleCmd("es_version", Command_Status);
HookEvent("round_start", GameStart);
}
new WelcomeMessage = 1; // Change to 0 to disable welcome message (Not Recommended)
new RoundMessage = 1; // Change to 0 to disable reminder messages each round
public Action:Command_Status(client, args) {
if(lastUsedTime[client] > GetTime() - 10) {
return Plugin_Handled;
}
lastUsedTime[client] = GetTime();
return Plugin_Continue;
}
public OnClientPostAdminCheck(client)
{
if (WelcomeMessage == 1)
{
PrintToChat(client, "\x03 TEXT Linija 1 \x03");
PrintToChat(client, "\x03 TEXT LINIJA 2 \x03");
}
}
public Action:GameStart(Handle:Event, const String:Name[], bool:Broadcast)
{
if (RoundMessage == 1)
{
PrintToChatAll("\x03 TEXT SVAKE RUNDE \x03");
}
}