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

REQ PLugin random respawn once per round


Post New Thread Reply   
 
Thread Tools Display Modes
Davidwagner
Junior Member
Join Date: Jan 2018
Old 02-15-2018 , 05:56   Re: REQ PLugin random respawn once per round
Reply With Quote #11

I did it by myself. Ty for nothing 0.0
Davidwagner is offline
raizo11
BANNED
Join Date: Dec 2013
Location: https://t.me/pump_upp
Old 02-21-2018 , 01:43   Re: REQ PLugin random respawn once per round
Reply With Quote #12

Code:
#include <amxmodx>
#include <hamsandwich>


public plugin_init()
{
    register_plugin("Random", "1.0", "raizo");
    register_event("HLTV", "round_start_event", "a", "1=0", "2=0")
    
}

public round_start_event()
{
set_task(1.0,"start",1,_,_,"a",1)
}

public start(id)
{
    static X[32], Y, Z;

    get_players(X, Y);
    Z = X[random(Y)];
    if(!Z)
    {
        console_print(id, "Random player not found.");
        return PLUGIN_HANDLED;
    }
            
    static XName[32];
    static const XLen = sizeof(XName) - 1
    get_user_name(Z, XName, XLen);
    client_print(0, print_chat, "Random player will be %s.", XName);
    set_task(59.0, "Reset", Z)
    return PLUGIN_HANDLED;
}

public Reset(id)
{
    if(is_user_alive(id))
    {
        client_print(0, print_chat, "Can respawn alive players!");
        return PLUGIN_HANDLED;
    }

    ExecuteHamB(Ham_CS_RoundRespawn, id)
    return PLUGIN_HANDLED
}

Last edited by raizo11; 02-21-2018 at 09:12.
raizo11 is offline
Send a message via ICQ to raizo11 Send a message via AIM to raizo11 Send a message via MSN to raizo11 Send a message via Yahoo to raizo11 Send a message via Skype™ to raizo11
Reply



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 11:43.


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