AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Defining iPos (https://forums.alliedmods.net/showthread.php?t=29506)

Kensai 06-06-2006 23:23

Defining iPos
 
ookay, I'm tryin to put in a few motd in my menu.

I have this so far.

Code:
public DoHelp(id, key) {     if(get_cvar_num("sc_on") == 0)         return 1             new szMotd[1024]         if(key == 0)     {         iPos += format(szMotd[iPos], 1023-iPos, "<html></html>")     }     return 1 }

I keep getting a undefined symbol error. How are you supposed to do this.

OneEyed 06-06-2006 23:33

Code:

new iPos;

Kensai 06-06-2006 23:33

Lawl.

Xanimos 06-07-2006 00:47

See what happens when you take someone else's code...you have no clue what is going on.

Who did you take it from? I can only think of three that really use that naming pattern.

Kensai 06-07-2006 14:31

Yeah okay I didn't rip it from anyone.

I'm pretty it was OneEyed that told me to use something like this. In the IRC channel last night.

Hawk also helped, but he left aim, which was why I went into IRC for help.

Smokey485 06-07-2006 15:28

You should look at the compile error, unless your new, that is a easy error to fix, you shouldn't need help.

Kensai 06-07-2006 15:44

The only error was what was just answered. I know a nub question. but I wanted to make sure there wasn't some special way I had to do it.

My next question is why it doesn't show anything. I think its because I'm missing the show_motd ?

v3x 06-07-2006 16:20

Yeah, lol. You also need to put some text there ;)

Kensai 06-07-2006 16:24

Yeah. I just wanted to see if it would work.

show_motd(id, )

what do I put for "constant message")

Could I make several new szMotd[1024] and have them like 1,2,3,4,5,6,7 then use szMotd2 to show #2?

v3x 06-07-2006 16:30

Use a multi-dimensional array:
Code:
public DoHelp(id, key) {     if(get_cvar_num("sc_on") == 0)         return 1             new szMotd[1024][3], iPos         switch(key)     {         case 0: iPos += format(szMotd[iPos][0], 1023-iPos, "<html></html>")         case 1: iPos += format(szMotd[iPos][1], 1023-iPos, "<html></html>")         case 2: iPos += format(szMotd[iPos][2], 1023-iPos, "<html></html>")     }     return 1 }
For the message you would put szMotd[key] or w/e


All times are GMT -4. The time now is 16:27.

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