Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- An extended example (note I added custom arms in this example just to show it's possible, this thread was about hiding arms):
- #include <sourcemod>
- #include <sdkhooks>
- #include <sdktools_functions>
- #pragma semicolon 1
- new const String:PLAYER_MODEL_DEFAULT[] = "models/player/custom_player/legacy/ctm_swat_variantd.mdl";
- new const String:PLAYER_MODEL_CUSTOM[] = "path/to/custom/model.mdl";
- new const String:ARMS_MODEL[] = "models/weapons/ct_arms_gign.mdl";
- public OnMapStart()
- {
- PrecacheModel(PLAYER_MODEL_DEFAULT);
- PrecacheModel(PLAYER_MODEL_CUSTOM);
- PrecacheModel(ARMS_MODEL);
- }
- public OnClientPutInServer(iClient)
- {
- SDKHook(iClient, SDKHook_SpawnPost, OnSpawnPost);
- }
- public OnSpawnPost(iClient)
- {
- if(IsClientObserver(iClient) || !IsPlayerAlive(iClient))
- return;
- SetEntityModel(iClient, PLAYER_MODEL_DEFAULT);
- SetEntPropString(iClient, Prop_Send, "m_szArmsModel", ARMS_MODEL);
- CreateTimer(0.1, Timer_CustomModel, GetClientSerial(iClient));
- }
- public Action:Timer_CustomModel(Handle:hTimer, any:iClientSerial)
- {
- new iClient = GetClientFromSerial(iClientSerial);
- if(!iClient)
- return;
- SetEntityModel(iClient, PLAYER_MODEL_CUSTOM);
- }
Advertisement
Add Comment
Please, Sign In to add comment