AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Sprites in Maps (https://forums.alliedmods.net/showthread.php?t=8822)

Schnuffer 12-27-2004 14:15

Sprites in Maps
 
Kann mir mal einer bitte den code vervollständigen? Es soll damit ein Logo in die Maps gemacht werden.

Code:
#include <amxmodx> #include <engine> new map_cors_origin[3] new map_cors_pre public plugin_init(){     register_plugin("Logo", "0.1", "KriegsGeBiet")     map_cors_pre = map_cors_present(map_cors_origin)     logo()     return PLUGIN_CONTINUE } public logo(){     if ( map_cors_pre ){                new iEnt = create_entity( "env_sprite" )                entity_set_model( iEnt, "sprites/logo.spr" )         entity_set_origin( iEnt, map_cors_origin )                         DispatchSpawn( iEnt )     }       } map_cors_present(maporigin[3]){     if (file_exists("addons/amxmodx/configs/logo.cfg")){         new readdata[64]         new currentmap[32]         get_mapname(currentmap,31)         new map[32],x[16],y[16],z[16], len         for(new i=0; i < 100 && read_file("addons/amxmodx/configs/logo.cfg",i,readdata,63,len); i++) {             parse(readdata,map,31,x,15,y,15,z,15)             if(equal(map,currentmap)){                 maporigin[0] = str_to_num(x)                 maporigin[1] = str_to_num(y)                 maporigin[2] = str_to_num(z)                 return 1             }         }       }                   return 0 } public plugin_precache()     precache_model("sprites/logo.spr")

doomy 12-27-2004 15:04

Ok i think i understand wat ur saying...sorry i dont speak German, and googles translator sux. This is wat i think u want:

Code:
#include <amxmodx> #include <engine> new map_cors_origin[3], map_cors_pre, logo public plugin_init(){     register_plugin("Logo", "0.1", "KriegsGeBiet")     map_cors_pre = map_cors_present(map_cors_origin)     logo()     return PLUGIN_CONTINUE } public logo(){     if ( map_cors_pre ){         message_begin( MSG_BROADCAST, SVC_TEMPENTITY, map_cors_origin )         write_coord( map_cors_origin[0] )         write_coord( map_cors_origin[1] )         write_coord( map_cors_origin[2] )         write_short( logo )         write_byte( 10 ) //Normal size         message_end()     }         } map_cors_present(maporigin[3]){     if (file_exists("addons/amxmodx/configs/logo.cfg")){         new readdata[64]         new currentmap[32]         get_mapname(currentmap,31)         new map[32],x[16],y[16],z[16], len         for(new i=0; i < 100 && read_file("addons/amxmodx/configs/logo.cfg",i,readdata,63,len); i++) {             parse(readdata,map,31,x,15,y,15,z,15)             if(equal(map,currentmap)){                 maporigin[0] = str_to_num(x)                 maporigin[1] = str_to_num(y)                 maporigin[2] = str_to_num(z)                 return 1             }         }         }                     return 0 } public plugin_precache()     logo = precache_model("sprites/logo.spr")

Schnuffer 12-27-2004 15:40

THX doomy

The code does not function in such a way. I wanted the sprite without temp entity set it purely otherwise each round again disappear there.

Someone has another idea?

Sry 4 my bad Englich.

doomy 12-27-2004 18:02

Okay, I updated the code so that as each new round starts the sprite will be displayed again. Here you go:

Code:
#include <amxmodx> #include <engine> new map_cors_origin[3] new map_cors_pre public plugin_init(){     register_plugin("Logo", "0.1", "KriegsGeBiet")     map_cors_pre = map_cors_present(map_cors_origin)     register_event("ResetHUD","logo")     logo()     return PLUGIN_CONTINUE } public logo(){     if ( map_cors_pre ){                 new iEnt = create_entity( "env_sprite" )                 entity_set_model( iEnt, "sprites/logo.spr" )         entity_set_origin( iEnt, map_cors_origin )                           DispatchSpawn( iEnt )     }         } map_cors_present(maporigin[3]){     if (file_exists("addons/amxmodx/configs/logo.cfg")){         new readdata[64]         new currentmap[32]         get_mapname(currentmap,31)         new map[32],x[16],y[16],z[16], len         for(new i=0; i < 100 && read_file("addons/amxmodx/configs/logo.cfg",i,readdata,63,len); i++) {             parse(readdata,map,31,x,15,y,15,z,15)             if(equal(map,currentmap)){                 maporigin[0] = str_to_num(x)                 maporigin[1] = str_to_num(y)                 maporigin[2] = str_to_num(z)                 return 1             }         }         }                     return 0 } public plugin_precache()     precache_model("sprites/logo.spr")

Schnuffer 12-27-2004 18:43

not work :(

Here is a new Code.
I do not have notion like one the x y z data hand over. Perhaps points you it.

Code:
#include <amxmodx> #include <engine> public plugin_init(){     register_plugin("Logo", "0.1", "KriegsGeBiet")     logo()     return PLUGIN_CONTINUE } public logo(){     if (file_exists("addons/amxmodx/configs/logo.cfg")){         new readdata[64]         new currentmap[32]         get_mapname(currentmap,31)         new map[32],x[16],y[16],z[16], len         for(new i=0; i < 100 && read_file("addons/amxmodx/configs/logo.cfg",i,readdata,63,len); i++) {             parse(readdata,map,31,x,15,y,15,z,15)             if(equal(map,currentmap)){                 new Float:origin[3]                 origin[0] = Float:str_to_num(x)                 origin[1] = Float:str_to_num(y)                 origin[2] = Float:str_to_num(z)                                 // DEBUG                 server_print("X: %d, Y: %d, Z: %d", origin[0], origin[1], origin[2])                                 new iEnt = create_entity( "env_sprite" )                        entity_set_model( iEnt, "sprites/logo.spr" )                         entity_set_origin( iEnt, origin )                                 DispatchSpawn( iEnt )               }         }       }               } public plugin_precache()     precache_model("sprites/logo.spr")

DEBUG works fine. The data agree

doomy 12-27-2004 23:59

ok one problem is that i dont have a config file for it. If you could possibly tell me wats happening i mit be able to figure out the problem. That would really help, thanks.

Schnuffer 12-28-2004 00:41

1 Attachment(s)
Here is the logo.sma RENAME it to logo.cfg

de_dust2 -> LOGO on T Base
cs_italy -> LOGO on CT Base

The URL from the logo.spr was send per PM to you.

Schnuffer 12-28-2004 16:39

Nobody can help me?

LynX 12-29-2004 07:25

There is a topic in original AMX forums.
There was a complete procedure of spawning sprite on map.


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

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