AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Error with .tga (https://forums.alliedmods.net/showthread.php?t=164231)

Stereo 08-08-2011 22:08

Error with .tga
 
1 Attachment(s)
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


Arkshine 08-09-2011 04:00

Re: Error with .tga
 
Not sure DRC_CMD_BANNER can work, but the first argument should be : strlen( szTga[index] ) + 2.

Stereo 08-09-2011 06:35

Re: Error with .tga
 
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 


Arkshine 08-09-2011 06:38

Re: Error with .tga
 
It doesn't mean all are working in CS. Some may disabled or modified. Anyway, just test & see.

Stereo 08-09-2011 06:39

Re: Error with .tga
 
I will try all xd

Thank's you

Stereo 08-09-2011 07:26

Re: Error with .tga
 
Sorry for double post but I try all but none works,

Can not works by SVC_DIRECTOR?

Arkshine 08-09-2011 09:29

Re: Error with .tga
 
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
...


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

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