AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Random player (https://forums.alliedmods.net/showthread.php?t=278498)

raizo11 02-01-2016 23:08

Random player
 
How to make this to play 10 rounds 1vs1?

Code:

#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>



#define PLUGIN    "1vs1"
#define AUTHOR    "x"
#define VERSION    "1.0"

new players[32]
new count
new randomtero
new randomct
new g_current_tero
new g_current_ct


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

    RegisterHam(Ham_Spawn, "player", "playerSpawn", 1);
}

public playerSpawn(id)
{
    g_current_tero++, g_current_ct++,
    get_players(players,count,"e","TERRORIST")
    randomtero = players[random(count)]
    set_pev( randomtero , pev_origin , { 300.0 , -150.0 , -650.0 } );
    get_players(players,count,"e","CT")
    randomct = players[random(count)]
    set_pev( randomct , pev_origin , { 50.0 , -150.0 , -650.0 } );
    if( g_current_tero < 1, g_current_ct < 1 ) {
    }

}


Visinescu 02-01-2016 23:55

Re: Random player bug
 
This is not the full code.

Craxor 02-02-2016 05:06

Re: Random player
 
You wanna block from what?

siriusmd99 02-02-2016 14:53

Re: Random player
 
You want to kill other players which are not "the lucky ones" (i mean not randomly selected) or place them to spectator?

raizo11 02-03-2016 00:03

Re: Random player
 
I need 1 ct and 1 tero to play 10 rounds , after 10 rounds end choose other 2 players

AGustiN. 02-03-2016 09:31

Re: Random player
 
Code:

#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>



#define PLUGIN    "1vs1"
#define AUTHOR    "x"
#define VERSION    "1.0"

new players[32]
new count
new randomtero
new randomct
new g_current_tero
new g_current_ct
new g_round

public plugin_init()
{
        register_plugin(PLUGIN, VERSION, AUTHOR)   
       
        RegisterHam(Ham_Spawn, "player", "playerSpawn", 1);
       
        register_event("HLTV", "event_new_round", "a", "1=0", "2=0") 
}
public event_new_round() g_round++

public playerSpawn(id)
{
        if(g_round < 10) return;
       
        g_round = 0
        g_current_tero++, g_current_ct++,
        get_players(players,count,"e","TERRORIST")
        randomtero = players[random(count)]
        set_pev( randomtero , pev_origin , { 300.0 , -150.0 , -650.0 } );
        get_players(players,count,"e","CT")
        randomct = players[random(count)]
        set_pev( randomct , pev_origin , { 50.0 , -150.0 , -650.0 } );
        if( g_current_tero < 1, g_current_ct < 1 ) {
        }
       
}


raizo11 02-03-2016 12:04

Re: Random player
 
not working

AGustiN. 02-03-2016 13:19

Re: Random player
 
Quote:

Originally Posted by raizo11 (Post 2389634)
not working

hablas español? te andaba antes?

raizo11 02-03-2016 13:34

Re: Random player
 


All times are GMT -4. The time now is 09:26.

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