AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   hud message (https://forums.alliedmods.net/showthread.php?t=171255)

equin 11-03-2011 19:31

hud message
 
What's wrong with this plugin?
Code:

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "HUD"
#define VERSION "1.0"
#define AUTHOR "SATE"


public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)

// Add your code here...
}
if(is_user_anonymous ( id ))
{
forget = 0;
forgive = 0;
client_print(id, print_chat, "Anonymous. Never Forget. Never Forgive")
}
set_hudmessage(0, 42, 255, -1.0, -1.0, 0, 6.0, 12.0)
show_hudmessage(id, "Seja Bem Vindo")

My friend can't compiling this plugin.

kramesa 11-03-2011 19:49

Re: hud message
 
Very badly coded

MostwantedScript 11-03-2011 21:14

Re: hud message
 
What are you trying to do.. ?

MyPc 11-04-2011 01:07

Re: hud message
 
Quote:

Originally Posted by MostwantedScript (Post 1589532)
What are you trying to do.. ?

I think he means like a premanent hudmessage cause he doesn't have any public or something here. he just want the message to appear.

MiloSx7 11-04-2011 05:48

Re: hud message
 
PHP Code:

#include <amxmodx>

#define PLUGIN "HUD"
#define VERSION "1.0"
#define AUTHOR "SATE"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
}

public 
client_putinserver(id)
{
    
set_task(0.1"ShowUrMessage"id 100)
}

public 
ShowUrMessage(id)
{
    
id -= 100
    
    set_hudmessage
(042255, -1.0, -1.006.012.0)
    
show_hudmessage(id"Seja Bem Vindo")
    
    
set_task(0.1"ShowUrMessage"id 100)


Here is the permanent HUD message

@EDIT amxmisc wasn't required

.Dare Devil. 11-04-2011 06:27

Re: hud message
 
Quote:

Originally Posted by MiloSx7 (Post 1589642)
PHP Code:

#include <amxmodx>
 
#define PLUGIN "HUD"
#define VERSION "1.0"
#define AUTHOR "SATE"
 
public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
}
 
public 
client_putinserver(id)
{
    
set_task(0.1"ShowUrMessage"id 100)
}
 
public 
ShowUrMessage(id)
{
    
id -= 100
 
    set_hudmessage
(042255, -1.0, -1.006.012.0)
    
show_hudmessage(id"Seja Bem Vindo")
 
    
set_task(0.1"ShowUrMessage"id 100)


Here is the permanent HUD message

@EDIT amxmisc wasn't required

PHP Code:

#include <amxmodx>
 
#define PLUGIN "HUD"
#define VERSION "1.0"
#define AUTHOR "SATE"
 
public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
}
 
public 
client_putinserver(id)
{
    
set_task(0.1"ShowUrMessage"id)
}
 
public 
ShowUrMessage(id)
{
    
set_hudmessage(042255, -1.0, -1.006.012.0)
    
show_hudmessage(id"Seja Bem Vindo")
 
    
set_task(0.1"ShowUrMessage"id)


You dont need that +100.

Erox902 11-04-2011 07:51

Re: hud message
 
Quote:

Originally Posted by equin (Post 1589490)
What's wrong with this plugin?
My friend can't compiling this plugin.

The wrong thing about is that there's no forward/function that calls your "function"
Even if there were like call that on players spawn you'd still be getting errors cuz'
  • There is no native called is_user_anonymous() in amxmodx.inc or amxmisc.inc
  • forget and forgive are two undefined symbols, you can't assign something to something that does'nt exist.
  • You really need to check out the tutorial section before you're trying to make a plugin!
Ps. The stickys are also filled with great information.


All times are GMT -4. The time now is 14:19.

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