AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   3on3, plugin OFF | 4onX plugin ON (https://forums.alliedmods.net/showthread.php?t=98948)

deLL 07-31-2009 03:41

3on3, plugin OFF | 4onX plugin ON
 
Hi,

I search the plugin or please write the plugin.

Description:
Code:

If a group of CT and TT 3 players after the plug is turned off.

If a group of CT or TT is more than 3 players plugin is enabled.

Sorry, I do not speak well in English.

Alucard^ 07-31-2009 09:12

Re: 3on3, plugin OFF | 4onX plugin ON
 
Quote:

Originally Posted by biscuit628 (Post 886518)
PHP Code:

#include <amxmodx>

new maxplayers
new ct_total,ts_total
public plugin_init(){
    
register_plugin("???","1.0","Biscuit")
    
register_event("HLTV""Roundstart""a""1=0""2=0")
    
maxplayers get_maxplayers()
}

public 
Roundstart()
{
    for(new 
<= maxplayers i++)
    {
        (
get_user_team(i) == 1) ? ts_total++ : ct_total++
    }
    
set_task(1.0,"control_plugin")
}

public 
control_plugin()
{
    if(
ts_total && ct_total 3)
    {
        
unpause("ac","plugin.amxx")
    }
    else
    {
        
pause("ac","plugin.amxx")
    }
    
ts_total 
    ct_total 
0


not tested..

I am new at scripting so i dont know if i am correct BUT...

PHP Code:

if(ts_total && ct_total 3

Maybe this should be -->

PHP Code:

if(ts_total || ct_total 3

Or i am wrong?

And... that i understand he want to check the group of ALL players (ct or tt) so.. i think the code should be:

PHP Code:

#include <amxmodx>

new maxplayers

public plugin_init()
{
    
register_plugin("???","1.0","Biscuit")
    
register_event("HLTV""Roundstart""a""1=0""2=0")
    
    
maxplayers get_maxplayers()
}

public 
Roundstart()
{
    for(new 
<= maxplayers i++)
    if(
3)
    {
        
unpause("ac","plugin.amxx")
    }
    else
    {
        
pause("ac","plugin.amxx")
    }


But well, i am not sure at this. Maybe i didnt understand at all.

PS: Oh, and i think the task is not necessary.

Xellath 07-31-2009 11:24

Re: 3on3, plugin OFF | 4onX plugin ON
 
@Alucard: You should think like this about "||":

PHP Code:

if ( what or what == // or = "||" 

Also, that for() loop wont work.

biscuit628 07-31-2009 12:17

Re: 3on3, plugin OFF | 4onX plugin ON
 
PHP Code:

#include <amxmodx>

new maxplayers
new ct_total,ts_total
public plugin_init(){
    
register_plugin("???","1.0","Biscuit")
    
register_event("HLTV""Roundstart""a""1=0""2=0")
    
maxplayers get_maxplayers()
}

public 
Roundstart()
{
    for(new 
<= maxplayers i++)
    {
        (
get_user_team(i) == 1) ? ts_total++ : ct_total++
    }
    
set_task(1.0,"control_plugin")
}

public 
control_plugin()
{
    if(
ts_total || ct_total 3)
    {
        
unpause("ac","plugin.amxx")
    }
    else if(
ts_total <= && ct_total <= 3)
    {
        
pause("ac","plugin.amxx")
    }
    
ts_total 
    ct_total 
0



Alucard^ 07-31-2009 14:11

Re: 3on3, plugin OFF | 4onX plugin ON
 
Quote:

Originally Posted by Xellath (Post 886631)
@Alucard: You should think like this about "||":

PHP Code:

if ( what or what == // or = "||" 

Also, that for() loop wont work.

Yes yes i know... my mistake :P


All times are GMT -4. The time now is 18:20.

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