|
Senior Member
|
01-07-2023
, 04:56
Re: user will receive an msay after typing a command
|
#6
|
Quote:
Originally Posted by Bacardi
PHP Code:
public void OnPluginStart() { RegConsoleCmd("sm_nsp", nsp); }
public Action nsp(int client, int args) { if(!client || !IsClientInGame(client) || IsClientInKickQueue(client)) return Plugin_Handled;
CreateTimer(2.5, delay, GetClientUserId(client));
return Plugin_Handled; }
public Action delay(Handle timer, any 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(client, Handler_DoNothing, 10);
return Plugin_Continue; }
public int Handler_DoNothing(Menu menu, MenuAction action, int param1, int 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.
|
|
|
|