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

Title: Code
Post 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
Title: Re: Code
Post by: -test- on May 06, 2012, 08:06:09 PM
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.
Code: [Select]
#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.
Code: [Select]
#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"
};
Title: Re: Code
Post by: antrax_RTF on May 06, 2012, 08:34:33 PM
Meni treba code radim jedan plugin pa neznam treba mi code za kada se ude da prikaze poruku
Title: Re: Code
Post by: -test- on May 06, 2012, 08:38:00 PM
kako radiš plugin, ako neznaš sam to napraviti ?, code imaš gore.
Title: Re: Code
Post by: -test- on May 06, 2012, 09:23:23 PM
Code: [Select]
#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");
}
}