Skip to content
This repository has been archived by the owner on Oct 18, 2023. It is now read-only.

Commit

Permalink
ShuffleString, Defines, Fixes
Browse files Browse the repository at this point in the history
The stock and defines were requested by NiGHT.
  • Loading branch information
K4ryuu committed Jun 8, 2022
1 parent a6a3728 commit 4519802
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 4 deletions.
9 changes: 7 additions & 2 deletions src/karyuu/client.inc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#define MAX_AUTH_LENGTH 21
#define MAX_IP_LENGTH 23

#define KARYUU_LOOP_CLIENTS(%1) for (int %1 = 1; %1 <= MAXPLAYERS + 1; %1++) if (IsClientInGame(%1))
#define KARYUU_LOOP_PLAYERS(%1) for (int %1 = 1; %1 <= MAXPLAYERS + 1; %1++) if (IsClientInGame(%1) && !IsFakeClient(%1))
#define KARYUU_LOOP_CLIENTS(%1) for (int %1 = 1; %1 <= MAXPLAYERS; %1++) if (IsClientInGame(%1))
#define KARYUU_LOOP_PLAYERS(%1) for (int %1 = 1; %1 <= MAXPLAYERS; %1++) if (IsClientInGame(%1) && !IsFakeClient(%1))

enum WaterLevel
{
Expand Down Expand Up @@ -244,6 +244,11 @@ stock int Karyuu_GetClientDeaths(int iClient)
return GetEntProp(iClient, Prop_Data, "m_iDeaths");
}

stock int Karyuu_GetClientMoney(int iClient)
{
return GetEntProp(iClient, Prop_Send, "m_iAccount");
}

stock void Karyuu_SetClientMoney(int iClient, int iValue)
{
SetEntProp(iClient, Prop_Send, "m_iAccount", iValue);
Expand Down
22 changes: 22 additions & 0 deletions src/karyuu/variable/strings.inc
Original file line number Diff line number Diff line change
Expand Up @@ -206,4 +206,26 @@ stock int Karyuu_CountChar(int character, const char[] string)
count++;
}
return count;
}

stock void Karyuu_ShuffleString(char[] sBuffer, int iSize)
{
ArrayList arTemp = new ArrayList();

for (int iCount = 0; iCount < iSize; iCount++)
{
if (sBuffer[iCount] == EOS)
break;

arTemp.Push(sBuffer[iCount]);
}

arTemp.Sort(Sort_Random, Sort_String);

int iarSize = arTemp.Length;
for (int iCount = 0; iCount < iarSize; iCount++)
{
sBuffer[iCount] = view_as<char>(arTemp.Get(iCount));
}
delete arTemp;
}
20 changes: 18 additions & 2 deletions src/karyuu/weapon.inc
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,24 @@

#define MAX_WEAPON_CLASSNAME_LENGTH 24
#define MAX_WEAPON_NAME_LENGTH 48
#define MAX_WEAPON_PREFIX_LENGTH 6
#define MAX_WEAPONS 48
#define MAX_WEAPON_PREFIX_LENGTH 6
#define MAX_WEAPONS 48

#define Karyuu_HITGROUP_GENERIC 0
#define Karyuu_HITGROUP_HEAD 1
#define Karyuu_HITGROUP_CHEST 2
#define Karyuu_HITGROUP_STOMACH 3
#define Karyuu_HITGROUP_LEFTARM 4
#define Karyuu_HITGROUP_RIGHTARM 5
#define Karyuu_HITGROUP_LEFTLEG 6
#define Karyuu_HITGROUP_RIGHTLEG 7
#define Karyuu_HITGROUP_GEAR 10

#define Karyuu_HEGrenadeOffset 14
#define Karyuu_FlashbangOffset 15
#define Karyuu_SmokegrenadeOffset 16
#define Karyuu_IncGrenadesOffset 17
#define Karyuu_DecoyGrenadeOffset 18

char gKaryuu_WeaponClasses[][] = {
/* 0*/ "weapon_awp", /* 1*/ "weapon_ak47", /* 2*/ "weapon_m4a1", /* 3*/ "weapon_m4a1_silencer", /* 4*/ "weapon_deagle", /* 5*/ "weapon_usp_silencer", /* 6*/ "weapon_hkp2000", /* 7*/ "weapon_glock", /* 8*/ "weapon_elite",
Expand Down

0 comments on commit 4519802

Please sign in to comment.