Raised This Month: $18 Target: $400
 4% 

Random Code Archive


Post New Thread Reply   
 
Thread Tools Display Modes
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 07-31-2020 , 06:07   Re: Random Code Archive
Reply With Quote #31

PHP Code:

bool GetWeaponAmmo
(int defIndexint &clip 0int &reserve 0)
{
    switch (
defIndex)
    {
        case 
1// deagle
        
{
            
clip 7;
            
reserve 35;
            return 
true;
        }

        case 
2233334// elite, mp5sd, mp7, mp9
        
{
            
clip 30;
            
reserve 120;
            return 
true;
        }
        
        case 
3// fiveseven
        
{
            
clip 20;
            
reserve 100;
            return 
true;
        }
        
        case 
4// glock
        
{
            
clip 20;
            
reserve 120;
            return 
true;
        }
        
        case 
781639// ak47, aug, m4a4, sg556
        
{
            
clip 30;
            
reserve 90;
            return 
true;
        }
        
        case 
9// awp
        
{
            
clip 10;
            
reserve 30;
            return 
true;
        }
        
        case 
10// famas
        
{
            
clip 25;
            
reserve 90;
            return 
true;
        }
        
        case 
1138// g3sg1, scar20
        
{
            
clip 20;
            
reserve 90;
            return 
true;
        }
        
        case 
13// galil
        
{
            
clip 35;
            
reserve 90;
            return 
true;
        }
        
        case 
14// m249
        
{
            
clip 100;
            
reserve 200;
            return 
true;
        }
        
        case 
17// mac10
        
{
            
clip 30;
            
reserve 100;
            return 
true;
        }
        
        case 
19// p90
        
{
            
clip 50;
            
reserve 100;
            return 
true;
        }
        
        case 
24// ump45
        
{
            
clip 25;
            
reserve 100;
            return 
true;
        }
        
        case 
2529// xm014, sawedoff
        
{
            
clip 7;
            
reserve 32;
            return 
true;
        }
        
        case 
26// bizon
        
{
            
clip 64;
            
reserve 120;
            return 
true;
        }
        
        case 
27// mag7
        
{
            
clip 5;
            
reserve 32;
            return 
true;
        }
        
        case 
28// negev
        
{
            
clip 150;
            
reserve 200;
            return 
true;
        }
        
        case 
30// tec9
        
{
            
clip 24;
            
reserve 120;
            return 
true;
        }
        
        case 
32// hkp
        
{
            
clip 13;
            
reserve 52;
            return 
true;
        }
        
        case 
35// nova
        
{
            
clip 8;
            
reserve 32;
            return 
true;
        }
        
        case 
36// p250
        
{
            
clip 13;
            
reserve 26;
            return 
true;
        }
        
        case 
40// ssg08
        
{
            
clip 10;
            
reserve 100;
            return 
true;
        }
        
        case 
60// m4a1-s
        
{
            
clip 25;
            
reserve 75;
            return 
true;
        }
        
        case 
61// usp-s
        
{
            
clip 12;
            
reserve 24;
            return 
true;
        }
        
        case 
63// cz75
        
{
            
clip 12;
            
reserve 12;
            return 
true;
        }
        
        case 
64// revolver
        
{
            
clip 8;
            
reserve 8;
            return 
true;
        }
    }
    
    return 
false;

PHP Code:

int GetRoundDuration
()
{
    return 
GameRules_GetProp("m_iRoundTime");
}

int SetRoundDuration(int time)
{
    
GameRules_SetProp("m_iRoundTime"time);
}

int GetRoundTimeLeft()
{
    return 
GetRoundDuration() - GetRoundTimeSpent();
}

int GetRoundTimeSpent()
{
    return 
RoundToZero(GetGameTime() - GetRoundStartTime());
}

float GetRoundStartTime()
{
    return 
GameRules_GetPropFloat("m_fRoundStartTime");
}

bool HasMatchStarted()
{
    return 
view_as<bool>(GameRules_GetProp("m_bHasMatchStarted"));
}

bool HasRoundEnded()
{
    return 
view_as<bool>(GameRules_GetProp("m_iRoundWinStatus"));
}

bool HasMapEnded()
{
    return (
GameRules_GetProp("m_gamePhase") == 5);
}

void ChangeRoundTimeLeft(int newTime)
{
    if (
HasRoundEnded())
    {
        return;
    }
    
    
int spentTime GetRoundTimeSpent();
    if (
GetRoundDuration() - spentTime newTime)
    {
        
SetRoundDuration(spentTime newTime);
    }

PHP Code:

void RemoveClientWeapons
(int client)
{   
    
int length GetEntPropArraySize(clientProp_Send"m_hMyWeapons");
    for (
int i 0lengthi++) 
    {
        
int weapon GetEntPropEnt(clientProp_Send"m_hMyWeapons"i); 
        if (
weapon != -1)
        {
            
RemovePlayerItem(clientweapon);
            
AcceptEntityInput(weapon"Kill");
        }
    }
    
    
SetEntPropEnt(clientProp_Send"m_hActiveWeapon", -1);

__________________
Ilusion9 is offline
Reply


Thread Tools
Display Modes

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:23.


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