AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] Coding (https://forums.alliedmods.net/showthread.php?t=196917)

happy_2012 09-26-2012 17:03

[HELP] Coding
 
[B]Hello ,[/B]
[B]I am trying to make a plugin which I can make advertisments in 'HUDMESSAGES'[/B]

[B]I did it but what I want to do is , link the '.sma' file to a '.ini' file so I can edit the messages which I want the advertisor show as 'HUDMESSAGE'[/B]

[B]My code :[/B]
Code:

#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Hudmessage"
#define VERSION "1.0"
#define AUTHOR "happy"
 
public plugin_init() {
 register_plugin(Hudmessage, 1.0, happy)
 
 set_hudmessage(0, 255, 0, -1.0, -1.0)
 show_hudmessage(id, "Welcome to ZE BaseBuilder Server")
 
 
}


quark 09-26-2012 17:14

Re: [HELP] Coding
 
amxx default have it. You can change it on amxx.cfg.

happy_2012 09-26-2012 17:15

Re: [HELP] Coding
 
[B]And how can make it this way ?[/B]
[B]the code is two lines xD[/B]

avril-lavigne 09-26-2012 17:16

Re: [HELP] Coding
 
new s_File[128];
get_configsdir(s_File,127);
format(s_File,127,"%s/hudmessages.ini",s_File);

use fopen / read_file

why not just use imessage from amxx default package ?
use amx_task plugin and make new messages every few secs

jimaway 09-26-2012 17:18

Re: [HELP] Coding
 
http://forums.alliedmods.net/showthread.php?p=162423 or just use the amxx built in advertisement messages

if you want to make the plugin yourself, you should start learning the basics of scripting

happy_2012 09-26-2012 17:23

Re: [HELP] Coding
 
[B]Amx tasks -> just show the server name and other things which I don't want[/B]

[B]I want to make my own plugin so I can learn to code a better plugins sooner[/B]

[B]I want to know how to link it to .ini configuration file to edit my messages to show in the server as hud messages...[/B]

quark 09-26-2012 17:49

Re: [HELP] Coding
 
Quote:

Originally Posted by avril-lavigne (Post 1807140)
new s_File[128];
get_configsdir(s_File,127);
format(s_File,127,"%s/hudmessages.ini",s_File);

use fopen / read_file

and you dont need to write in bold.

happy_2012 09-26-2012 17:53

Re: [HELP] Coding
 
[B]Why can't I use 'bold' to type a message :P ?[/B]

[B]I can just type my message in blabla.ini if I added this ? and it will show up as HUDMESSAGE ?[/B]

Liverwiz 09-26-2012 17:57

Re: [HELP] Coding
 
Quote:

Originally Posted by happy_2012 (Post 1807162)
[B]Why can't I use 'bold' to type a message :P ?[/B]

[B]I can just type my message in blabla.ini if I added this ? and it will show up as HUDMESSAGE ?[/B]

my god....
1. bold is annoying to read. I feel like you're yelling at me
2. yes, you can pull text from a file and it will print itself as a hud message. Just like EVERY programming language EVER. Things just happen FOR you.
3. Dude, this is not so basic, but you're still missing the fundamentals of scripting. Read tuts, wikis, and documentation of pawn/small/AMXX THEN come back and ask specific, well thought out, and exemplified questions. Otherwise your help you will get from here will be about as sarcastic as mine.

YamiKaitou 09-26-2012 19:29

Re: [HELP] Coding
 
Quote:

Originally Posted by happy_2012 (Post 1807162)
[B]Why can't I use 'bold' to type a message :P ?[/B]

Because it is in violation of the rules. I also go back and add [noparse] tags to posts that make unneeded alterations to the font style.


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

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