AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   WTF is wrong with this 5-line code? (https://forums.alliedmods.net/showthread.php?t=125945)

fiendshard 05-03-2010 20:39

WTF is wrong with this 5-line code?
 
hello guys,

can somebody help about this small code-
idea is to constantly show name of the next map under radar:

Code:

#include <amxmodx>
#include <amxmisc>

public plugin_init()
        register_plugin("nextmapradar","1.0","author")
{
            new nextmap[31]
           
              format(message,255,"Nextmap: %s", nextmap)
                       
                set_hudmessage (255, 0, 0, 0.0, 0.14, 0, 6.0, -1)
                show_hudmessage(id, message)
}


Bugsy 05-03-2010 20:45

Re: WTF is wrong with this 5-line code?
 
There are not players yet in the server when plugin_init is called so this will never work.
Code:
#include <amxmodx> #include <amxmisc> public plugin_init() //This line has to be within the brackets     register_plugin("nextmapradar","1.0","author") {      new nextmap[31]      //message variable not defined and nextmap will always be empty          //You should also use formatex()      format(message,255,"Nextmap: %s", nextmap)                  set_hudmessage (255, 0, 0, 0.0, 0.14, 0, 6.0, -1)      //id is not defined      show_hudmessage(id, message) }

fiendshard 05-04-2010 05:39

Re: WTF is wrong with this 5-line code?
 
thank you guys


All times are GMT -4. The time now is 03:45.

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