Pagina de start a forumului IAD GAMES ROMANIA
  Acum este: 20/11/2026 08:36   

Pagina de start a forumului IAD GAMES ROMANIA -> ~[Counter-Strike]~

In-Game Advertisement System v1.60

  Autor    Thread Creaza un subiect nou Raspunde la subiect
Pilifo
Administrator
Administrator
Pilifo

Data inscrierii: 18/Dec/2006
Mesaje: 344
Localitate: BUCURESTI
In-Game Advertisement System v1.60

In-Game Advertisement System v1.60
by stupok69, with many thanks to 10stars

Last updated 5/22/07

Description
This plugin allows you to use a menu to place an entity flush with any wall, ceiling, floor, or entity. You can then modify the texture of the included wall.mdl, use your own model, or use a fixed sprite or regular sprite to contain the logo or advertisement you want to display. You can save ads into a .txt file. These ads will automatically load.

Instructions
Bind a key to +place_ad and hold down the key to place the wall.mdl flush with another surface. Let go of the key when the entity becomes flush with the surface. When you let go of the key, a menu will come up letting you choose which model/sprite to place, move the sprite/model one unit towards yourself, or scale up/down the sprite.

For animated sprites, place the sprite on a wall just like any other sprite, save it, and then edit the mapname.txt to conține frames and framerate.

Menu items 1-4 are precached models listed in
"mod/addons/amxmodx/configs/In-Game Ads/precache_list.cfg".

If you select save, the coordinates, angles, and scale will be saved into a .txt file located in
"mod/addons/amxmodx/configs/In-Game Ads/mapname.txt".

Commands
+place_ad - hold down to place an ad flush with a wall.
iga_closer - move the ad closer to you.
iga_farther - move the ad away from you.

Formatting Files

I would suggest NOT creating a directory and files. Just run your server with the plugin installed and the proper files and directory will be created automatically. Please note that the precache_list.cfg file must be edited manually.

Example mapname.txt file:
(Do not place more than one "thing" on one line. Model/sprite, origin, angles, scale should each have their own line.)
Code:

//this is a comment, the plugin will ignore this line
sprites/advert/bs_index.spr
origin -1635.000000 703.000000 254.000000
angles 0.000000 90.000000 0.000000
scale 1.600000

//this is an animated sprite
sprites/advert/animation.spr
origin 907.000000 2078.000000 87.000000
angles 0.000000 990.000000 0.000000
scale 0.000000
frames 20
framerate 2.0
//how many frames in the animation?
//how many frames per second?


models/wall.mdl
origin -1441.000000 -8.000000 173.000000
angles 0.000000 180.000000 0.000000

Example precache_list.cfg file:

Code:

//If you would like to choose which model/sprite to place when placing an ad, add the item to the list below.
//For example:
//models/wall.mdl
//models/player.mdl
//etc...

models/wall.mdl
sprites/stupok69.spr
sprites/advert/stupok692.spr

How to make a sprite or model with your logo/advertisement
Model:

* To change the texture of a model, you can use Jed's Half-Life Model Viewer.
Detail:
1. Open the model, select the "Texture" tab, choose the correct texture file from the list-box, select "Export".
2. Use an image editor to change the texture. Remember, your final product will not have exactly the same colors as you want, because of the texture's original index of colors. Save the file.
3. Open the model, select the "Texture" tab, choose the correct texture file from the list-box, select "Import", select "Save Model".

Sprite:

* Convert a bitmap to a sprite.
Detail:
1. Make a .bmp file, preferably with width and length that are multiples of 8. Remember, the width * height must not exceed 10752.
1. Make a .bmp file, with whatever dimensions you want! Sprite Explorer gave me warnings with oddly sized sprites but they work just fine.
If the width * height of the sprite exceeds 10752, or if the width or height of the sprite is not a numeroase of 8, you may encounter the error below:
Fatal Error GL_Upload16: s&3
To resolve the problem, recreate the sprite and try again. There is no definite solution that I am aware of.
2. You must save the .bmp in Indexed Mode, NOT RGB Mode. RGB will work, but the sprite will have odd colors.
3. Open a sprite creator like Sprite Explorer. Select "File>New Sprite", add your .bmp file(s), and save your sprite. To make an animated sprite just add all the frames during this step.
* To fix a sprite and make it stop rotating, you can use a free hex editor.
Detail:
I use Free Hex Editor by HHD Software.
1. Open the .spr file with the hex editor of your choice.
2. Change the 8th byte (0,1,2,3, ...) from 02 to 03.
3. Save the .spr file.

Alternately, you can use a program suggested by |PnC| green to fix your sprites:

http://www.porkncheese.com/stuff/sprites/spritefixer/


Video
NOTE: This video shows version 1.44, last updated 02/10/07.
http://video.google.com/videoplay?do...34367627736161

Credits
a1uqfk47 - Original idea

Change Log
Code:

05/22/07 - v1.60 - Added compatibility for animated sprites. Woohoo!!

05/10/07 - v1.50 - Small adjustment in distance from wall.

05/08/07 - v1.49 - Fixed newline character error in v1.48.

05/07/07 - v1.48 - Fixed issue with Linux compatibility.

- Added two commands for moving the advertisement.

04/21/07 - v1.47 - Overlooked ability for other users to control ad
placement.

02/10/07 - v1.44 - More optimization. Switched to new file natives.

02/06/07 - v1.43 - Fixed saving incorrect sprite angles.

02/03/07 - v1.42 - More optimization, and some comments.

02/01/07 - v1.41 - Small optimization and minor changes.

01/30/07 - v1.40 - Overlooked client prethink when converting to FM.
Now it's fixed.

01/28/07 - v1.39 - Converted to FakeMeta for precision. Now entities will
be exactly flush with any wall, rather than almost flush.

-Fixed saving incomplete filename.

-No more pressing menu option 2 times to flip sprite, now
the sprite is ALWAYS angeled correctly while placing. Move
toward client if sprite is invisible.

-Minor optimization.

01/20/07 - v1.38 - Fixed a bug, thanks Ramono Smile

01/19/07 - v1.37 - More optimization.

01/18/07 - v1.36 - OPTIMIZATION!!! Hopefully more to come...

01/16/07 - v1.35 - Added MAX_MODEL_NAMELEN to prevent crashes due to
model's filename length.

01/16/07 - v1.34 - Odd angles during placement should be eliminated
completely (unless during movement from one to another
surface).

01/14/07 - v1.33 - More error reporting, no more wall.mdl requirement, fixed
saving sprites.

01/14/07 - v1.32 - Server will report error instead of crashing
upon failed precache.

01/13/07 - v1.31 - Fixed menu size.

01/13/07 - v1.3 - Added:
-New menu and menu options.
-Loading saved ads.
-Saving scale of sprites
Fixed:
-Entity having odd angles while placing.

01/07/07 - v1.2 - Changed way of placing advertisement, should be simpler.

01/07/07 - v1.1 - Slight optimization, removed unnecessary function.

01/07/07 - v1.0 - Initial release

Errors / Bugs

* If you write entries in the mapname.txt that are not formatted correctly, the server may crash/explode and your sprites or models may spontaneously combust.
* I recommend using sprites whose width * height does not exceed 10752 to avoid the "Fatal Error GL_Upload16: s&3" error. Please read above for more details.

I'm leaving the wall.mdl attachment just in case you want to test the plugin but don't have a good model or sprite to use.


MODELES : http://forums.alliedmods.net/attachment.php?attachmentid=13261&d=1168728351

PLUGIN : http://www.amxmodx.org/plcompiler_vb.cgi?file_id=16312
SMA : http://forums.alliedmods.net/attachment.php?attachmentid=16312&d=1179879436

SURSA : http://forums.alliedmods.net/showthread.php?p=424583
_________________
Counter-Strike Just 4 Fun ( Counter-Strike excesiv dauneaza grav sanatati ,
daca se manifesta dependetza adresati-va adminului . )
In-Game Advertisement System v1.60 In-Game Advertisement System v1.60

Mesaj 10/06/2007 00:19 
 Vezi profilul utilizatorului Trimite mesaj privat Trimite un mesaj  Raspunde cu citat (quote)  
  Afiseaza mesajele pentru a le previzualiza:      
Creaza un subiect nou Raspunde la subiect

Mergi direct la:  


<  Last Thread | Next Thread  >

Forum Rules:
Nu puteti crea un subiect nou in acest forum
Nu puteti raspunde in subiectele acestui forum
Nu puteti modifica mesajele proprii din acest forum
Nu puteti sterge mesajele proprii din acest forum
Nu puteti vota in chestionarele din acest forum

 

Powered by phpBB © 2001 phpBB GroupFa-ti si tu propriul forum GRATUIT, pe www.myforum.ro

phpBB Template by Vereor.