Skip to content
This repository was archived by the owner on Aug 4, 2025. It is now read-only.

Commit e2deaea

Browse files
committed
New version 2.0
New arms fix method, supports all maps.
1 parent 7347938 commit e2deaea

File tree

5 files changed

+665
-293
lines changed

5 files changed

+665
-293
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
training1

addons/sourcemod/examples/skin_changer.sp

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,38 +11,17 @@ public Plugin myinfo =
1111
url = "http://steamcommunity.com/id/olympic-nomis-p"
1212
}
1313

14-
public void OnPluginStart() {
15-
16-
HookEvent("player_spawn", Event_PlayerSpawn, EventHookMode_Post);
17-
}
18-
19-
public Action Event_PlayerSpawn(Handle event, const char[] name, bool dontBroadcast) {
20-
21-
int client = GetClientOfUserId(GetEventInt(event, "userid"));
22-
23-
PlayerArmsModel(client);
24-
CreateTimer(1.5, PlayerModel, client); //1.5 is optimal!
14+
public void OnPluginStart()
15+
{
2516
}
2617

27-
public void PlayerArmsModel(int client) {
28-
29-
if(!IsValidClient(client))
30-
return;
31-
32-
ArmsFix_SetDefaults(client);
18+
public void N_ArmsFix_OnClientReady(int client)
19+
{
3320
SetEntPropString(client, Prop_Send, "m_szArmsModel", "models/player/custom_player/xxx/yyy_arms.mdl");
34-
}
35-
36-
public Action PlayerModel(Handle timer, any client) {
37-
38-
if(!IsValidClient(client))
39-
return;
40-
4121
SetEntityModel(client, "models/player/custom_player/xxx/yyy.mdl");
42-
SetEntityRenderColor(client, 255, 255, 255, 255);
4322
}
4423

45-
bool IsValidClient(int client) {
46-
24+
bool IsValidClient(int client)
25+
{
4726
return (client > 0 && client <= MaxClients && IsClientConnected(client) && IsClientInGame(client)) ? true : false;
4827
}
3.3 KB
Binary file not shown.

addons/sourcemod/scripting/include/n_arms_fix.inc

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,63 +3,53 @@
33
#endif
44
#define n_arms_fix_include
55

6-
76
/**
8-
* Called when it's safe to set arms.
7+
* Called when default mode/arms are ready
98
*
109
* @param client client index
1110
* @return no return
1211
*/
13-
forward void ArmsFix_OnArmsSafe(int client);
14-
15-
/**
16-
* Called when it's safe to set player model.
17-
*
18-
* @param client client index
19-
* @return no return
20-
*/
21-
forward void ArmsFix_OnModelSafe(int client);
12+
forward void N_ArmsFix_OnClientReady(int client);
2213

2314
/**
2415
* Set default model & arms
2516
*
2617
* @param client client index
2718
* @return no return
2819
*/
29-
native int ArmsFix_SetDefaults(int client);
20+
native int N_ArmsFix_SetClientDefaults(int client);
3021

3122
/**
32-
* Set default arms
23+
* Set default model
3324
*
3425
* @param client client index
3526
* @return no return
3627
*/
37-
native int ArmsFix_SetDefaultArms(int client);
28+
native int N_ArmsFix_SetClientDefaultModel(int client);
3829

3930
/**
40-
* Refresh player view
31+
* Set default arms
4132
*
4233
* @param client client index
4334
* @return no return
4435
*/
45-
native int ArmsFix_RefreshView(int client);
36+
native int N_ArmsFix_SetClientDefaultArms(int client);
4637

4738
/**
4839
* Has default arms?
4940
*
5041
* @param client client index
5142
* @return true/false
5243
*/
53-
native int ArmsFix_HasDefaultArms(int client);
54-
44+
native int N_ArmsFix_HasClientDefaultArms(int client);
5545

5646
public SharedPlugin n_arms_fix_include_shared =
5747
{
58-
name = "Arms Fix",
48+
name = "-N- Arms Fix",
5949
file = "n_arms_fix.smx",
60-
#if defined REQUIRE_PLUGIN
61-
required = 1
62-
#else
63-
required = 0
64-
#endif
65-
};
50+
#if defined REQUIRE_PLUGIN
51+
required = 1
52+
#else
53+
required = 0
54+
#endif
55+
};

0 commit comments

Comments
 (0)