Raised This Month: $12 Target: $400
 3% 

user will receive an msay after typing a command


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ehsank1768
Member
Join Date: Aug 2022
Old 11-18-2022 , 07:43   user will receive an msay after typing a command
Reply With Quote #1

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)
ehsank1768 is offline
ShadowSpecter
Junior Member
Join Date: Oct 2021
Old 11-22-2022 , 09:10   Re: user will receive an msay after typing a command
Reply With Quote #2

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.
ShadowSpecter is offline
ehsank1768
Member
Join Date: Aug 2022
Old 12-22-2022 , 03:03   Re: user will receive an msay after typing a command
Reply With Quote #3

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
ehsank1768 is offline
Lantejoula
Senior Member
Join Date: Mar 2021
Location: Portugal
Old 12-31-2022 , 09:52   Re: user will receive an msay after typing a command
Reply With Quote #4

Quote:
Originally Posted by ehsank1768 View Post
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
__________________
Discord ➜ Lantejoula#0064 | Steam | Want Help? Add Me!!
Lantejoula is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 12-31-2022 , 11:50   Re: user will receive an msay after typing a command
Reply With Quote #5

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;

__________________
Do not Private Message @me
Bacardi is offline
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
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:59.


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