Raised This Month: $32 Target: $400
 8% 

Plugin Generated MOTD


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dizzy
Veteran Member
Join Date: Jun 2004
Location: Massachusetts
Old 03-13-2010 , 20:01   Plugin Generated MOTD
Reply With Quote #1

Hey guys, just like the title states, wondering how to make a plugin create a MOTD pop up on it's own rather than having a separate file..

I've looked over some scripts and tried to put this together, some things to note in my script, it uses a for loop to print all strings in this array:

Code:
new const g_szWords[][] = {     "holyshit",     "lag",     "please",     "nfs",     "stfu",     "english",     "hugebitch",     "haha",     "who",     "hacks",     "fag" }

The registered clcmd goes to this display(id) function:

Code:
public display(id) {     new buffer[1024]     new len = copy(buffer, 1023, "Available Sounds:^n")     for (new i = 0; i < sizeof(g_szWords); i++)     {         len += copy(buffer[len], 1023-len, "^n")         len += copy(buffer[len], 1023-len, g_szWords[i])     }     show_motd(id,buffer ,"Type Sounds - By: Dizzy");         return PLUGIN_CONTINUE; }

However, not working =/
__________________
My Plugins

Purchase Mod - Stable
Type Sounds - Stable
Monster Spawner - Stable
Nade Giver - Maintenance
Dizzy is offline
Send a message via AIM to Dizzy
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 03-13-2010 , 20:17   Re: Plugin Generated MOTD
Reply With Quote #2

Well, you could make the plugin create the actual MOTD on its own, and not require people to download the MOTD separately.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
Dizzy
Veteran Member
Join Date: Jun 2004
Location: Massachusetts
Old 03-13-2010 , 20:33   Re: Plugin Generated MOTD
Reply With Quote #3

The idea is to have it update when the strings array is changed..

lets say that array is:
Code:
new const g_szWords[][] = {     "word one",     "word two",     "word three" }

when the command is typed it should display
Code:
Available Sounds:

word one
word two
word three
This is so that if someone wanted to add something to both the plugin and the MOTD, they wouldn't have to edit multiple files..
__________________
My Plugins

Purchase Mod - Stable
Type Sounds - Stable
Monster Spawner - Stable
Nade Giver - Maintenance
Dizzy is offline
Send a message via AIM to Dizzy
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-13-2010 , 20:59   Re: Plugin Generated MOTD
Reply With Quote #4

What doesn't work? Do you get anything in the MOTD?

My first thought was this: replace the first ^n with <br><br> and the second ^n with <br>.

But maybe this isn't needed.
__________________
fysiks is offline
Dizzy
Veteran Member
Join Date: Jun 2004
Location: Massachusetts
Old 03-13-2010 , 21:13   Re: Plugin Generated MOTD
Reply With Quote #5

ugh.. why is it all of the sudden it works when I recompile.. lmao
__________________
My Plugins

Purchase Mod - Stable
Type Sounds - Stable
Monster Spawner - Stable
Nade Giver - Maintenance

Last edited by Dizzy; 03-13-2010 at 21:16.
Dizzy is offline
Send a message via AIM to Dizzy
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 17:11.


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