AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   Coinflip (https://forums.alliedmods.net/showthread.php?t=291737)

KennYSwe 12-19-2016 18:10

Coinflip
 
6 Attachment(s)
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(clientargs)
{
    if (
warden_iswarden(client) == CanUseCommand)
    
      switch(
GetRandomInt(12)) 
    { 
        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.:)


All times are GMT -4. The time now is 17:42.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.