AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Last man standing (https://forums.alliedmods.net/showthread.php?t=164176)

Menethil 08-08-2011 07:47

Last man standing
 
Can anyone tell me how to start this plugin to do the next things


*If u are the last man standing alive ( CT / T ) ur screen to fade for 2 seconds in blue for CT and Red for Tero .. But not compltly blue/red .. just a blue/red fade transparently ..
with a HUD Message that tell`s u are the last man alive.

**If there are just 1 man at each team this mean 1 vs 1 .. the screent o fade for both .. colour depend on each team blue /red .. with the next Permanent HUD.
[1vs1] - Run is not allowed.
somewhere where cant interfere with the gameplaying .. in center-top or vertical left ..

*** and when 1 vs 1 fade and hud message apear to play a song from sounds/misc .. wich can be setted in sma or somehow.

Menethil 08-09-2011 06:32

Re: Last man standing
 
soz for up, but anyone can help me a little ^_^ ?

jimaway 08-09-2011 06:42

Re: Last man standing
 
hook deathmsg to find out if someone is last man alive and you can fade screen with ScreenFade

Exolent[jNr] 08-09-2011 10:23

Re: Last man standing
 
Quote:

Originally Posted by Menethil (Post 1528820)
soz for up, but anyone can help me a little ^_^ ?

Don't bump until 2 weeks have passed since last post.

Menethil 08-19-2011 05:46

Re: Last man standing
 
Did enought time passed ?Q_Q.
Could anyone help me, or im to .. to get any support :-s

Exolent[jNr] 08-19-2011 09:59

Re: Last man standing
 
No. 2 weeks = 14 days.
It's been 10 days.

You've already gotten support.
Quote:

Originally Posted by jimaway (Post 1528830)
hook deathmsg to find out if someone is last man alive and you can fade screen with ScreenFade


Menethil 08-22-2011 15:20

Re: Last man standing
 
Is this correct till now ?
Code:

#include <amxmodx>
#include <fakemeta>

#define PLUGIN LastMan
#define VERSION 0.1
#define AUTHOR NeuTroN

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_event("DeathMsg", "death_msg", "a")
   
}

public death_msg(id){
    new players_ct[32], players_t[32], ict, ite, name[32]
    get_players(players_ct,ict,"ae","CT")   
    get_players(players_t,ite,"ae","TERRORIST")   

    new victim = read_data(2)
    new victim_team = get_user_team(victim,"",0)
   
    if (ict==1&&ite==1)
    {
        get_user_name(players_ct[0],name,32)
        set_hudmessage(50,255,0,-1.0,0.30,0, 6.0, 8.0, 1.0, 2.0, 6)
        show_hudmessage(players_t[0],"1vs1 with %s !",name)

        get_user_name(players_t[0],name,32)
        set_hudmessage(50,255,0,-1.0,0.30,0, 6.0, 8.0, 1.0, 2.0, 6)
        show_hudmessage(players_ct[0],"1vs1 with %s !",name)

        if(ite==1)
        {
            // FadeScreen Red Transparecy here
        }
       
        if(ict==1)
        {
            // FadeScreen Blue Transparecy here
        }

        if(ict==1&&ite==1)
        {
            client_cmd ( 0 , "spk misc/mysound.wav" )
        }
}

public plugin_precache ()
{
    precache_sound ( "misc/mysound.wav" )
}

And i still need help with the screen fade, i dont handle this verry well.

.Dare Devil. 08-22-2011 17:58

Re: Last man standing
 
Quote:

Originally Posted by Menethil (Post 1538647)
Is this correct till now ?
Code:

#include <amxmodx>
#include <fakemeta>
 
#define PLUGIN LastMan
#define VERSION 0.1
#define AUTHOR NeuTroN
 
public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_event("DeathMsg", "death_msg", "a")
 
}
 
public death_msg(id){
    new players_ct[32], players_t[32], ict, ite, name[32]
    get_players(players_ct,ict,"ae","CT")   
    get_players(players_t,ite,"ae","TERRORIST")   
 
    new victim = read_data(2)
    new victim_team = get_user_team(victim,"",0)
 
    if (ict==1&&ite==1)
    {
        get_user_name(players_ct[0],name,32)
        set_hudmessage(50,255,0,-1.0,0.30,0, 6.0, 8.0, 1.0, 2.0, 6)
        show_hudmessage(players_t[0],"1vs1 with %s !",name)
 
        get_user_name(players_t[0],name,32)
        set_hudmessage(50,255,0,-1.0,0.30,0, 6.0, 8.0, 1.0, 2.0, 6)
        show_hudmessage(players_ct[0],"1vs1 with %s !",name)
 
        if(ite==1)
        {
            // FadeScreen Red Transparecy here
        }
 
        if(ict==1)
        {
            // FadeScreen Blue Transparecy here
        }
 
        if(ict==1&&ite==1)
        {
            client_cmd ( 0 , "spk misc/mysound.wav" )
        }
}
 
public plugin_precache ()
{
    precache_sound ( "misc/mysound.wav" )
}

And i still need help with the screen fade, i dont handle this verry well.

PHP Code:

 message_begin(MSG_ONEg_msgScreenFade_id)
 
write_short((1<<12)*2// duration
 
write_short(0// hold time
 
write_short(0x0000// fade type
 
write_byte(1// red
 
write_byte(2// green
 
write_byte(3// blue
 
write_byte(6// alpha
 
message_end() 


Menethil 08-23-2011 02:57

Re: Last man standing
 
i made this
Code:

#include <amxmodx>


public plugin_init()
{
    register_plugin("Last 2 players alive", "1.0", "author")
    register_event("DeathMsg", "death_msg", "a")
   
}

public death_msg(id){
    new players_ct[32], players_t[32], ict, ite, name[32]
    get_players(players_ct,ict,"ae","CT")   
    get_players(players_t,ite,"ae","TERRORIST")   

    //new victim = read_data(2)
  // new victim_team = get_user_team(victim,"",0)
   
    if (ict==1&&ite==1)
    {
        get_user_name(players_ct[0],name,32)
        set_hudmessage(50,255,0,-1.0,0.30,0, 6.0, 8.0, 1.0, 2.0, 6)
        show_hudmessage(players_t[0],"1vs1 with %s !",name)

    get_user_name(players_t[0],name,32)
    set_hudmessage(50,255,0,-1.0,0.30,0, 6.0, 8.0, 1.0, 2.0, 6)
    show_hudmessage(players_ct[0],"1vs1 with %s !",name)

    if(ite==1)
    {
        message_begin ( MSG_ONE, get_user_msgid ( "ScreenFade" ), {0,0,0}, 0 ) ;
        write_short ( 1<<10 ) ;
        write_short ( 1<<10 ) ;
        write_short ( 0x0000 ) ;
        write_byte ( 255 ) ;
        write_byte ( 0 ) ;
        write_byte ( 0 ) ;
        write_byte ( 80 ) ;
        message_end ( ) ;
    }
       
    if(ict==1)
    {
              message_begin ( MSG_ONE, get_user_msgid ( "ScreenFade" ), {0,0,0}, 0 ) ;
        write_short ( 1<<10 ) ;
        write_short ( 1<<10 ) ;
        write_short ( 0x0000 ) ;
        write_byte ( 0 ) ;
        write_byte ( 0 ) ;
        write_byte ( 255 ) ;
        write_byte ( 80 ) ;
        message_end ( ) ;
    }

    if(ict==1&&ite==1)
    {
        client_cmd ( 0 , "spk misc/mysound.wav" )
    }
  }
}

public plugin_precache( )
{
    precache_sound ( "misc/mysound.wav" )
}

but seems nothing happens when 1 vs 1 :-s. What could be the error

JoKeR LauGh 08-23-2011 07:02

Re: Last man standing
 
he asking about zombie plague , when the last human left and the sound will come out like the sound that we have choose in the plugin.


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

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