amxx plugin read from file
hello. can someone help me make a plugin that when i type on chat /readfile, the plugins reads a .txt file from a web address e.g http://www.cite.com/text.txt and displays it on chat.
Thanx! |
Re: amxx plugin read from file
L.E: i managed to change a plugin to do what i want, but there is another problem. If i change the text in the file, the content shown in game is updated only if i change the map. i want on the same map, if i change the content of txt file to update
|
Re: amxx plugin read from file
if you want to display in chat you have to use sockets, if you want to use in motd:
Quote:
|
Re: amxx plugin read from file
i only want chat. So the fact is i have a radio station and everytime the song changes it uploads the name to music.txt from amxmodx/configs.
And when i write on chat /song i want a plugin that reads from music.txt and display on chat current song. But till now it only shows me the same song even if music.txt changes. In game it updates only at changemap |
Re: amxx plugin read from file
Code:
You can try this, but replace the url of your site in the constant. (line 3) |
Re: amxx plugin read from file
thank you! it works, but can you make it write on chat not motd?
|
Re: amxx plugin read from file
Use client_print( ) or show_hudmessage( ).
|
Re: amxx plugin read from file
You would have to download the file to your server using sockets module, then read the text from the file and display it in the message.
Putting the URL in the client_print() or show_hudmessage() would only display the URL. |
Re: amxx plugin read from file
Quote:
|
Re: amxx plugin read from file
i don`t need to download because i have a ftp script that updates music.txt everytime the song changes. All i need to do is read the contents when a player writes on chat /song .
|
| All times are GMT -4. The time now is 23:33. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.