View Single Post
replay_84
Senior Member
Join Date: Jun 2021
Old 01-07-2023 , 04:56   Re: user will receive an msay after typing a command
Reply With Quote #6

Quote:
Originally Posted by Bacardi View Post
PHP Code:
public void OnPluginStart()
{
    
RegConsoleCmd("sm_nsp"nsp);
}

public 
Action nsp(int clientint args)
{
    if(!
client || !IsClientInGame(client) || IsClientInKickQueue(client))
        return 
Plugin_Handled;

    
CreateTimer(2.5delayGetClientUserId(client));

    return 
Plugin_Handled;
}

public 
Action delay(Handle timerany data)
{
    
int client GetClientOfUserId(data);
    
    if(!
client || !IsClientInGame(client) || IsClientInKickQueue(client))
        return 
Plugin_Continue;

    
Panel mSayPanel = new Panel();
    
mSayPanel.SetTitle("Congratulations!");
    
mSayPanel.DrawItem(""ITEMDRAW_SPACER);
    
mSayPanel.DrawText("The Zip password is 2525");
    
mSayPanel.DrawItem(""ITEMDRAW_SPACER);
    
mSayPanel.CurrentKey GetMaxPageItems(mSayPanel.Style);
    
mSayPanel.DrawItem("Exit"ITEMDRAW_CONTROL);
    
mSayPanel.Send(clientHandler_DoNothing10);

    return 
Plugin_Continue;
}


public 
int Handler_DoNothing(Menu menuMenuAction actionint param1int param2)
{
    
/* Do nothing */
    
return 0;





Does exactly what he asked. Thanks for sharing. One question though, would it be possible to trigger these without the use of ! or sm_ . Wanted to trigger a message when someone types "maps" or "map" in their conversation it would print the link about download location in the chat area.

Last edited by replay_84; 01-07-2023 at 04:57.
replay_84 is offline