Raised This Month: $ Target: $400
 0% 

HUD disappears [HELP]


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
skunew
Member
Join Date: Dec 2013
Old 03-16-2014 , 14:26   HUD disappears [HELP]
Reply With Quote #1

I have plugin. This plugin after dead show random hud from "cytaty.ini" and i wont to this hud must be for 20 second but this hud disappears when some other plugin show other hud. PLS HELP maybe use Director Hud Message? Pls change this sma i form poland sorry for bad eng

Quote:
/* Script generated by Pawn Studio */

#include <amxmodx>
#include <amxmisc>
#include <csx>

#define PLUGIN "Cytaty"
#define AUTHOR "DarkGL"
#define VERSION "1.0"

#define MAX_CYTAT_LEN 256
#define CYTATY_END "----end----"

new Array:szCytatyHandle,
SyncHudObj,
pCvarBlack,
gMsgScreenFade;

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)

szCytatyHandle = ArrayCreate(MAX_CYTAT_LEN,32);

SyncHudObj = CreateHudSyncObj();

pCvarBlack = register_cvar("cytaty_black_screen","1");

gMsgScreenFade = get_user_msgid("ScreenFade");

loadCytaty()
}

public loadCytaty(){
new szConfig[256];

formatex(szConfig [ get_configsdir(szConfig,charsmax( szConfig ) ) ], charsmax( szConfig ) , "/cytaty.ini",szConfig);

new szNewCytat[MAX_CYTAT_LEN],szLine[MAX_CYTAT_LEN],iLen;

for(new i=0;read_file(szConfig, i, szLine, charsmax( szLine ), iLen);i++){
if(szLine[0] == '/' || szLine[0] == '#'){
continue;
}

if(equal(szLine,CYTATY_END)){
ArrayPushString(szCytatyHandle,szNewCytat);
szNewCytat = "";
continue;
}

add(szNewCytat,MAX_CYTAT_LEN - 1,szLine);
}
}



public client_death(iKiller,iVictim,weapon,hitplace, TK) {

if(!iKiller || !iVictim || !is_user_connected(iVictim) || iKiller == iVictim || TK) return ;

new szCytat[MAX_CYTAT_LEN];

ArrayGetString(szCytatyHandle,random_num( 0 , ArraySize(szCytatyHandle) - 1 ) , szCytat , MAX_CYTAT_LEN );

if(get_pcvar_num(pCvarBlack)) Display_Fade(iVictim,(1<<12) * 3,(1<<12) * 5,0x0001,0,0,0,255)

set_hudmessage(0, 255, 0, 0.05, 0.17, 0, 6.0, 20.0, 0.1, 0.2, 2)
ShowSyncHudMsg(iVictim, SyncHudObj, szCytat);

}

public plugin_end(){
ArrayDestroy(szCytatyHandle);
}

stock Display_Fade(id,duration,holdtime,fadetype,re d,green,blue,alpha)
{
if(!is_user_connected(id)) return PLUGIN_CONTINUE;

message_begin( MSG_ONE, gMsgScreenFade,{0,0,0},id );
write_short( duration ); // Duration of fadeout
write_short( holdtime ); // Hold time of color
write_short( fadetype ); // Fade type
write_byte ( red ); // Red
write_byte ( green ); // Green
write_byte ( blue ); // Blue
write_byte ( alpha ); // Alpha
message_end();

return PLUGIN_CONTINUE;
}
skunew is offline
 



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 06:02.


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