Added periods after function comments, moved market handler code to markethandler.inc, made restrictions announced to the server

This commit is contained in:
Greyscale
2009-04-10 01:08:51 +02:00
parent 1e99bd64f3
commit d220eeee77
7 changed files with 132 additions and 378 deletions

View File

@ -137,64 +137,6 @@ bool:ZMarket(client)
return true;
}
public bool:Market_OnWeaponSelected(client, String:weaponid[])
{
if (!weaponid[0] || !IsPlayerAlive(client))
{
return false;
}
if (IsPlayerZombie(client))
{
ZR_PrintToChat(client, "Zombie cant use weapon");
return false;
}
if (StrEqual(weaponid, "rebuy"))
{
return true;
}
decl String:display[64];
decl String:weapon[32];
new price;
if (!Market_GetWeaponIDInfo(weaponid, display, weapon, price))
{
return false;
}
ReplaceString(weapon, sizeof(weapon), "weapon_", "");
if (WeaponRestrictIsRestricted(weapon))
{
ZR_PrintToChat(client, "Weapon is restricted", weapon);
return false;
}
new bool:buyzone = GetConVarBool(gCvars[CVAR_ZMARKET_BUYZONE]);
if (!IsClientInBuyZone(client) && buyzone)
{
ZR_PrintCenterText(client, "Market out of buyzone");
return false;
}
return true;
}
public Market_PostOnWeaponSelected(client, &bool:allowed)
{
if (!allowed)
{
return;
}
ZMarket(client);
}
ZSpawn(client)
{
new bool:spawn = GetConVarBool(gCvars[CVAR_ZSPAWN]);
@ -225,16 +167,6 @@ ZSpawn(client)
AddPlayerToList(client);
}
public Action:CollisionOn(Handle:timer, any:index)
{
if (!IsClientInGame(index))
{
return;
}
NoCollide(index, false);
}
ZHP(client)
{
new bool:zhp = GetConVarBool(gCvars[CVAR_ZHP]);