Raised This Month: $128 Target: $400
 32% 

Request > Win Team Sprite


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wendetta
Member
Join Date: Jul 2012
Old 03-13-2017 , 16:13   Request > Win Team Sprite
Reply With Quote #1

Hi,

I need this plugin. The sprite will appear on the winning team's screen [ must be the end of the round )




This is a code but not working :S

PHP Code:
/* Раскомментируйте, если вы используете ZombieMod версию. */
// #define USE_ON_ZM
/* ЗАтемнять ли экран? */
#define FADE_SCREEN
/*Скрывать ли прицел*/
#define HIDE_CROSSHAIR


#include <amxmodx>
#if defined USE_ON_ZM
    #include <zombieplague>
#endif

#define CSW_KNIFE    29
#define CSW_SHIELD    2
#define DEFAULT_FOV    90

new bool:g_bSomeBoolg_iRoundState;

enum _:ROUNDWIN_States {
    
ROUND_DRAW 0,
    
ROUND_WIN_T,
    
ROUND_WIN_CT
}

enum _:MESSAGES {
    
g_iMsg_WeaponList,
#if defined FADE_SCREEN
    
g_iMsg_ScreenFade,
#endif
    
g_iMsg_CurWeapon,
    
g_iMsg_ForceCam,
    
g_iMsg_SetFOV,
#if defined HIDE_CROSSHAIR
    
g_iMsg_HideWeapon
#endif
}
    
new 
g_Messages_Name[MESSAGES][] = {
    
"WeaponList",
#if defined FADE_SCREEN
    
"ScreenFade",
#endif
    
"CurWeapon",
    
"ForceCam",
    
"SetFOV",
#if defined HIDE_CROSSHAIR
    
"HideWeapon"
#endif
}

new 
g_Messages[MESSAGES];

new 
g_Sprites[][] = 
{
    
#if !defined USE_ON_ZM
    
"sprites/z_aufff_fmaledevcsrus.txt",
    
#else
    
"sprites/zombie_win_sz.txt",
    
#endif
    
"sprites/640hud11.spr",
    
"sprites/640hud10.spr",
    
"sprites/640hud7.spr",
    
#if !defined USE_ON_ZM
    
"sprites/winteam_fmaledevcsrus.spr"
    
#else
    
"sprites/zombie_win_uniq.spr"
    
#endif
}

#if defined USE_ON_ZM
new const CMD[] = "zombie_win_sz";
#else
new const CMD[] = "z_aufff_fmaledevcsrus";
#endif


public plugin_precache(){
    for(new 
isizeof(g_Sprites); i++){
        
precache_generic(g_Sprites[i]);
    }
}

public 
plugin_init(){
    
register_plugin("WinTeam Sprite""0.0.5""Some Scripter");
    
    
register_clcmd(CMD,"FakeSwitch");
    
register_event("HLTV""Event_NewRound","a","1=0","2=0");
    
    
#if !defined USE_ON_ZM    
    
register_event("SendAudio""Event_CTWin","a","2=%!MRAD_ctwin");
    
register_event("SendAudio""Event_TerroristWin","a","2=%!MRAD_terwin");
    
register_event("SendAudio""Event_Draw","a","2=%!MRAD_rounddraw");
    
#endif
    
    
for(new isizeof(g_Messages); i++){            
        
g_Messages[i] = get_user_msgid(g_Messages_Name[i]);
        
register_message(g_Messages[i], "block");
    }
}

#if defined USE_ON_ZM
public zp_round_ended(winteam){
    switch(
winteam){
        case 
WIN_NO_ONE:{
            
g_iRoundState ROUND_DRAW;
        }
        case 
WIN_ZOMBIES:{
            
g_iRoundState ROUND_WIN_T;
            
StartDraw();
        }
        case 
WIN_HUMANS:{
            
g_iRoundState ROUND_WIN_CT;
            
StartDraw();
        }
    }
}
#else
    
public Event_CTWin(){
    
g_iRoundState ROUND_WIN_CT;
    
StartDraw();
}

public 
Event_TerroristWin(){
    
g_iRoundState ROUND_WIN_T;
    
StartDraw();
}

public 
Event_Draw(){
    
g_iRoundState ROUND_DRAW;
}
#endif

public Event_NewRound(){
    if(!
g_iRoundState)
    {
        return;
    }

    
g_iRoundState ROUND_DRAW;
    
g_bSomeBool false;
#if defined FADE_SCREEN
    
Msg_ScreenFade();
#endif
#if defined HIDE_CROSSHAIR
    
Msg_HideWeapon();
#endif
    
Msg_WeaponList();
    
Msg_CurWeapon();
}

public 
block(){
    if(
g_bSomeBool)
    {
        return 
PLUGIN_HANDLED;
    }
    return 
PLUGIN_CONTINUE;
}
    
public 
FakeSwitch(const client){
    
engclient_cmd(client,"weapon_shield");
}

public 
sendweapon(){
    
Msg_WeaponList_Sprite();
#if defined HIDE_CROSSHAIR
    
Msg_HideWeapon_2();
#endif
    
Msg_SetFOV();
    
    
g_bSomeBool false;
    
    switch(
g_iRoundState){
        case 
ROUND_WIN_CT:    Msg_CurWeapon_st1();
        case 
ROUND_WIN_T:    Msg_CurWeapon_st2();
    }
    
    
g_bSomeBool true;
    
    
Msg_SetFOV_2();
}

public 
StartDraw(){
    
#if defined FADE_SCREEN
    
Msg_ScreenFade_2();
    
#endif
    
    
g_bSomeBool true;
    
set_task(0.6,"sendweapon");
}


stock Msg_WeaponList(){
    
message_begin(MSG_ALL,g_Messages[g_iMsg_WeaponList], .player 0);
    {
        
write_string("weapon_knife");
        
write_byte(-1);
        
write_byte(-1);
        
write_byte(-1);
        
write_byte(-1);
        
write_byte(2);
        
write_byte(1);
        
write_byte(CSW_KNIFE);
        
write_byte(0);
    }
    
message_end();
}

stock Msg_WeaponList_Sprite()
{
    
message_begin(MSG_ALL,g_Messages[g_iMsg_WeaponList],_,0);
    {
        
write_string(CMD);
        
write_byte(-1);
        
write_byte(-1);
        
write_byte(-1);
        
write_byte(-1);
        
write_byte(0);
        
write_byte(11);
        
write_byte(CSW_SHIELD);
        
write_byte(0);
    }
    
message_end();
}

#if defined FADE_SCREEN
stock Msg_ScreenFade(){
    
message_begin(MSG_ALL,g_Messages[g_iMsg_ScreenFade], .player 0);
    {
        
write_short(1500);
        
write_short(700);
        
write_short(1);
        
write_byte(0);
        
write_byte(0);
        
write_byte(0);
        
write_byte(230);
    }
    
message_end();
}

stock Msg_ScreenFade_2(){
    
message_begin(MSG_ALL,g_Messages[g_iMsg_ScreenFade], .player 0);
    {
        
write_short(9048);
        
write_short(11480);
        
write_short(1);
        
write_byte(0);
        
write_byte(0);
        
write_byte(0);
        
write_byte(230);
    }
    
message_end();
}
#endif

stock Msg_CurWeapon(){
    
message_begin(MSG_ALL,g_Messages[g_iMsg_CurWeapon], .player 0);
    {
        
write_byte(0);
        
write_byte(0);
        
write_byte(0);
    }
    
message_end();
}

stock Msg_CurWeapon_st1(){        
    
message_begin(MSG_ALL,g_Messages[g_iMsg_CurWeapon], .player 0);
    {
        
write_byte(1);
        
write_byte(2);
        
write_byte(-1);
    }
    
message_end();
}

stock Msg_CurWeapon_st2()
{        
    
message_begin(MSG_ALL,g_Messages[g_iMsg_CurWeapon], .player 0);
    {
        
write_byte(64);
        
write_byte(2);
        
write_byte(-1);
    }
    
message_end();
}

stock Msg_SetFOV(){
    
message_begin(MSG_ALL,g_Messages[g_iMsg_SetFOV], .player 0);
    {
        
write_byte(DEFAULT_FOV-1);
    }
    
message_end();
}

stock Msg_SetFOV_2()
{
    
message_begin(MSG_ALL,g_Messages[g_iMsg_SetFOV], .player 0);
    {
        
write_byte(DEFAULT_FOV);
    }
    
message_end();
}
#if defined HIDE_CROSSHAIR
stock Msg_HideWeapon(){
    
message_begin(MSG_ALL,g_Messages[g_iMsg_HideWeapon], .player 0);
    {
        
write_byte(0);
    }
    
message_end();
}

stock Msg_HideWeapon_2(){
    
message_begin(MSG_ALL,g_Messages[g_iMsg_HideWeapon], .player 0);
    {
        
write_byte(64);
    }
    
message_end();
}
#endif 
wendetta is offline
4ever16
Veteran Member
Join Date: Apr 2015
Old 03-13-2017 , 21:59   Re: Request > Win Team Sprite
Reply With Quote #2

Here you go.
Please read the whole thread!

https://forums.alliedmods.net/showthread.php?t=291293
4ever16 is offline
dyxL
Senior Member
Join Date: Jul 2010
Old 11-20-2020 , 13:03   Re: Request > Win Team Sprite
Reply With Quote #3

here https://forums.alliedmods.net/showthread.php?t=134155
dyxL is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 11-20-2020 , 15:00   Re: Request > Win Team Sprite
Reply With Quote #4

Quote:
Originally Posted by dyxL View Post
At least when you answer a random 3 year old thread whose author hasn't been active since posted, make sure your solution is actually for AMX Mod X and not SourceMod.
__________________

Last edited by OciXCrom; 11-20-2020 at 15:00.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
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 08:01.


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