Raised This Month: $ Target: $400
 0% 

Useful Stock(S) [Any Game]


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Master53
Veteran Member
Join Date: Dec 2009
Old 12-06-2010 , 14:58   Useful Stock(S) [Any Game]
Reply With Quote #1

these are just some useful stocks which i'v made and collected over time.

Special thanks to "McFlurry" for his weapon stocks

Added:
GetTeamCount to get the amount of clients in spesific team.
PHP Code:
static UserMsg:FadeID;
static 
UserMsg:ShakeID;


stock SetEntityArmor(ClientArmor)
{

    
//Set Prop Data:
    
SetEntProp(ClientProp_Data"m_ArmorValue"Armor4);
}

stock GetClientScore(Client)
{

    
//Get Prop Data::
    
return GetEntProp(ClientProp_Data"m_iFrags");
}

stock SetClientScore(Clientscore)
{

    
//Set Prop Data:
    
SetEntProp(ClientProp_Data"m_iFrags"score);
}

stock HideHud(ClientType)
{

    
//Set Prop Data:
    
SetEntProp(ClientProp_Send"m_iHideHUD"Type);
}

stock SetClientDeath(Clientdeath)
{

    
//Set Prop Data:
    
SetEntProp(ClientProp_Data"m_iDeaths"death); 
}

stock GetClientDeath(Client)
{

    
//Get Prop Data:
    
return GetEntProp(ClientProp_Data"m_iDeaths");
}

stock SetEntityTimeScale(ClientFloat:fSpeed)
{

    
//Set Prop Data:
    
SetEntPropFloat(ClientProp_Data"m_flLaggedMovementValue"fSpeed);    
}

stock SetEntityMaxSpeed(ClientFloat:Speed)
{

    
//Declare:
    
new SpeedOffset = -1;

    
//Initialize:
    
SpeedOffset FindSendPropOffs("CBasePlayer""m_flMaxspeed");

    
//Set Speed:
    
if(SpeedOffset 0SetEntData(ClientSpeedOffsetSpeed4true);
}

stock SetEntitySkin(entitySkin:skin)
{

    
//Set Prop Send:
    
SetEntProp(entityProp_Send"m_nSkin"skin);
}

stock GetClientConVar(Client, const String:Name[], String:Value[64])
{  

    
//Get Client Convar Value:
    
QueryClientConVar(ClientNameConVarQueryFinished:ClientConVarClient);

    
//Initialize:
    
Value ConVarValue[Client];

    
//Return:
    
return Value
}

stock bool:IsAdmin(Client)
{

    
//Declare:
    
new Admin GetUserFlagBits(Client);

    
//Not Admin:
    
if(Admin != 0)
    {

        
//Return:
        
return true;       
    }

    
//Return:
    
return false;
}

stock GetTotalClients()
{

    
//Declare:
    
new count 0;

    
//Loop:
    
for(new 1<= GetMaxClients(); X++)
    {

        
//Connected:
        
if(IsClientConnected(X) && IsClientInGame(X))
        {

            
//Initialize:
            
count++;
        }
    }

    
//Return:
    
return count;
}

stock GetTeamCount(Team)
{

    
//Declare:
    
new count 0;

    
//Loop:
    
for(new 1<= GetMaxClients(); i++)
    {

        
//Connected:
        
if(IsClientConnected(i) && IsClientInGame(i) && GetClientTeam(i) == Team)
        {

            
//Initialize:
            
count++;
        }
    }

    
//Return:
    
return count;
}

//Get Weapon Count:
stock GetClientWeaponCount(Client)
{
    
//Declare:
    
new count 0;

    
//Loop:
    
for(new 0<= 10i++)
    {

        
//Declare:
        
new wep GetPlayerWeaponSlot(Clienti);

        
//Has Weapon:
        
if(wep != -1)
        {

            
//Initialize:
            
count++;
        }
    }

    
//Return:
    
return count;
}

//shake effect
stock Shake(ClientFloat:LengthFloat:Severity)
{

    
//Conntected:
    
if(IsClientConnected(Client) && IsClientInGame(Client))
    {

        
//User Messages:
        
ShakeID GetUserMessageId("Shake");

        
//Declare:
        
new SendClient[2];
        
SendClient[0] = Client;

        
//Handle:
        
new Handle:ViewMessage StartMessageEx(ShakeIDSendClient1);

        
//Write Handle:
        
BfWriteByte(ViewMessage0);
        
BfWriteFloat(ViewMessageSeverity);
        
BfWriteFloat(ViewMessage10.0);
        
BfWriteFloat(ViewMessageLength);

        
//Close:
        
EndMessage();
    }
}

public 
FadeClient(Clientbool:out)
{

    
//Conntected:
    
if(IsClientConnected(Client) && IsClientInGame(Client))
    {

        
//User Messages:
        
FadeID GetUserMessageId("Fade");

        
//Declare
        
new SendClient[2];
        
SendClient[0] = Client;

        
//Handle:
        
new Handle:ViewMessage StartMessageEx(FadeIDSendClient1);

        
//Write Handle:
        
BfWriteShort(ViewMessage3000); //fade time
        
BfWriteShort(ViewMessage0); //hold time
        
if (out)
        {

            
//Out and Stayout
            
BfWriteShort(ViewMessage0x0002|0x0008);
        }

        
//Override:
        
else
        {

            
//In Ignore Other Fades
            
BfWriteShort(ViewMessage0x0001|0x0010);
        }

        
//Red
        
BfWriteByte(ViewMessage25);

        
//Green
        
BfWriteByte(ViewMessage0);

        
//Blue
        
BfWriteByte(ViewMessage0);

        
//Alpha
        
BfWriteByte(ViewMessage250);

        
//Cloose:
        
EndMessage();
    }
}

//Bipass Cheats:
stock CheatCommand(Client, const String:command[], const String:arguments[])
{

    
//Connected:
    
if(IsClientConnected(Client) && IsClientInGame(Client))
    {

        
//Define:
        
new admindata GetUserFlagBits(Client);

        
//Set Client Flag Bits:
        
SetUserFlagBits(ClientADMFLAG_ROOT);

        
//Define:
        
new flags GetCommandFlags(command);

        
//Set Client Flags:
        
SetCommandFlags(commandflags & ~FCVAR_CHEAT);

        
//Command:
        
ClientCommand(Client"\"%s\" \"%s\""commandarguments);

        
//Set Client Flags:
        
SetCommandFlags(commandflags);

        
//Set Client Flag Bits:
        
SetUserFlagBits(Clientadmindata);
    }

    
//Return:
    
return;
}

//Stop Sound from all Channels:
stock StopSoundPerm(ClientString:sound[])
{

    
//Stop Sound:
    
StopSound(ClientSNDCHAN_AUTOsound);
    
StopSound(ClientSNDCHAN_WEAPONsound);
    
StopSound(ClientSNDCHAN_VOICEsound);
    
StopSound(ClientSNDCHAN_ITEMsound);
    
StopSound(ClientSNDCHAN_BODYsound);
    
StopSound(ClientSNDCHAN_STREAMsound);
    
StopSound(ClientSNDCHAN_VOICE_BASEsound);
    
StopSound(ClientSNDCHAN_USER_BASEsound);

__________________
Master(d)




Last edited by Master53; 02-02-2011 at 13:59. Reason: updated.
Master53 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 22:55.


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