Na moim serwerze modyfikacji BaseBuider mam napisane swoje klasy zombie i właśnie z nimi mam mały problem. Około 30% graczy z różnymi klasami nie posiada głów, jak strzelamy w głowę obrażenia wchodzą jak w normalne ciało albo ich wcale nie ma. Modeli nie zmieniałem a na starych klasach wszystkie głowy wchodziły dobrze. Wie ktoś może gdzie jest błąd?
public Action Player_Spawn(Handle event, char[] name2, bool dontBroadcast)
{
int client = GetClientOfUserId(GetEventInt(event, "userid"));
RequestFrame(Player_Spawn_Frame, client);
}
public void Player_Spawn_Frame(int client)
{
if(IsValidPlayer(client)&&GetClientTeam(client)==CS_TEAM_T)
{
SetEntityGravity(client, g_fKlasaGravity[g_iPlayerKlasa[client]])
SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", g_fKlasaSpeed[g_iPlayerKlasa[client]]);
SetEntityHealth(client, g_iKlasaHp[g_iPlayerKlasa[client]]);
SetEntityModel(client, g_cKlasaModel[g_iPlayerKlasa[client]]);
SetPlayerArms(client, g_cKlasaRece[g_iPlayerKlasa[client]]);
PrintToChat(client, "\x07[\x09SD\x07] \x04Aktualnie Grasz klasa \x10%s\x04",g_cKlasaNazwy[g_iPlayerKlasa[client]]);
}
}
public void SetPlayerArms(int client, char[] arms)
{
int weapon_index = -1;
for (int slot = 0; slot < 6; slot++)
{
while ((weapon_index = GetPlayerWeaponSlot(client, slot)) != -1)
{
if (IsValidEntity(weapon_index))
{
RemovePlayerItem(client, weapon_index);
AcceptEntityInput(weapon_index, "kill");
}
}
}
SetEntPropString(client, Prop_Send, "m_szArmsModel", arms);
CreateTimer(0.1, Give_Knife, client);
}
public Action Give_Knife(Handle tmr, any client)
{
if(IsValidPlayer(client))
GivePlayerItem(client, "weapon_knife");
}