Few more for organization :D

This commit is contained in:
zaCade 2019-09-29 10:37:23 +02:00
parent 99476979ad
commit 55a7885835
5 changed files with 67 additions and 67 deletions

View File

@ -414,17 +414,6 @@ stock bool:AntiStickIsModelBoxColliding(client1, client2)
return true; return true;
} }
/**
* Sets the collision group on a client.
*
* @param client The client index.
* @param collisiongroup Collision group flag.
*/
AntiStickSetCollisionGroup(client, collisiongroup)
{
SetEntProp(client, Prop_Data, "m_CollisionGroup", collisiongroup);
}
/** /**
* Gets the collision group on a client. * Gets the collision group on a client.
* *
@ -436,6 +425,17 @@ AntiStickGetCollisionGroup(client)
return GetEntProp(client, Prop_Data, "m_CollisionGroup"); return GetEntProp(client, Prop_Data, "m_CollisionGroup");
} }
/**
* Sets the collision group on a client.
*
* @param client The client index.
* @param collisiongroup Collision group flag.
*/
AntiStickSetCollisionGroup(client, collisiongroup)
{
SetEntProp(client, Prop_Data, "m_CollisionGroup", collisiongroup);
}
/** /**
* Converts a collision group value into a name. * Converts a collision group value into a name.
* *

View File

@ -36,6 +36,22 @@ CookiesInit()
ZHPOnCookiesCreate(); ZHPOnCookiesCreate();
} }
/**
* Returns a cookie value as a bool.
*
* @param client The client index.
* @param cookie The handle to the cookie.
*/
bool:CookiesGetClientCookieBool(client, Handle:cookie)
{
// Get cookie string.
decl String:cookievalue[8];
GetClientCookie(client, cookie, cookievalue, sizeof(cookievalue));
// Return string casted into an int, then to bool.
return bool:StringToInt(cookievalue);
}
/** /**
* Accepts a bools for setting client cookies. * Accepts a bools for setting client cookies.
* *
@ -54,19 +70,18 @@ CookiesSetClientCookieBool(client, Handle:cookie, bool:cookievalue)
} }
/** /**
* Returns a cookie value as a bool. * Gets a integer value from a cookie.
* *
* @param client The client index. * @param client The client index.
* @param cookie The handle to the cookie. * @param cookie The handle to the cookie.
*/ */
bool:CookiesGetClientCookieBool(client, Handle:cookie) CookiesGetInt(client, Handle:cookie)
{ {
// Get cookie string. decl String:strValue[16];
decl String:cookievalue[8]; strValue[0] = 0;
GetClientCookie(client, cookie, cookievalue, sizeof(cookievalue)); GetClientCookie(client, cookie, strValue, sizeof(strValue));
// Return string casted into an int, then to bool. return StringToInt(strValue);
return bool:StringToInt(cookievalue);
} }
/** /**
@ -85,18 +100,3 @@ CookiesSetInt(client, Handle:cookie, value)
// Set string value. // Set string value.
SetClientCookie(client, cookie, strValue); SetClientCookie(client, cookie, strValue);
} }
/**
* Gets a integer value from a cookie.
*
* @param client The client index.
* @param cookie The handle to the cookie.
*/
CookiesGetInt(client, Handle:cookie)
{
decl String:strValue[16];
strValue[0] = 0;
GetClientCookie(client, cookie, strValue, sizeof(strValue));
return StringToInt(strValue);
}

View File

@ -228,6 +228,18 @@ OverlaysChannel:OverlaysClientFindChannel(client)
return OVERLAYS_CHANNEL_NONE; return OVERLAYS_CHANNEL_NONE;
} }
/**
* Get current value of a channel state of a client.
*
* @param client The client index.
* @param channel The channel to get state of.
*/
bool:OverlaysClientGetChannelState(client, OverlaysChannel:channel)
{
// Return current value.
return g_bOverlayChannel[client][channel];
}
/** /**
* Toggle or set new value to a channel state of a client. * Toggle or set new value to a channel state of a client.
* *
@ -259,18 +271,6 @@ bool:OverlaysClientSetChannelState(client, OverlaysChannel:channel, bool:update
return g_bOverlayChannel[client][channel]; return g_bOverlayChannel[client][channel];
} }
/**
* Get current value of a channel state of a client.
*
* @param client The client index.
* @param channel The channel to get state of.
*/
bool:OverlaysClientGetChannelState(client, OverlaysChannel:channel)
{
// Return current value.
return g_bOverlayChannel[client][channel];
}
/** /**
* Set overlay path for a channel. * Set overlay path for a channel.
* *

View File

@ -71,10 +71,10 @@ stock ToolsGetClientVelocity(client, Float:vecVelocity[3])
} }
/** /**
* Gets client's velocity. * Sets client's velocity.
* *
* @param client The client index. * @param client The client index.
* @param vecVelocity Array to store vector in. * @param vecVelocity Velocity to set on client.
*/ */
stock ToolsSetClientVelocity(client, const Float:vecVelocity[3]) stock ToolsSetClientVelocity(client, const Float:vecVelocity[3])
{ {

View File

@ -116,6 +116,21 @@ WeaponAmmoOnOffsetsFound()
} }
} }
/**
* Get clip/reserve ammo on a weapon.
*
* @param weapon The weapon index.
* @param clip True gets clip ammo, false gets reserve.
*/
stock WeaponAmmoGetAmmo(weapon, bool:clip)
{
// Set variable to offset we are changing.
new ammooffset = clip ? g_iToolsClip1 : g_iToolsClip2;
// Return ammo offset value.
return GetEntData(weapon, ammooffset);
}
/** /**
* Set clip/reserve ammo on a weapon. * Set clip/reserve ammo on a weapon.
* *
@ -143,18 +158,14 @@ stock WeaponAmmoSetAmmo(weapon, bool:clip, value, bool:add = false)
} }
/** /**
* Get clip/reserve ammo on a weapon. * Get the count of any grenade-type a client has.
* *
* @param weapon The weapon index. * @param client The client index.
* @param clip True gets clip ammo, false gets reserve. * @param slot The type of
*/ */
stock WeaponAmmoGetAmmo(weapon, bool:clip) stock WeaponAmmoGetGrenadeCount(client, WeaponAmmoGrenadeType:type)
{ {
// Set variable to offset we are changing. return GetEntData(client, g_iToolsAmmo + (_:type * 4));
new ammooffset = clip ? g_iToolsClip1 : g_iToolsClip2;
// Return ammo offset value.
return GetEntData(weapon, ammooffset);
} }
/** /**
@ -179,17 +190,6 @@ stock WeaponAmmoSetGrenadeCount(client, WeaponAmmoGrenadeType:type, value, bool:
SetEntData(client, g_iToolsAmmo + (_:type * 4), ammovalue + value, _, true); SetEntData(client, g_iToolsAmmo + (_:type * 4), ammovalue + value, _, true);
} }
/**
* Get the count of any grenade-type a client has.
*
* @param client The client index.
* @param slot The type of
*/
stock WeaponAmmoGetGrenadeCount(client, WeaponAmmoGrenadeType:type)
{
return GetEntData(client, g_iToolsAmmo + (_:type * 4));
}
/** /**
* Takes a weapon entity and returns an entry in enum WeaponAmmoGrenadeType. * Takes a weapon entity and returns an entry in enum WeaponAmmoGrenadeType.
* *