Raised This Month: $12 Target: $400
 3% 

[CSS] Buy relive


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Devzirom
Junior Member
Join Date: Dec 2008
Location: Russian Federation
Plugin ID:
2020
Plugin Version:
1.0
Plugin Category:
Gameplay
Plugin Game:
Counter-Strike: Source
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Allows players to buy relive(respawn)
    Unapprover:
    Reason for Unapproving:
    Failed to comply with Drifter's review; see post #18
    Old 10-23-2010 , 00:36   [CSS] Buy relive
    Reply With Quote #1

    CSS: Buy relive

    Allows players to buy relive(respawn)
    Plugin cvar's
    • sm_buy_relive_enabled = 1/0 - plugin is enabled/disabled, (def. 1)
    • sm_buy_relive_cost = 0-16000 - Set the price for the relive(respawn), (def. 5000)
    • sm_buy_relive_message = 1/0 plugin message is enabled/disabled, (def. 1)
    • sm_buy_relive_version - current plugin version

    Сlients сommands

    say
    or say_team:
    • relive
    • respawn
    • buyrespawn
    • buyrelive
    Attached Files
    File Type: sp Get Plugin or Get Source (buy_relive.sp - 1017 views - 2.6 KB)
    Devzirom is offline
    GrO
    Veteran Member
    Join Date: Jun 2010
    Location: Poland
    Old 10-24-2010 , 01:20   Re: [CSS] Buy relive
    Reply With Quote #2

    Good idea, will test it on my server with $15000 cost ;].
    __________________
    GrO is offline
    Devzirom
    Junior Member
    Join Date: Dec 2008
    Location: Russian Federation
    Old 10-24-2010 , 06:20   Re: [CSS] Buy relive
    Reply With Quote #3

    Quote:
    Originally Posted by GrO View Post
    Good idea, will test it on my server with $15000 cost ;].
    Thanks!
    Devzirom is offline
    sinblaster
    Grim Reaper
    Join Date: Feb 2010
    Location: Australia
    Old 10-24-2010 , 10:01   Re: [CSS] Buy relive
    Reply With Quote #4

    great idea
    __________________
    Happy Happy Joy Joy

    sinblaster is offline
    GrO
    Veteran Member
    Join Date: Jun 2010
    Location: Poland
    Old 10-24-2010 , 23:08   Re: [CSS] Buy relive
    Reply With Quote #5

    Devzirom is it possible for You to add a ConVar:

    sm_buy_relive_buytime 0.50 (Min = 0.25; Default = 1.0; Disabled = 0.0) - Every value greater than "0.0" allows ReLived player to buy weapons and stuff (at his BuyZone) for a specified amount of time (in Minutes).

    Even, if standard mp_buytime has already expired, so sm_buy_relive_buytime should override it's functionality for ReLived players.

    And I also think that the sm_buy_relive_buytime timer should be resetted on RoundEnd to avoid any problems, when someone will ReLive just before RoundEnd.
    __________________

    Last edited by GrO; 10-24-2010 at 23:18.
    GrO is offline
    Devzirom
    Junior Member
    Join Date: Dec 2008
    Location: Russian Federation
    Old 10-30-2010 , 02:43   Re: [CSS] Buy relive
    Reply With Quote #6

    Can simply return to the player its armor and the weapon (if other players haven't picked up)?
    Devzirom is offline
    GrO
    Veteran Member
    Join Date: Jun 2010
    Location: Poland
    Old 10-30-2010 , 04:45   Re: [CSS] Buy relive
    Reply With Quote #7

    Quote:
    Originally Posted by Devzirom View Post
    Can simply return to the player its armor and the weapon (if other players haven't picked up)?
    This way it may be unfair, cause:

    1) One player ReLives for x$ and gets all his stuff back.
    2) Other player also ReLives for x$ with knife + pistol only, cause someone took his weapon (what happens quite often).

    So the only 2 senseful methods are:

    1) ReLived player always gets his stuff back.
    2) ReLived player gets ability of buying stuff for x.x minutes (extended mp_buytime).
    __________________
    GrO is offline
    Devzirom
    Junior Member
    Join Date: Dec 2008
    Location: Russian Federation
    Old 11-01-2010 , 09:26   [CSS] Buy relive 2 beta
    Reply With Quote #8

    [CSS] Buy relive 2 beta

    The сvar is added:
    sm_buy_relive_buytime = Time in seconds in which flow players can buy items again, (def. 0)

    Mr. GrO, test it! I wait for Your results!

    note: The variable mp_buytime installs value 1440.0 - don't pay attention to it
    Attached Files
    File Type: sp Get Plugin or Get Source (buy_relive_2_beta.sp - 719 views - 6.3 KB)
    Devzirom is offline
    GrO
    Veteran Member
    Join Date: Jun 2010
    Location: Poland
    Old 11-01-2010 , 14:16   Re: [CSS] Buy relive
    Reply With Quote #9

    Nice work, thanks.

    But what, if I want my mp_buytime to stay at 0.25?
    __________________
    GrO is offline
    Devzirom
    Junior Member
    Join Date: Dec 2008
    Location: Russian Federation
    Old 11-02-2010 , 03:13   Re: [CSS] Buy relive 2 beta
    Reply With Quote #10

    Quote:
    Originally Posted by GrO View Post
    Nice work, thanks.

    But what, if I want my mp_buytime to stay at 0.25?
    1.
    PHP Code:
    // on plugin start
    public OnPluginStart() {
        
    mp_buytime FindConVar("mp_buytime"); //find a cvar
        
    buytime GetConVarFloat(mp_buytime); //find value and memorize
        
    HookConVarChange(mp_buytimeConVarChanged); //intercept value change
    }
    // on map start
    public OnMapStart() {
        if(
    buy_relive_enabled)
            
    SetConVarFloat(mp_buytime1440.0true); //A new value
    }

    //when the value changes
    public ConVarChanged(Handle:convar, const String:oldValue[], const String:newValue[]) {
           
    buytime GetConVarFloat(mp_buytime); //find value and memorize
            
           
    if(buy_relive_enabled)
               
    SetConVarFloat(mp_buytime1440.0true); //A new value
    }

    // on plugin stoped or disabled
    public OnPluginEnd() {    
        
    SetConVarFloat(mp_buytimebuytimetrue); // Set cvar mp_buytime to default


    Thus, we obtain the following: buyzone always available


    2.
    PHP Code:

    public OnPluginStart() {    
        
    HookEvent("round_freeze_end"EventFreezeEndEventHookMode_Post); // hook "Freeze End" event
        
    HookEvent("round_end"EventRoundEndEventHookMode_Post); // hook "Round End" event
    }

    //"Freeze End" event
    public Action:EventFreezeEnd(Handle:event, const String:name[], bool:dontBroadcast) {
        
    StopBuyTimer(BuyTimer0); // remove old buy timer
        
    BuyTimer CreateTimer(buytime 60.0StopBuyTimer0); // create new buy timer
    }

    // "Round End" event
    public Action:EventRoundEnd(Handle:event, const String:name[], bool:dontBroadcast) {
        
        
    StopBuyTimer(BuyTimer0); // Remove buy timer
        
    }

    public 
    OnGameFrame() {
        if(
    BuyTimer != INVALID_HANDLE)
               return;
        
    // if buytimer == 0.0
        
    for(new i=1i<=MaxClientsi++) {

            
    SetEntProp(iProp_Send"m_bInBuyZone"0); // Block buyzone!
        
    }

    Thus, we obtain the following: buyzone is blocked

    3.

    PHP Code:
    //on relive command
    public Action:Command_Say(clientargs) {
            
    PlayerBuyTimer[client] = CreateTimer(buy_relive_buytime,  StopBuyTimerclient); // Create individual buy timer
            
    CS_RespawnPlayer(client); //Respawn
    }

    public 
    OnGameFrame() {
        for(new 
    i=1i<=MaxClientsi++) {
            
    // if individual buytimer > 0
            
    if(PlayerBuyTimer[i] != INVALID_HANDLE)
                continue; 
    // <---- blocking does not happen
            
            
    SetEntProp(iProp_Send"m_bInBuyZone"0); // block buyzone
        
    }

    Thus, players can buy items


    -----------------

    Other methods, I do not know
    Devzirom 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 08:25.


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