Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sourcemod>
- #include <sdktools_functions>
- #include <tf2_stocks>
- public OnPluginStart()
- {
- HookEvent("player_spawn", OnPlayerSpawn);
- }
- public Action OnPlayerSpawn(Event event, const char[] name, bool dontBroadcast)
- {
- int playerSpawn = GetClientOfUserId(GetEventInt(event, "userid", 0));
- if (TF2_GetClientTeam(playerSpawn) == TFTeam_Blue)
- {
- if (TF2_GetPlayerClass(playerSpawn) == TFClass_Scout)
- {
- int newEntity = CreateEntityByName("tf_wearable");
- float bPos[3];
- GetClientEyePosition(playerSpawn, bPos);
- if (IsValidEntity(newEntity))
- {
- SetEntProp(newEntity, Prop_Send, "m_iTeamNum", GetClientTeam(playerSpawn));
- SetEntProp(newEntity, Prop_Send, "m_nSkin", GetClientTeam(playerSpawn) - 2);
- SetEntProp(newEntity, Prop_Send, "m_usSolidFlags", 4);
- SetEntProp(newEntity, Prop_Send, "m_CollisionGroup", 11);
- SetEntProp(newEntity, Prop_Send, "m_iEntityLevel", 70);
- SetEntProp(newEntity, Prop_Send, "m_iEntityQuality", 6);
- SetEntProp(newEntity, Prop_Send, "m_iItemDefinitionIndex", 5617);
- DispatchKeyValueVector(newEntity, "origin", bPos);
- DispatchSpawn(newEntity);
- SetEntityModel(newEntity, "models/player/items/scout/scout_zombie.mdl");
- ActivateEntity(newEntity);
- }
- }
- if (TF2_GetPlayerClass(playerSpawn) == TFClass_Spy)
- {
- int newEntity = CreateEntityByName("tf_wearable");
- float bPos[3];
- GetClientEyePosition(playerSpawn, bPos);
- if (IsValidEntity(newEntity))
- {
- SetEntProp(newEntity, Prop_Send, "m_iTeamNum", GetClientTeam(playerSpawn));
- SetEntProp(newEntity, Prop_Send, "m_nSkin", GetClientTeam(playerSpawn) - 2);
- SetEntProp(newEntity, Prop_Send, "m_usSolidFlags", 4);
- SetEntProp(newEntity, Prop_Send, "m_CollisionGroup", 11);
- SetEntProp(newEntity, Prop_Send, "m_iEntityLevel", 70);
- SetEntProp(newEntity, Prop_Send, "m_iEntityQuality", 6);
- SetEntProp(newEntity, Prop_Send, "m_iItemDefinitionIndex", 5623);
- DispatchKeyValueVector(newEntity, "origin", bPos);
- DispatchSpawn(newEntity);
- SetEntityModel(newEntity, "models/player/items/spy/spy_zombie.mdl");
- ActivateEntity(newEntity);
- }
- }
- if (TF2_GetPlayerClass(playerSpawn) == TFClass_Heavy)
- {
- int newEntity = CreateEntityByName("tf_wearable");
- float bPos[3];
- GetClientEyePosition(playerSpawn, bPos);
- if (IsValidEntity(newEntity))
- {
- SetEntProp(newEntity, Prop_Send, "m_iTeamNum", GetClientTeam(playerSpawn));
- SetEntProp(newEntity, Prop_Send, "m_nSkin", GetClientTeam(playerSpawn) - 2);
- SetEntProp(newEntity, Prop_Send, "m_usSolidFlags", 4);
- SetEntProp(newEntity, Prop_Send, "m_CollisionGroup", 11);
- SetEntProp(newEntity, Prop_Send, "m_iEntityLevel", 70);
- SetEntProp(newEntity, Prop_Send, "m_iEntityQuality", 6);
- SetEntProp(newEntity, Prop_Send, "m_iItemDefinitionIndex", 5619);
- DispatchKeyValueVector(newEntity, "origin", bPos);
- DispatchSpawn(newEntity);
- SetEntityModel(newEntity, "models/player/items/heavy/heavy_zombie.mdl");
- ActivateEntity(newEntity);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement