Raised This Month: $ Target: $400
 0% 

Error with .tga


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Stereo
Veteran Member
Join Date: Dec 2010
Old 08-08-2011 , 22:08   Error with .tga
Reply With Quote #1

Hello alliedmodders.

This time I have tried to do a plugin with the one that shows you an image .tga but when I write /tga the server shutting down:

Fatal Error


Code:
PHP Code:
#define PLUGIN  "Mostrando_TGA"
#define VERSION "1.0"
#define AUTHOR  "iG_os"

#include <amxmodx>

#define SVC_DIRECTOR 51  // come from util.h
#define DRC_CMD_BANNER 9 // come from hltv.h


#define TGASUM 1
#define is_valid_player(%1) (1 <= %1 <= 32)

new szTga[TGASUM][] ={ "gfx/monsterstereo.tga" }

new 
bool:Tga[33];

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /tga""mostrar_tga")
    
register_clcmd("say /notga""nomostrar_tga")
}
public 
plugin_precache()
{
    for (new 
i=0i<TGASUMi++)
        
precache_generic(szTga[i])
}

public 
nomostrar_tga(idTga[id] = false;

public 
mostrar_tga(id)
{
    
Tga[id] = true;
    if(
is_valid_player(id) && is_user_connected(id) && Tga[id]) {
        new 
index 1
        message_begin
MSG_ONESVC_DIRECTOR_id )
        
write_bytestrlenszTga[index]) + // command length in bytes
        
write_byteDRC_CMD_BANNER )
        
write_stringszTga[index] ) // banner file
        
message_end()
    }
}

public 
client_putinserver(idTga[id] = false;
public 
client_disconnect(idTga[id] = false
Attached Thumbnails
Click image for larger version

Name:	Fatal_Error.jpg
Views:	185
Size:	78.9 KB
ID:	90285  

Last edited by Stereo; 08-09-2011 at 06:31.
Stereo is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-09-2011 , 04:00   Re: Error with .tga
Reply With Quote #2

Not sure DRC_CMD_BANNER can work, but the first argument should be : strlen( szTga[index] ) + 2.
__________________
Arkshine is offline
Stereo
Veteran Member
Join Date: Dec 2010
Old 08-09-2011 , 06:35   Re: Error with .tga
Reply With Quote #3

Thanks Arkshine, but Should I use one of these?


PHP Code:
#define DRC_CMD_NONE                0    // NULL director command
#define DRC_CMD_START                1    // start director mode
#define DRC_CMD_EVENT                2    // informs about director command
#define DRC_CMD_MODE                3    // switches camera modes
#define DRC_CMD_CAMERA                4    // sets camera registers
#define DRC_CMD_TIMESCALE            5    // sets time scale
#define DRC_CMD_MESSAGE                6    // send HUD centerprint
#define DRC_CMD_SOUND                7    // plays a particular sound
#define DRC_CMD_STATUS                8    // status info about broadcast
#define DRC_CMD_BANNER                9    // banner file name for HLTV gui
#define DRC_CMD_FADE                10    // send screen fade command
#define DRC_CMD_SHAKE                11    // send screen shake command
#define DRC_CMD_STUFFTEXT            12    // like the normal svc_stufftext but as director command 
Stereo is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-09-2011 , 06:38   Re: Error with .tga
Reply With Quote #4

It doesn't mean all are working in CS. Some may disabled or modified. Anyway, just test & see.
__________________
Arkshine is offline
Stereo
Veteran Member
Join Date: Dec 2010
Old 08-09-2011 , 06:39   Re: Error with .tga
Reply With Quote #5

I will try all xd

Thank's you
Stereo is offline
Stereo
Veteran Member
Join Date: Dec 2010
Old 08-09-2011 , 07:26   Re: Error with .tga
Reply With Quote #6

Sorry for double post but I try all but none works,

Can not works by SVC_DIRECTOR?
Stereo is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-09-2011 , 09:29   Re: Error with .tga
Reply With Quote #7

Looking at CS, DRC_CMD_BANNER exists and code is still here. Yes, it does nothing (I've tried fastly), no idea why. Probably you can use this only for HLTV, or valve has locked something, don't know.


By the way, In CS, DRC_CMD_SHAKE and DRC_CMD_STUFFTEXT are removed.

There are 2 new DRC_ : 14 and 15.

14 : related to spec mode, especially for Free Look (3) as structure :

coord
coord
coord
coord
coord
coord
byte
byte

15 : related to camera waypoints

byte (number of something)
...
coord
coord
coord
coord
coord
coord
byte
byte
...
__________________
Arkshine is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:21.


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