AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   user will receive an msay after typing a command (https://forums.alliedmods.net/showthread.php?t=340438)

ehsank1768 11-18-2022 07:43

user will receive an msay after typing a command
 
hi i need a plugin that when someone types in chat !nsp or sm_nsp in console, an msay will appear for him only after 2.5 seconds when he typed it(sorry for my bad english)

ShadowSpecter 11-22-2022 09:10

Re: user will receive an msay after typing a command
 
Hi, if you have not yet been helped.... I can do it, what does the player have to type to show msay and what message would it send.

ehsank1768 12-22-2022 03:03

Re: user will receive an msay after typing a command
 
Hi first of all sorry for my late response i was more focused on college
When the player types !nsp or sm_nsp in console after 2.5 seconds a msay will pop up for him only saying that "Congratulations the Zip password is 2525"
I'll be happy if you can help with this

Lantejoula 12-31-2022 09:52

Re: user will receive an msay after typing a command
 
Quote:

Originally Posted by ehsank1768 (Post 2795705)
Hi first of all sorry for my late response i was more focused on college
When the player types !nsp or sm_nsp in console after 2.5 seconds a msay will pop up for him only saying that "Congratulations the Zip password is 2525"
I'll be happy if you can help with this

Add me on discord: Lantejoula#0064

Bacardi 12-31-2022 11:50

Re: user will receive an msay after typing a command
 
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;



replay_84 01-07-2023 04:56

Re: user will receive an msay after typing a command
 
Quote:

Originally Posted by Bacardi (Post 2796300)
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.


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

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