AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Coding MM:S Plugins & SM Extensions (https://forums.alliedmods.net/forumdisplay.php?f=75)
-   -   Say Commands (https://forums.alliedmods.net/showthread.php?t=37439)

Eichhoernchen 03-14-2005 18:24

Say Commands
 
I know how to notice if a player says something, but I want
that if a player says a specific word that something happens.
I got this now:

Code:

if (  FStrEq( pcmd, "say" ) )
        {
            IPlayerInfo* playerInfo;
            playerInfo = playerinfomanager->GetPlayerInfo(pEntity);
               
            KeyValues *kv = new KeyValues( "msg" );
            kv->SetString( "title",  playerInfo->GetName());
            kv->SetInt( "level", 1 );
            kv->SetInt( "time", 20 );
               
          helpers->CreateMessage( pEntity, DIALOG_MSG, kv, this );
          kv->deleteThis();
          return PLUGIN_STOP;
        }

I want that if a player says: "myname" that his name will be displayed in a messagebox.

This is just for understanding and lerning.
Maybe I'll write a rollthedice plugin.


All times are GMT -4. The time now is 20:32.

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