Raised This Month: $ Target: $400
 0% 

change player number


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
McTavish
Senior Member
Join Date: May 2021
Old 01-12-2023 , 10:32   Re: change player number
Reply With Quote #6

Quote:
Originally Posted by SoccerjamTR View Post
Thanks but i didn't understand because of my poor code knowledge. Can you edit the public for like that ?
I'm bad to I have little knowledge only try this :

Code:
public Offside(id)
{
    new PossCancha[MAX_PLAYER + 1][3], alive = 0
    new origin_x[3], team
    for(new i = 1; i <= MAX_PLAYER; i++)
    {
        if(is_user_alive(i) && !is_user_bot(i) && !is_user_hltv(i) && is_user_connected(i) && !user_is_keeper[i] && !soy_spec[i])
        {
            alive++
            get_user_origin(i, origin_x)
            team = get_user_team(i)
            PossCancha[alive][0] = i
            PossCancha[alive][1] = origin_x[0]
            PossCancha[alive][2] = team
        }
    }
    if(alive >= 3)
    {
        new ball_owner_team = get_user_team(ballowner)
        new temp
        if(ball_owner_team == 1)
        {
            for(new i = 1; i < alive; i++)
            {
                for(new j = i + 1; j <= alive; j++)
                {
                    if(PossCancha[i][1] > PossCancha[j][1])
                    {
                        temp = PossCancha[i]
                        PossCancha[i] = PossCancha[j]
                        PossCancha[j] = temp
                    }
                }
            }
        }
        else if(ball_owner_team == 2)
        {
            for(new i = 1; i < alive; i++)
            {
                for(new j = i + 1; j <= alive; j++)
                {
                    if(PossCancha[i][1] < PossCancha[j][1])
                    {
                        temp = PossCancha[i]
                        PossCancha[i] = PossCancha[j]
                        PossCancha[j] = temp
                    }
                }
            }
        }

        if(ball_owner_team != PossCancha[1][2])
            return false; 
        if(id == PossCancha[1][0] || id == PossCancha[2][0])
            return false;
        SentenceOffside(PossCancha[1][0], PossCancha[2][0])        
    }
}
This version of the Offside function increases the number of offside catching players to 2 by checking if the player ID passed to the function is equal to the ID of the first or second player in the sorted PossCancha array.
You can also increase the number of offside catching players to 3 by:
Code:
if(id == PossCancha[1][0] || id == PossCancha[2][0] || id == PossCancha[3][0])
Please keep in mind that increasing the offside catching player number may require other adjustments to the code to work correctly, so it's important to test the changes thoroughly.
__________________
No Steam = No Support.
McTavish is offline
 



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 07:59.


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