This is a coinflip plugin!
You type !coinflip in the chat and the coin will flip and either land on terrorist or counter terrorist.
It's 50/50% chance.
I also made one for
Eccas Warden plugin, so only the warden can flip the coin.
Everything is translatable, so you can edit it however you want it.
Put the .smx file in plugins and .txt file in translations
Commands: !coinflip
PHP Code:
public OnPluginStart()
{
RegConsoleCmd("sm_coinflip", OnFlip, "Flip the coin");
LoadTranslations("warden-coinflip.phrases")
}
public Action:OnFlip(client, args)
{
if (warden_iswarden(client) == CanUseCommand)
switch(GetRandomInt(1, 2))
{
case 1:
{
CPrintToChatAll("%t %t", "MSG_PREFIX", "Terrorist");
}
case 2:
{
CPrintToChatAll("%t %t", "MSG_PREFIX", "Counter Terrorist");
}
}
else
{
CPrintToChat(client, "%t %t", "MSG_PREFIX", "Only Warden");
}
return Plugin_Handled;
}
This is one of my first plugins, so give criticism.