Quote:
Originally Posted by Franc1sco
|
Just modify these code sections:
PHP Code:
// :: ADD THIS ::
char defaultArms[][] = { "models/weapons/ct_arms.mdl", "models/weapons/t_arms.mdl" };
...
public Action PlayerSpawn(Event gEventHook, const char[] gEventName, bool iDontBroadcast) {
{
int client = GetClientOfUserId(gEventHook.GetInt("userid"));
// :: ADD THIS ::
CreateTimer(0.5, PlayerSpawn_Arms, client);
}
// :: ADD THIS ::
public Action PlayerSpawn_Arms(Handle timer, int client) {
GiveArms(client);
}
public void GiveArms(int client)
{
if (!IsPlayerAlive(client))return;
int team;
if(GetFeatureStatus(FeatureType_Native, "ZR_IsClientZombie") == FeatureStatus_Available)
{
if (ZR_IsClientZombie(client))team = 0;
else team = 1;
}
else
team = GetClientTeam(client);
if(strlen(g_arms[1][team][client]) > 2 && !StrEqual(g_arms[1][team][client], "none", false) && (FileExists(g_arms[1][team][client]) || FileExists(g_arms[1][team][client], true)))
{
// :: ADD THIS ::
if (StrEqual(g_arms[1][team][client], defaultArms[0]) || StrEqual(g_arms[1][team][client], defaultArms[1]))
return;
SetEntPropString(client, Prop_Send, "m_szArmsModel", g_arms[1][team][client]);
CreateTimer(0.15, RemoveItemTimer, EntIndexToEntRef(client), TIMER_FLAG_NO_MAPCHANGE);
}
//PrintToChat(client, "modelo arms de %s de %s", g_arms[0][team][client], g_arms[1][team][client]);
}
And configuration.txt:
PHP Code:
"CustomModels"
{
"Default CT Arms"
{
"model" "models/weapons/ct_arms.mdl"
"team" "CT"
}
"Default T Arms"
{
"model" "models/weapons/t_arms.mdl"
"team" "TT"
}
...
Don't add -N- Arms Fix code directly into your plugin, because there are many other plugins with arms/gloves functions. So if everyone implement part of my code into its plugin. It can be problematic.
__________________