So I'm making a plugin that makes certain players glow. For some reason this function crashes the server:
Code:
public void GiveGlow(int client, int nEquipa) {
char model[PLATFORM_MAX_PATH];
int skin = -1;
GetClientModel(client, model, sizeof(model));
skin = CreatePlayerModelProp(client, model);
if(skin > MaxClients) {
if(SDKHookEx(skin, SDKHook_SetTransmit, OnSetTransmit_All)){
static int offset = -1;
if(!offset && (offset = GetEntSendPropOffs(client, "m_clrGlow")) == -1) {
LogError("Unable to find property offset: \"m_clrGlow\"!");
return;
}
SetEntProp(client, Prop_Send, "m_bShouldGlow", true, true);
SetEntProp(client, Prop_Send, "m_nGlowStyle", 1);
SetEntPropFloat(client, Prop_Send, "m_flGlowMaxDist", 10000.0);
SetEntData(client, offset, CorR[nEquipa], _, true);
SetEntData(client, offset + 1, CorG[nEquipa], _, true);
SetEntData(client, offset + 2, CorB[nEquipa], _, true);
SetEntData(client, offset + 3, CorA[nEquipa], _, true);
}
}
}
public Action OnSetTransmit_All(int entity, int client) {
if(playerModelsIndex[client] != entity) {
return Plugin_Continue;
}
return Plugin_Handled;
}
__________________