AlliedModders

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

soumyadip77 04-26-2018 10:39

Help
 
Some one explain me what is the work on this read data i want to know


PHP Code:

public plugin_init()
{
register_plugin("""""");
    
register_event("TeamScore""score_new""a""");
}
public 
score_new()
{
    new 
team[32];
    
read_data(1team31);
    
    if (
v_inprogress == 2)
    {
        if (
team[0] == 67)
        {
            
v_CtScore[0] = read_data(2);
        }
        else
        {
            if (
team[0] == 84)
            {
                
v_TScore[0] = read_data(2);
            }
        }
    }
    else
    {
        if (
v_inprogress == 4)
        {
            if (
team[0] == 67)
            {
                
v_TScore[1] = read_data(2);
            }
            if (
team[0] == 84)
            {
                
v_CtScore[1] = read_data(2);
            }
        }
    }
    if (
v_inprogress == || v_inprogress == 4)
    {
        
maxround();
    }
    return 
0;

public 
maxround()
{
   
    if (
v_inprogress == && v_TScore[0][0] + v_CtScore[0][0] == 15)
    {
        
half_stop();
    }
    else
    {
        if (
v_inprogress == 4)
        {
            if (
rounds_played == 30)
            {
                
half_stop();
            }
            if (
v_CtScore[1][0] + v_CtScore[0][0] == 16 || v_TScore[1][0] + v_TScore[0][0] == 16)
            {
                
half_stop();
            }
        }
    }
    return 
0;



Bugsy 04-28-2018 12:32

Re: Help
 
Quote:

Originally Posted by soumyadip77 (Post 2589524)
Some one explain me what is the work on this read data i want to know

Are you asking what read_data() does? It reads arguments from the event.

TeamScore

Arg 1 is the team name associated with the score (TERRORIST or CT)
Arg 2 is the score for that team

soumyadip77 04-28-2018 21:45

Re: Help
 
Here read data work as a save score in variable right?

soumyadip77 04-28-2018 21:46

Re: Help
 
And when this event call??

Bugsy 04-28-2018 21:49

Re: Help
 
Yes and end of round, once for each team.

soumyadip77 04-29-2018 09:10

Re: Help
 
can i use any other variable replace of this ??

PHP Code:

new team[32]; 

and how read data gent only team score why not anything else..

Bugsy 04-29-2018 09:35

Re: Help
 
You read data based on which event you hooked. You can only read what exists for that specific event. For TeamScore, only team name and score are available.

https://wiki.alliedmods.net/Half-life_1_game_events


All times are GMT -4. The time now is 04:38.

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