AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Motd help (https://forums.alliedmods.net/showthread.php?t=188246)

Artifact 06-24-2012 06:07

Motd help
 
How to put something in motd when I write this in plugin_init?
sorry for english, here is example
PHP Code:

plugin_init()
{
register_clcmd("test""wow")
new 
Someeeething[][] {
"something1",
"something2",
"something3"
}
}

public 
wow(id)
{
show_motd(id,.....)


And I dont know how to include this 3 something in motd when someone type test

hornet 06-24-2012 07:13

Re: Motd help
 
Code:

register_clcmd("test", "wow")
->

Code:

register_clcmd("say test", "wow")
show_motd()

Also what are you trying to do with the line - new Someeeething[][]

pokemonmaster 06-24-2012 09:59

Re: Motd help
 
Quote:

Originally Posted by Artifact (Post 1735005)
How to put something in motd when I write this in plugin_init?
sorry for english, here is example
PHP Code:

plugin_init()
{
register_clcmd("test""wow")
new 
Someeeething[][] {
"something1",
"something2",
"something3"
}
}

public 
wow(id)
{
show_motd(id,.....)


And I dont know how to include this 3 something in motd when someone type test

I'm not sure about this, as I never tried the motd....
anyway I will give it a shot:
Code:
new Someeeething[][] = { "something1", "something2", "something3" } public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_clcmd("say test", "wow") } public wow(id) {     new xD[128]     format(xD, charsmax(xD), "%s %s %s", Someeeething[0], Someeeething[1], Someeeething[2])      // Fixed thanks to <Veco>     show_motd(id, xD, "TEST") }
EDIT: I's not working, it only shows two characters.
EDIT2: Fixed, thanks to <Veco>!

Aooka 06-24-2012 10:07

Re: Motd help
 
Code:
register_clcmd("test", "wow")

->

Code:
register_clcmd("say test", "wow")
or
Code:
register_clcmd("say_team test", "wow")

hornet 06-24-2012 10:11

Re: Motd help
 
Quote:

Originally Posted by Aooka (Post 1735135)
Code:
register_clcmd("test", "wow")

->

Code:
register_clcmd("say test", "wow")
or
Code:
register_clcmd("say_team test", "wow")

Yes, thanks for the echo ;) say team not really necessary for testing purposes.

pokemonmaster 06-24-2012 10:15

Re: Motd help
 
People! He want to put the Someeeething[][] stings from [0] to [2] and then put it in the motd!
My method didn't work, but it was worth to try.

Aooka 06-24-2012 10:17

Re: Motd help
 
@Hornet: yes but it's to show him we can do that too :D

<VeCo> 06-24-2012 10:21

Re: Motd help
 
charsmax(xD)

hornet 06-24-2012 10:30

Re: Motd help
 
Quote:

Originally Posted by pokemonmaster (Post 1735126)
EDIT: I's not working, it only shows two characters.
EDIT2: Fixed, thanks to <Veco>!

Yes, you must specify the size of the output array.

Artifact 06-24-2012 18:40

Re: Motd help
 
Quote:

Originally Posted by hornet (Post 1735045)
Code:

register_clcmd("test", "wow")
->

Code:

register_clcmd("say test", "wow")


Also what are you trying to do with the line - new Someeeething[][]

Wow, look, wait, guys, I dont know what is now with this forum, I dont need to someone type in chat, ok, I know how to do that, I just need to plugin add all of this ''something'' in motd, and when I want to edit plugin, or to add more ''something''s, plugin refresh motd and write new things...

Whatever I want something like swear filter plugin, when someone type /swear in chat plugin gives him motd with all unallowed words. I want something like this..


All times are GMT -4. The time now is 06:07.

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