Quote:
Originally Posted by CrazyHackGUT
Space in the beginning required only for CS:GO. For normal games like CS:S or TF2, all color works without space.
|
Code:
#include <sourcemod>
#pragma semicolon 1
#pragma newdecls required
public Plugin myinfo =
{
name = "Spam",
author = "Doggg, AlliedModders Donator",
version = "1.1"
};
public void OnPluginStart()
{
RegConsoleCmd("sm_spam", Spam);
}
public Action Spam(int client, int args)
{
if(args > 0)
{
char camount[1];
GetCmdArg(2, camount, sizeof(camount));
int iamount = StringToInt(camount);
if(iamount > 0)
{
char ccolor[1];
GetCmdArg(1, ccolor, sizeof(ccolor));
if(StrEqual(ccolor,"r"))
{
for(int i; i <= iamount; i++) PrintToChatAll(" \x02Spam");
}
else if(StrEqual(ccolor,"g"))
{
for(int i; i <= iamount; i++) PrintToChatAll(" \x04Spam");
}
}
else
{
ReplyToCommand(client, "[SM] Please enter a normal number");
}
}
else
{
ReplyToCommand(client, "[SM] spam <color> <amount of times>");
}
}