PDA

View Full Version : Counter-Strike SDK


Arkshine
04-02-2010, 11:02
Counter-Strike SDK
- last updated : 2 apr 2010




The purpose is obviously not to provide a full working and compilable project
but only showing the content of some functions to know more on some CS specificities,
understanding the flow of some features, extracting useful datas thus creating better plugins
which should be more finely, intelligently, and efficiently coded.

So, from now I'm starting to release there as many function as I can gradually as time passes.
If people want to help, they are welcomed, though you should be aware it requires a lot of times.

As side notes I don't know much C/C++ so there will be probably some typos and sometimes
you will see pawn syntax. Unless it must be fixed, don't bother me with details.

I've started recently, don't expect to see all the functions at once.
I will try to keep one post by class, so I can explain things if need,
like the offsets related to the function, or from where is called such function.

Credits to HLSDK and HL2SDK.

EDIT: Now the project has been moved at : https://github.com/Arkshine/CSSDK
EDIT2: Another project by s1lentq, more complete at: https://github.com/s1lentq/ReGameDLL_CS. Consider checking this one instead.

Arkshine
04-02-2010, 11:09
* snip *

Seta00
04-02-2010, 11:10
Nice job!

EDIT: In player.cpp, lines 231 and 241, you're assigning instead of comparing:
if ( g_pGameRules->m_bCTCantBuy && m_iTeam = TEAM_CT )
...
if ( g_pGameRules->m_bTCantBuy && m_iTeam = TEAM_TERRORIST )

Arkshine
04-02-2010, 11:16
*snip*

Arkshine
04-02-2010, 11:18
Thanks, it will be fixed for the next version.

Arkshine
04-02-2010, 11:22
*snip*

Asd'
04-02-2010, 11:24
Arkshine, Nice job.
Regards.

Arkshine
04-02-2010, 11:27
*snip*

Arkshine
04-02-2010, 11:33
*snip*

Arkshine
04-02-2010, 11:37
*snip*

xPaw
04-02-2010, 11:49
Woop, god like!

valve doesn't give us source codes? We arkshine can make own! :mrgreen:

edit:
BOOL CBasePlayer::NeedsArmor()
{
return !m_iKevelar || pev->armorvalue < 50;
}

Seta00
04-02-2010, 11:54
In weapon_awp.cpp, line 153:
void CAWP::AUGFire
should be:
void CAWP::AWPFire

----------------------

In multiplay_gamerules.cpp, lines 238, 245, 252 and 259, you're using sprintf incorrectly (I'm not sure what you meant, but it was probably a ClientPrint)
In the same file, line 268, there's an incomplete statement:
m_ =

joropito
04-02-2010, 13:22
I think Arkshine went crazy doing this :P

Good job, very useful.

Arkshine
04-02-2010, 13:44
Well, you may right because there is still so much to post. :mrgreen:

@seta00 : Thanks, it's fixed. About sprintf, it's actually ALERT().

Arkshine
04-02-2010, 14:11
*snip*

joropito
04-02-2010, 14:16
Arkshine, your anchor tag is not working between pages

Arkshine
04-02-2010, 14:17
*snip*

Arkshine
04-02-2010, 14:21
Arkshine, your anchor tag is not working between pages
Damn. It sucks putting directly the link, it will open each time a tab/windows. But no choice if I keep to release there. :/

xPaw
04-02-2010, 15:34
You should create some small page atleast on wiki

Arkshine
04-02-2010, 15:51
Later. When there will too much data I will migrate all on the wiki. But right now it's only the beginning and I prefer sharing here, seeing feedbacks, adjusting the contents etc..

Dr.G
04-02-2010, 17:13
are there any m_CollisionGroup like offset in HL1 ? Iam thinkin a NoBlock plugin like this for HL1 -> http://forums.alliedmods.net/showthread.php?p=746250

Seta00
04-02-2010, 17:47
now it's only the beginning

:shock::shock::shock:

By the way, how exactly are you doing this?

Arkshine
04-02-2010, 18:04
IDA pro + HLSDK + a lot of times ( because you need to check, recheck, searching, guessing, switching between linux/windows IDA output etc.. IDA is a motherfucker sometimes you have to be careful :/ )


@Dr.G : No idea right now.

Exolent[jNr]
04-02-2010, 20:03
This is amazing! :D

joropito
04-02-2010, 21:53
I need this :)


CBaseSpectator

Immortal_BLG
04-02-2010, 22:14
Maybe useful for somebody....

List of game events for TheBots, TheTutor, ... OnEvent() function

enum GameEventType_t
{
GameEventType_PLAYER_ATTACK = 1u, // tell bots the player is attack (argumens: 1 = attacker, 2 = NULL)
GameEventType_PLAYER_ATTACK_WITHOUT_CLIP_AMMO , // tell bots the player is attack without clip ammo (argumens: 1 = attacker, 2 = NULL)
GameEventType_PLAYER_RELOAD_WEAPON, // tell bots the player is reloading his weapon (argumens: 1 = reloader, 2 = NULL)

GameEventType_GRENADE_EXPLODED, // tell bots the HE grenade is exploded (argumens: 1 = grenade thrower, 2 = NULL)
GameEventType_FLASHBANG_EXPLODED, // tell bots the flashbang grenade is exploded (argumens: 1 = grenade thrower, 2 = explosion origin)
GameEventType_SMOKE_GRENADE_EXPLODED, // tell bots the smoke grenade is exploded (argumens: 1 = grenade thrower, 2 = NULL)

GameEventType_PLAYER_FLASHED = 9u, // tell bots the player is flashed (argumens: 1 = flashed player, 2 = NULL)
GameEventType_PLAYER_RUNNING, // tell bots the player is running (argumens: 1 = runner, 2 = NULL)
GameEventType_PLAYER_JUMPED, // tell bots the player is jumped (argumens: 1 = jumper, 2 = NULL)
GameEventType_PLAYER_KILLED, // tell bots the player is killed (argumens: 1 = victim, 2 = killer)
GameEventType_PLAYER_FELL_WITH_DAMAGE, // tell bots the player is fell with some damage (argumens: 1 = felled player, 2 = NULL)
GameEventType_PLAYER_TAKE_DAMAGE, // tell bots the player is take damage (argumens: 1 = victim, 2 = attacker)
GameEventType_PLAYER_INJURED_HOSTAGE, // tell bots the player has injured a hostage (argumens: 1 = hostage, 2 = injurer)
GameEventType_PLAYER_KILLED_HOSTAGE, // tell bots the player has killed a hostage (argumens: 1 = hostage, 2 = killer)

GameEventType_DOOR_MOVING, // tell bots the door is moving (argumens: 1 = door, 2 = NULL)

GameEventType_GLASS_BREAK, // tell bots the glass has break (argumens: 1 = glass, 2 = NULL)
GameEventType_WOOD_BREAK, // tell bots the wood has break (argumens: 1 = wood, 2 = NULL)
GameEventType_METAL_BREAK, // tell bots the metal/computer has break (argumens: 1 = metal/computer, 2 = NULL)
GameEventType_FLESH_BREAK, // tell bots the flesh has break (argumens: 1 = flesh, 2 = NULL)
GameEventType_CONCRETE_BREAK, // tell bots the concrete has break (argumens: 1 = concrete, 2 = NULL)

GameEventType_BOMB_PLANTED, // tell bots the bomb has been planted (argumens: 1 = planter, 2 = NULL)
GameEventType_BOMB_DROPPED, // tell bots the bomb has been dropped (argumens: 1 = NULL, 2 = NULL)
GameEventType_BOMB_PICKUP, // let the bots hear the bomb pickup (argumens: 1 = player that pickup c4, 2 = NULL)
GameEventType_BOMB_BEEP, // let the bots hear the bomb beeping (argumens: 1 = c4, 2 = NULL)
GameEventType_BOMB_DEFUSING, // tell the bots someone has started defusing (argumens: 1 = defuser, 2 = NULL)
GameEventType_BOMB_DEFUSE_ABORTED, // tell the bots someone has aborted defusing (argumens: 1 = NULL, 2 = NULL)
GameEventType_BOMB_DEFUSED, // tell the bots the bomb is defused (argumens: 1 = defuser, 2 = NULL)
GameEventType_BOMB_EXPLODED, // let the bots hear the bomb exploding (argumens: 1 = NULL, 2 = NULL)

GameEventType_HOSTAGE_USED, // tell bots the hostage is used (argumens: 1 = user, 2 = NULL)
GameEventType_HOSTAGE_RESCUED, // tell bots the hostage is rescued (argumens: 1 = rescuer (Classes::BasePlayer *), 2 = hostage (Classes::Hostage *))
GameEventType_ALL_HOSTAGES_RESCUED, // tell bots the all hostages are rescued (argumens: 1 = NULL, 2 = NULL)

GameEventType_VIP_ESCAPED, // tell bots the VIP is escaped (argumens: 1 = NULL, 2 = NULL)
GameEventType_VIP_ASSASSINATED, // tell bots the VIP is assassinated (argumens: 1 = NULL, 2 = NULL)

GameEventType_TERRORISTS_WIN, // tell bots the terrorists won the round (argumens: 1 = NULL, 2 = NULL)
GameEventType_CTS_WIN, // tell bots the CTs won the round (argumens: 1 = NULL, 2 = NULL)

GameEventType_ROUND_DRAW, // tell bots the round was a draw (argumens: 1 = NULL, 2 = NULL)

GameEventType_ROUND_START = 41u, // tell bots the round was started (when freeze period is expired) (argumens: 1 = NULL, 2 = NULL)
GameEventType_PLAYER_SPAWN, // tell bots the player is spawned (argumens: 1 = spawned player, 2 = NULL)
GameEventType_ROUND_RESTART = 44u, // tell bots the round was restarted (argumens: 1 = NULL, 2 = NULL)
GameEventType_PLAYER_START_OBSERVER = 46u, // tell bots the player is sart observer (argumens: 1 = observer player, 2 = NULL)
GameEventType_BUY_MENU_OPEN = 53u, // tell bots the buy menu is opened (argumens: 1 = NULL, 2 = NULL)

// Radio commands.... (argumens: 1 = radio command sender, 2 = NULL)
GameEventType_RADIO_Cover_me = 65u,
GameEventType_RADIO_You_take_the_point,
GameEventType_RADIO_Hold_this_position,
GameEventType_RADIO_Regroup_team,
GameEventType_RADIO_Follow_me,
GameEventType_RADIO_Taking_fire,

GameEventType_RADIO_Go_go_go = 72u,
GameEventType_RADIO_Team_fall_back,
GameEventType_RADIO_Stick_together_team,
GameEventType_RADIO_Get_in_position_and_wait,
GameEventType_RADIO_Storm_the_front,
GameEventType_RADIO_Report_in_team,

GameEventType_RADIO_Affirmative = 79u,
GameEventType_RADIO_Enemy_spotted,
GameEventType_RADIO_Need_backup,
GameEventType_RADIO_Sector_clear,
GameEventType_RADIO_In_position,
GameEventType_RADIO_Reporting_in,
GameEventType_RADIO_Get_out_of_there,
GameEventType_RADIO_Negative,
GameEventType_RADIO_Enemy_down,

GameEventType_GAME_RESET = 89u, // tell bots the game is reset (argumens: 1 = NULL, 2 = NULL)
GameEventType_PLAYER_SWITCH_TEAM, // tell bots the player is switch his team (also called from ClientPutInServer()) (argumens: 1 = switcher, 2 = NULL)
GameEventType_PLAYER_SHOOT_AT_WALL, // tell bots the player is shoot at wall (argumens: 1 = shooter, 2 = shoot trace end position)
GameEventType_GAME_COMMENCING, // tell bots the game is commencing (argumens: 1 = NULL, 2 = NULL)
GameEventType_PLAYER_SWITCH_WEAPON_ZOOM, // tell bots the player is switch weapon zoom (argumens: 1 = zoom switcher, 2 = NULL)
GameEventType_HOSTAGE_TALKING // tell bots the hostage is talking (argumens: 1 = listener, 2 = NULL)
};

Arkshine
04-03-2010, 06:04
I need this :)

Actually it's the same as HLSDK, just checked.

What you need would be probably :

CBasePlayer::Observer_CheckProperties()
CBasePlayer::Observer_CheckTarget()
CBasePlayer::Observer_FindNextPlayer()
CBasePlayer::Observer_HandleButtons()
CBasePlayer::Observer_IsValidTarget()
CBasePlayer::Observer_SetMode()

What do you search ?


List of game events for TheBots, TheTutor, ... OnEvent() function

Thanks, I will update the code.

wrecked_
04-03-2010, 10:45
Fabulous work, Arkshine.

joropito
04-03-2010, 11:12
Actually it's the same as HLSDK, just checked.

What you need would be probably :

CBasePlayer::Observer_CheckProperties()
CBasePlayer::Observer_CheckTarget()
CBasePlayer::Observer_FindNextPlayer()
CBasePlayer::Observer_HandleButtons()
CBasePlayer::Observer_IsValidTarget()
CBasePlayer::Observer_SetMode()

What do you search ?


I think I need HandleButtons.

I wonder if Observer stands for spectator player or just hltv.
I need spectator.

Arkshine
04-03-2010, 11:53
Something like :


void CBasePlayer::Observer_HandleButtons()
{
if ( m_flNextObserverInput <= gpGlobals->time )
{
int mode;

if ( m_afButtonPressed & IN_JUMP )
{
switch ( pev->iuser1 )
{
case 1, 2 : mode = 4;
case 3 : mode = 5;
case 4 : mode = 3;
case 5 : mode = 6;
default : mode = m_fObserverAutoDirector ? 1 : 2;
}

Observer_SetMode( mode );
}

if ( m_afButtonPressed & IN_ATTACK )
{
Observer_FindNextPlayer( 0, 0 );
}

else if ( m_afButtonPressed & IN_ATTACK2 )
{
Observer_FindNextPlayer( 1, 0 );
}

m_flNextObserverInput = gpGlobals->time + 0.2;
}
}


I don't know how to name the offsets. You ask now you have to give names. :mrgreen:

joropito
04-03-2010, 12:13
Thanks.

FYI and from hlsdk:

m_flOffsetPlayer100 -> m_flNextObserverInput

I found observer.cpp only on ricochet & dmc

Arkshine
04-03-2010, 12:32
Nice catch. :mrgreen:

Will take a look too.

ConnorMcLeod
04-04-2010, 01:49
else if ( m_afButtonPressed & IN_FORWARD )

Shoud rather be IN_ATTACK2

Observer_FindNextPlayer( 1, 0 )
First param could be something like Next/Previous, and i think that 2nd param could be about allowed players, like team specific param.

Arkshine
04-04-2010, 05:25
It's weird because I see for both linux/window IDA output "& 8" ; but it makes sens it should be IN_ATTACK2. ( EDIT : Ah I think I know why )

About the last param, the type is a string, it seems to be an optional param to search directly a player by its name. Looking at the function I see a check done in a loop with this param and m_hObserverTarget->pev->netname.

Anyway it should look now like :


#define OBS_NONE 0
#define OBS_CHASE_LOCKED 1
#define OBS_CHASE_FREE 2
#define OBS_ROAMING 3
#define OBS_IN_EYE 4
#define OBS_MAP_FREE 5
#define OBS_MAP_CHASE 6

void CBasePlayer::Observer_HandleButtons()
{
if ( m_flNextObserverInput > gpGlobals->time )
{
return;
}

if ( m_afButtonPressed & IN_JUMP )
{
int mode;

switch ( pev->iuser1 )
{
case OBS_CHASE_LOCKED :
case OBS_CHASE_FREE : mode = OBS_IN_EYE;
case OBS_IN_EYE : mode = OBS_ROAMING;
case OBS_ROAMING : mode = OBS_MAP_FREE;
case OBS_MAP_FREE : mode = OBS_MAP_CHASE;
default : mode = m_fObserverAutoDirector ? OBS_CHASE_LOCKED : OBS_CHASE_FREE;
}

Observer_SetMode( mode );
}

if ( m_afButtonPressed & IN_ATTACK )
{
Observer_FindNextPlayer( FALSE );
}
else if ( m_afButtonPressed & IN_ATTACK2 )
{
Observer_FindNextPlayer( TRUE );
}

m_flNextObserverInput = gpGlobals->time + 0.2;
}

joropito
04-04-2010, 11:13
From cl_dll/hud_spectator.cpp

FindNextPlayer( (ButtonPressed & IN_ATTACK2) ? true:false );


I wonder if you, Arkshine, are getting only assembler code with IDA or something else that can help to move it to C.

It was hard to my to understand the structure of the decompiled code.

Arkshine
04-04-2010, 11:36
For sure, we can reduce the code like that. I know there are some functions which are taken from the Client and modified on the server like StudioEstimateGait().

I'm not enough crazy to try to decompile from the disassembled code !! :mrgreen: I don't have the knowledge to start ( even though I've read severals asm tutorials ). I'm using a decompiler provided with IDA which greatly help by given a nearly C output. Even with that, it takes a lot of time to understand because the output is often weird and you have to read carefully, following the goto, thinking if the structure is right, filtering between virtual functions, entities data, etc., switching between windows/linux decompiled binary because the output differs and you can have an output more pertinent than the other. For example CBasePlayer::Killed() takes me ~2h ( without counting the time to search what does some things ), though I have to finish one part yet. So, you can imagine without decompiled code it would take so much more time. :)

By the way, I'm thinking to actually try to reproduce a decent SDK with header and such, so I could use Doxygen (http://www.stack.nl/~dimitri/doxygen/) to generate a documentation system like we can see for metamod (http://metamod.org/sdk/dox/index.html). This way it would be better to see the relations and references. I wanted to do that manually but the forum or the wiki suck as hell. I think it's a more appropriate solution instead of posting like I do.

EXteRmiNaToR
04-04-2010, 11:56
By the way, I'm thinking to actually try to reproduce a decent SDK with header and such, so I could use Doxygen (http://www.stack.nl/~dimitri/doxygen/) to generate a documentation system like we can see for metamod (http://metamod.org/sdk/dox/index.html). This way it would be better to see the relations and references. I wanted to do that manually but the forum or the wiki suck as hell. I think it's a more appropriate solution instead of posting like I do.It's the best that way!:)

joropito
04-04-2010, 12:12
Another way is to start a Google Code project and put all together in SVN to you can upload updates with revision control.
You have code parsing and you can search inside the SVN too so it's very useful.

Arkshine
04-04-2010, 12:23
In waiting to have more file and a good structure to use Doxygen, I could use for sure a Google Code project so people could help more easily, especially people knowing very well C/C++ who could fix easily typos/errors and such. Thanks for the suggestions.

Seta00
04-04-2010, 15:04
In waiting to have more file and a good structure to use Doxygen, I could use for sure a Google Code project so people could help more easily, especially people knowing very well C/C++ who could fix easily typos/errors and such. Thanks for the suggestions.

I support this completely.
By the way:
m_iNumEscapers = 0 missing a semicolon.

Arkshine
04-04-2010, 15:13
I think you will be a great help, Seta00. :mrgreen:

joropito
04-04-2010, 16:09
I'm using a decompiler provided with IDA which greatly help by given a nearly C output. Even with that, it takes a lot of time to understand because the output is often weird and you have to read carefully, following the goto, thinking if the structure is right, filtering between virtual functions, entities data, etc., switching between windows/linux decompiled binary because the output differs and you can have an output more pertinent than the other.

Is this what you get?
I was using an old version of IDA, that was my problem.


int __cdecl CAK47__PrimaryAttack(int a1)
{
int v1; // eax@1
long double v2; // fst7@2
float v3; // ST34_4@3
__int16 v4; // fps@3
char v5; // c0@3
char v6; // c2@3
char v7; // c3@3
float v9; // ST44_4@5
float v10; // ST44_4@6

v1 = **(_DWORD **)(a1 + 180);
if ( !(*(_BYTE *)(v1 + 421) & 2) )
{
v2 = *(float *)(a1 + 264) * 0.4;

Arkshine
04-04-2010, 16:45
Yes, but there it's easy to understand because this function is short without complex structure, just some "if" here.

joropito
04-04-2010, 16:51
Yes, but there it's easy to understand because this function is short without complex structure, just some "if" here.

Sure, it was an example.
Now I understand what you said to me in PM about offsets.
I was confused because I was not seeing the same as you but everything it's clear now.

I was playing with engine_i386.so too :)

Arkshine
04-04-2010, 17:05
Sorry, it's hard to explain advanced stuff when my english is quite limited. :/

In engine_i386 there are a lot of interesting thing to see too but it will be harder to decompile. :) There is too much to do, I would like to have more brain and having the hability to stop the time. :mrgreen:

joropito
04-04-2010, 17:12
I would like to have more brain and having the hability to stop the time. :mrgreen:

Yeah, that's one of the four things we have to do

Four inventions that could have changed the world (http://www.friedpost.com/sciencetech/four-inventions-that-could-have-changed-the-world-94.html)

Btw, you can lower Brain->nexthink() time steps. It's a workaround but it works :mrgreen:

Seta00
04-05-2010, 14:49
if ( m_flAccuracy > 1.25 ) )
:arrow:
if ( m_flAccuracy > 1.25 )

EDIT:
I think you will be a great help, Seta00. :mrgreen:=D

Arkshine
04-06-2010, 17:54
Following the joropito's suggestion, i've created a project (http://code.google.com/p/cs-sdk) on code.google.com. So, if someone want to contribute, please give me your Google account email to be added as committers.

Seta00
04-06-2010, 19:00
You should GPL the SDK ASAP.

Edit: I've created a Ohloh project for the SDK, since its code analysis tool is the best I've seen: https://www.ohloh.net/p/cs-sdk

I've just found out the code analysis is already done! And by the way, only 1 comment line :mrgreen:

Arkshine
04-06-2010, 19:29
Nice. It's fast. :mgreen: But I thought it was something added automatically ?

We should comment much more anyway. :twisted:

Seta00
04-06-2010, 19:36
But I thought it was something added automatically ?

Yeah, but the last time I've registered a project it took about one day to fill in the code analysis (probably because it was much bigger than this one)

xPaw
04-07-2010, 09:12
I would like to know offset m_iUnBalancedRounds from multiplayer_gamerules.cpp

Arkshine
04-07-2010, 09:30
Try :


[
{
"name" : "m_iUnBalancedRounds",
"type" : "int",
"memoryType" : "data",
"identifiers" :
[
{
"os" : "windows",
"mod" : "cstrike",
"value" : 208
},
{
"os" : "linux",
"mod" : "cstrike",
"value" : 200
}
]
}
]

xPaw
04-07-2010, 09:34
Try :


[
{
"name" : "m_iUnBalancedRounds",
"type" : "int",
"memoryType" : "data",
"identifiers" :
[
{
"os" : "windows",
"mod" : "cstrike",
"value" : 208
},
{
"os" : "linux",
"mod" : "cstrike",
"value" : 200
}
]
}
]

hm orpheu sig, isn't its possible with normal offsets (lol) to use with [g/s]et_pdata_int ?

Arkshine
04-07-2010, 09:38
No, it won't work like that since it's not related to an entity. Here it's related to an object. ( g_pGameRules ). You have an example in my Round Terminator.

xPaw
04-07-2010, 09:55
No, it won't work like that since it's not related to an entity. Here it's related to an object. ( g_pGameRules ). You have an example in my Round Terminator.
Oh right, thanks

Seta00
04-07-2010, 21:15
/***
*
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
* object code is restricted to non-commercial enhancements to products from
* Valve LLC. All other use, distribution, or modification is prohibited
* without written permission from Valve LLC.
*
****/

http://www.nooooooooooooooo.com/

Let me be clear: Why in the world did you use the Valve license on the SDK?????????


I've updated the license on the Ohloh project.

Arkshine
05-03-2010, 14:46
A small bump to inform that all the weapons are now decompiled.
There are probably numerous errors/typos and some adjustments to do. All weapons will be reviewed later.

You can review there : http://code.google.com/p/cs-sdk/source/browse/#svn/trunk or using a svn client software with http://cs-sdk.googlecode.com/svn/trunk/

Lt.RAT
05-03-2010, 15:25
Also pm_shared fully decompiled.

About weapons:
From amxconst.inc

#define CSW_P228 1
#define CSW_SCOUT 3
#define CSW_HEGRENADE 4
...
#define CSW_VEST 31
#define CSW_VESTHELM 32


From weapons.h

#define WEAPON_P228 2
#define WEAPON_SCOUT 3
...


Need to recheck WEAPON_P228, and maybe add CSW_VEST and CSW_VESTHELM if they are in same enum in amxconst.inc (maybe not).

PS can you provide mp.map and mp.inc file for mp.dll ?) (if u filled smth in it)

Arkshine
05-03-2010, 15:32
Thanks fixed. I know there are other things to fix/add/modify in this file but I want to check some things before.

Immortal_BLG
05-03-2010, 22:23
Thank you guys for this excellent work!!!!! :{P

fot
05-06-2010, 07:33
I want to ask...how to use this code?

Arkshine
05-06-2010, 08:16
Use what ? To do what ? What is the purpose of your question ? I mean, do you understand what happen in this thread ?

Exolent[jNr]
05-06-2010, 14:57
I want to ask...how to use this code?

You create a C++ project and save all these files.
Then you compile them to a .exe and you will have Non-Steam CS 1.6.

ConnorMcLeod
05-07-2010, 11:38
;1172805']You create a C++ project and save all these files.
Then you compile them to a .exe and you will have Non-Steam CS 1.6.

ROFL

Costin83
05-13-2010, 20:22
First of all: Arkshine, you are doing an awsome work here. Monstrous project what you have started here...

It's a HUGE gap you are trying to cover here and CS scripting lacks this kinda project for a long time now...

I'm barely on the status of understanding what you are doing here and it gives me headaches just thinking about this... Again: Great Work!

Second:

;1172805']You create a C++ project and save all these files.
Then you compile them to a .exe and you will have Non-Steam CS 1.6.

I might consider that... :mrgreen: Just waiting for Arkshine to add m_CollisionGroup offsets to this project, like in source games :D ...... and his Monster AI as well... and... why not: The Titanic!

Edit:

http://forums.alliedmods.net/showpost.php?p=1179491&postcount=7
3rd: Can someone make a little itsy-bitsy tut about de/compiling dll's; I mean just some basic functions/definitions/file formats/relationships/etc... kind of stuff... Big thx in advance :mrgreen:

Arkshine
05-14-2010, 05:30
I'm barely on the status of understanding ; Y'es I see that. That's why when I read your comment, I want to say : "what".
You should really search on google, learning more about C/C++, disassembling, decompiling, etc... such stuff. You will find numerous resources.

Costin83
05-15-2010, 09:38
I'm barely on the status of understanding ; Y'es I see that. That's why when I read your comment, I want to say : "what".
You should really search on google, learning more about C/C++, disassembling, decompiling, etc... such stuff. You will find numerous resources.

I think I will do that, though it's, from what I've heard a very ugly language to learn...

joropito
05-15-2010, 09:48
from what I've heard a very ugly language to learn...

If it's ugly, you should try this (http://en.wikipedia.org/wiki/LOGO) and then tell me what's ugly :P

Costin83
05-15-2010, 11:23
At first sight it looks like an "command line paint" :| ugly though...

Arkshine
05-15-2010, 16:00
Try to not be too much offtopic :p

xPaw
06-04-2010, 08:14
multiplay_gamerules.cpp
line 380: pHostaye -> pHostage :)

player.cpp
line 545: m_iKevelar -> m_iKevlar

Arkshine
06-04-2010, 11:12
Fixed, thanks.

4554
08-21-2010, 09:50
hello,
how can i compile the code in VC2008 express?

Arkshine
08-21-2010, 10:17
*sigh*

aportner
09-13-2010, 19:47
Wow, this is amazing! Thanks for all your hard work!

Costin83
09-14-2010, 02:09
If I may ask a stupid question @Arkshine, if you finish the CS SDK (I must admit that I don't really understand how this stuff works... ) in fact... if it's a "finishable" project... and you finish it, do you have any plan in using it in a special purpose, or you just do it for others to benefit from it... ?
I assume that if it's a "finishable" project (sorry if I'm killing english language... ) you can "remake" Counter-Strike 1.6 from this SDK ?
And yes... if this is the case I also assume that the SDK will suffer from a big problem like Valve constantly updating the game and this will become obsolete by time ? I don't know... I just ask stupid questions... Or CS 1.6 updates only consists only of GoldSrc engine fixes/etc. and won't affect the mod... ?
Sorry if I'm too retarded and the answers to my questions are right a click away from me by doing a simple search... Tbh... I don't really know where I can start looking if this is the case...

Arkshine
09-14-2010, 05:51
The purpose is obviously not to provide a full working and compilable project
but only showing the content of some functions to know more on some CS specificities,
understanding the flow of some features, extracting useful datas thus creating better plugins
which should be more finely, intelligently, and efficiently coded.

Even if it's probably doable, there is not point to do that. It takes too much time and I'm that crazy to achieve that. Knowing things about CS would be already enough and there is so much to do yet.

.Dare Devil.
10-02-2010, 16:09
Nice! because it can be downloaded :D

ShaoKahn
03-27-2011, 04:54
Hi
does anyone have compilable CS1.6 SDK ?
please Reply in this topic , i am waiting
http://forums.alliedmods.net/showthread.php?t=153649

Arkshine
03-27-2011, 06:10
Ask valve.

Seta00
03-29-2011, 10:58
compilable CS1.6 SDK ?

What are you even talking about. CS 1.6 is already a mod, and uses the Half-Life SDK, a "compilable CS1.6 SDK" would be the game source code itself.

Seta00
08-08-2011, 16:22
can someone send me working version of cs-sdk pls? this version dont work compile error

Daku
08-09-2011, 17:13
i make mp.dll - FINE :D

but i cant make client.dll why ?? i don't have all files ;/

xPaw
08-09-2011, 17:50
i make mp.dll - FINE :D

but i cant make client.dll why ?? i don't have all files ;/

http://ragefac.es/faces/f6b62ef385283bb66f554cacabfdc7d9.png

Daku
08-09-2011, 19:19
no i talking serious :P i'm not noob i just try to make new mod ( based on Counter Strike ) i wan't to angry You

Arkshine
08-09-2011, 19:24
READ THE FUCKING FIRST PAGE.

/Invoke rukia

Daku
08-09-2011, 19:36
it's stupid -.- how can i make client.dll when I do not have all the files and such a genius with C + + I'm not like you

jim_yang
08-09-2011, 20:36
Aren't you clear by reading the first page? Basiclly this sdk is the combination of reverse engineering and hl(2)sdk, through countless comparison and guess.
Its purpose is to let people know how some cs function works, not make a working mod.
don't ask such questions any more.

Triver
10-10-2011, 11:29
So are people still working on this project? I would like to know what CS version you analyzed for these code snippets?

And has someone done some research on the client.dll Steam version? I'm especially interested in that :P

Arkshine
10-10-2011, 12:02
I'm still working on it, and the svn is quite outdated. I've updated things on my computer but I did not updated yet for some reasons on the svn. I'm playing only server-side, client is a pain, unrelated to the project and won't happen.

hleV
10-10-2011, 15:27
I think switch() in CSSDK is used the Pawn way, not the C++ way for some reason.

Arkshine
10-10-2011, 15:34
[...]there will be probably some typos and sometimes
you will see pawn syntax[...]
[...]the svn is quite outdated[...]

Anyway I've changed my way of working.


I wanted to wait I would push all the changes done before say it, but I've actually moved the project on github here : https://github.com/Arkshine/CSSDK.

Now the project is based on the HLSDK for at least three reasons :

- It's more easy to insert code inside an existing project using an IDE.
- Can try to compile to see if the code is well integrated and decent. (so yes it compiles, but of course not usable)
- A useful online documentation can be generated with Doxygen. (offline, will upload when more datas will be present)

For now, If I remember there is only CGrenade (ggrenades.cpp) pushed (All functions have been decompiled, and few things would need to be adjusted).
Don't know when I will push others datas. I've changed/adjusted many things and some files are in a mess for now, can't push as it is.

red_bull2oo6
09-11-2013, 19:30
the last post in this topic is 2 years old..

Arkshine
09-12-2013, 10:02
Not sure where you've seen that. Anyway, nope.

NiHiLaNTh
09-13-2013, 03:00
I just saw the link in the first post is dead, so I thought, its dead :( Glad to hear its still ongoing (and where its located now?)

dark_style
09-13-2013, 03:08
Few posts above..

Anyway I've changed my way of working.


I wanted to wait I would push all the changes done before say it, but I've actually moved the project on github here : https://github.com/Arkshine/CSSDK.

Now the project is based on the HLSDK for at least three reasons :
- It's more easy to insert code inside an existing project using an IDE.
- Can try to compile to see if the code is well integrated and decent. (so yes it compiles, but of course not usable)
- A useful online documentation can be generated with Doxygen. (offline, will upload when more datas will be present)For now, If I remember there is only CGrenade (ggrenades.cpp) pushed (All functions have been decompiled, and few things would need to be adjusted).
Don't know when I will push others datas. I've changed/adjusted many things and some files are in a mess for now, can't push as it is.

souvikdas95
02-23-2014, 23:35
what's the difference b/w CounterStrikeSDK and HalfLife1SDK?

https://github.com/ValveSoftware/halflife

Both appears to include same files and folder.

Arkshine
02-24-2014, 02:54
CSSDK is the code source for CS.
CS is an HL1 mod, so it makes sense to start with HLSDK as base, and modifying code specific to CS. (not completed yet)

colossus
08-01-2014, 08:25
Update Link

HamletEagle
08-01-2014, 10:08
Anyway I've changed my way of working.


I wanted to wait I would push all the changes done before say it, but I've actually moved the project on github here : https://github.com/Arkshine/CSSDK.

Now the project is based on the HLSDK for at least three reasons :

- It's more easy to insert code inside an existing project using an IDE.
- Can try to compile to see if the code is well integrated and decent. (so yes it compiles, but of course not usable)
- A useful online documentation can be generated with Doxygen. (offline, will upload when more datas will be present)

For now, If I remember there is only CGrenade (ggrenades.cpp) pushed (All functions have been decompiled, and few things would need to be adjusted).
Don't know when I will push others datas. I've changed/adjusted many things and some files are in a mess for now, can't push as it is.

Arkshine
12-09-2015, 16:48
Another project by s1lentq (https://forums.alliedmods.net/member.php?u=76057) at: https://github.com/s1lentq/ReGameDLL_CS which is more complete, reliable and likely in good hands. Please consider checking this project instead.

OvidiuS
12-18-2015, 07:00
What about https://github.com/dreamstalker/rehlds? Is it better, does it support more features?
I see that rehlds has a bit more files than ReGameDLL especially in engine folder.

HamletEagle
12-18-2015, 07:04
What about https://github.com/dreamstalker/rehlds? Is it better, does it support more features?
I see that rehlds has a bit more files than ReGameDLL especially in engine folder.

ReHLDS is the engine(swds.dll/engine.so), ReGameDLL is the mod(mp.dll/cs.so). They are different things.

OvidiuS
12-18-2015, 07:11
ReHLDS is the engine(swds.dll/engine.so), ReGameDLL is the mod(mp.dll/cs.so). They are different things.

Ah, didn't catch that. Thanks for clarification ;)