Raised This Month: $ Target: $400
 0% 

[CONSULTA] Identificar todos los spects online.


  
 
 
Thread Tools Display Modes
Author Message
mcxr
Member
Join Date: Oct 2012
Location: Argen - tina
Old 07-29-2013 , 13:45   [CONSULTA] Identificar todos los spects online.
#1

Buenas Chicos!, estoy armando un plugin el cual necesito identificar todos los spects y asignar 1 a un team, probe con
PHP Code:
 new Players[32], Num
        get_players
(Players,Num,"ce""SPECTATOR"
, y con
PHP Code:
 fnGetSpects()
{
    static 
iTsid
    iTs 
0
    
    
for (id 1id <= g_maxplayersid++)
    {
        if (
is_user_connected(id))
        {            
            if (
get_user_team(id) == 3)
                
iTs++
        }
    }
    
    return 
iTs;

Pero no pude realizarlo , si alguien sabe como puedo hacerlo para hacerlo de una manera mejor que esta o simplemente ayudarme diciendome como puedo hacerlo se lo agradeceria! Desde ya muchas gracias! si necesitan alguna otra code pidanla aunque no creo que sea necesario.
__________________
No hay que apagar la luz de otro, para lograr que brille la nuestra. Gandhi
mcxr is offline
Send a message via MSN to mcxr Send a message via Skype™ to mcxr
MexPower
Veteran Member
Join Date: Nov 2012
Old 07-29-2013 , 16:26   Re: [CONSULTA] Identificar todos los spects online.
#2

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <cstrike>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

new g_maxplayers
public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
g_maxplayers get_maxplayers()
}
public 
clcmd_test(id)
    
client_print(idprint_chat"Numero de spectadores %d"get_spectators())
    
get_spectators()
{
    new 
num
    
for(new 1<= g_maxplayersi++)
    {
        if(
is_user_connected(i))
            continue; 
        
        if(!(
cs_get_user_team(i) == CS_TEAM_SPECTATOR|CS_TEAM_UNASSIGNED))
            continue;
            
        
num++
    }
    
    return 
num

Eso te serviria?
__________________
Allied Modders En Español
MexPower is offline
mcxr
Member
Join Date: Oct 2012
Location: Argen - tina
Old 07-29-2013 , 17:14   Re: [CONSULTA] Identificar todos los spects online.
#3

Gracias Mex, Esta seria una forma correcta de seleccionar un player spectador y tranferirlo CT ?
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <cstrike>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

new g_maxplayers
public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /test" "Test")
    
    
g_maxplayers get_maxplayers()
}
public 
clcmd_test(id)
    
client_print(idprint_chat"Numero de spectadores %d"get_spectators())
    
public 
Test(id) {
    
    new 
num
    
for(new 1<= g_maxplayersi++)
    {
        if(
is_user_connected(i))
            continue; 
        
        if(! (
cs_get_user_team(i) == CS_TEAM_SPECTATOR|CS_TEAM_UNASSIGNED) ) 
        {
            new 
Name[32];get_user_name(iNamecharsmax(Name))
            
cs_set_user_team(iCS_TEAM_CT)
            
client_print0print_chat"<AMXX> El jugador %s entra como CT."Name)
            
client_print0print_chat"Spectadores Restantes : %d"get_spectators())
        }
        
        
num++
    }
}

get_spectators()
{
    new 
num
    
for(new 1<= g_maxplayersi++)
    {
        if(
is_user_connected(i))
            continue; 
        
        if(!(
cs_get_user_team(i) == CS_TEAM_SPECTATOR|CS_TEAM_UNASSIGNED))
            continue;
            
        
num++
    }
    
    return 
num

__________________
No hay que apagar la luz de otro, para lograr que brille la nuestra. Gandhi

Last edited by mcxr; 07-29-2013 at 17:17.
mcxr is offline
Send a message via MSN to mcxr Send a message via Skype™ to mcxr
MexPower
Veteran Member
Join Date: Nov 2012
Old 07-29-2013 , 17:54   Re: [CONSULTA] Identificar todos los spects online.
#4

Quote:
Originally Posted by mcxr View Post
Gracias Mex, Esta seria una forma correcta de seleccionar un player spectador y tranferirlo CT ?
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <cstrike>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

new g_maxplayers
public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /test" "Test")
    
    
g_maxplayers get_maxplayers()
}
public 
clcmd_test(id)
    
client_print(idprint_chat"Numero de spectadores %d"get_spectators())
    
public 
Test(id) {
    
    new 
num
    
for(new 1<= g_maxplayersi++)
    {
        if(
is_user_connected(i))
            continue; 
        
        if(! (
cs_get_user_team(i) == CS_TEAM_SPECTATOR|CS_TEAM_UNASSIGNED) ) 
        {
            new 
Name[32];get_user_name(iNamecharsmax(Name))
            
cs_set_user_team(iCS_TEAM_CT)
            
client_print0print_chat"<AMXX> El jugador %s entra como CT."Name)
            
client_print0print_chat"Spectadores Restantes : %d"get_spectators())
        }
        
        
num++
    }
}

get_spectators()
{
    new 
num
    
for(new 1<= g_maxplayersi++)
    {
        if(
is_user_connected(i))
            continue; 
        
        if(!(
cs_get_user_team(i) == CS_TEAM_SPECTATOR|CS_TEAM_UNASSIGNED))
            continue;
            
        
num++
    }
    
    return 
num

Creo que no aunque no lo vi bien por el cel
pero usa
new user = random(get_spectators())
get_user_name(user....
__________________
Allied Modders En Español
MexPower is offline
ChileScripting
BANNED
Join Date: Jan 2013
Old 07-29-2013 , 19:26   Re: [CONSULTA] Identificar todos los spects online.
#5

Segun el code... Nunca habran espectadores

Last edited by ChileScripting; 07-29-2013 at 23:25.
ChileScripting is offline
mcxr
Member
Join Date: Oct 2012
Location: Argen - tina
Old 07-29-2013 , 19:38   Re: [CONSULTA] Identificar todos los spects online.
#6

Quote:
Originally Posted by ChileScripting View Post
Segun el code... Nunca abran espectadores
Fuiste de gran ayuda!

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <cstrike>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

new g_maxplayers
public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
g_maxplayers get_maxplayers()
    
    
// Add your code here...
}
fnGetSpects()
{
    static 
Sptsid
    Spts 
0
    
    
for (id 1id <= g_maxplayersid++)
    {
        if (
is_user_connected(id))
        {            
            if (
cs_get_user_team(id) == CS_TEAM_SPECTATOR)
                
Spts++
        }
    }
    
    return 
Spts;
}

public Function(
id)
{
    static 
Spects
    Spects 
fnGetSpects()
    
    for(new 
0<= Spects;i++)
    {
        if (
is_user_connected(id))
        {            
            new 
Name[32];get_user_name(iNamecharsmax(Name)) 
            
cs_set_user_team(iCS_TEAM_CT
            
            
client_print0print_chat"<AMXX> El jugador %s entra como CT."Name
            
client_print0print_chat"Spectadores Restantes : %d"fnGetSpects() )
        }
    }

Hize esto lo testie pero nunca funciono alguien que me de 1 mano, para revisar que sucede.
__________________
No hay que apagar la luz de otro, para lograr que brille la nuestra. Gandhi
mcxr is offline
Send a message via MSN to mcxr Send a message via Skype™ to mcxr
_Pro_
Senior Member
Join Date: Mar 2012
Location: Argentina
Old 07-29-2013 , 23:07   Re: [CONSULTA] Identificar todos los spects online.
#7

PHP Code:
/* Script generated by Pawn Studio */

#include <amxmodx>
#include <amxmisc>
#include <cstrike>

#define PLUGIN    "Plugin"
#define AUTHOR    "Gonza.-*"
#define VERSION    "1.0.0"

new g_MaxPlayers

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /test_ct""test")
    
register_clcmd("say /test_tt""test2")
    
    
g_MaxPlayers get_maxplayers()
}

public 
test(idCambiarTeam(idCS_TEAM_CT)

public 
test2(idCambiarTeam(idCS_TEAM_T)

public 
CambiarTeam(idCsTeams:TEAM)
{
    static 
i;
    
    for (
1<= g_MaxPlayersi++)
    {
        if (!
is_user_connected(i) || cs_get_user_team(i) != CS_TEAM_SPECTATOR) continue
        
        
client_print(iprint_chat"Fuiste transferido a %s"TEAM == CS_TEAM_CT "CT" "TT")
        
cs_set_user_team(iTEAM)
    }
    
client_print(0print_chat"Todos los SPEC fueron transferidos a %s"TEAM == CS_TEAM_CT "CT" "TT")

Te sirve?
_Pro_ is offline
Send a message via MSN to _Pro_ Send a message via Skype™ to _Pro_
Old 07-30-2013, 04:07
baneado
This message has been deleted by baneado. Reason: is_user_connected ya lo dijeron
 



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 20:44.


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