AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Plugin Generated MOTD (https://forums.alliedmods.net/showthread.php?t=121280)

Dizzy 03-13-2010 20:01

Plugin Generated MOTD
 
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 =/

wrecked_ 03-13-2010 20:17

Re: Plugin Generated MOTD
 
Well, you could make the plugin create the actual MOTD on its own, and not require people to download the MOTD separately.

Dizzy 03-13-2010 20:33

Re: Plugin Generated MOTD
 
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..

fysiks 03-13-2010 20:59

Re: Plugin Generated MOTD
 
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.

Dizzy 03-13-2010 21:13

Re: Plugin Generated MOTD
 
ugh.. why is it all of the sudden it works when I recompile.. lmao


All times are GMT -4. The time now is 08:43.

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