Raised This Month: $ Target: $400
 0% 

Making players glow crashes server.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
andrept4
Senior Member
Join Date: Dec 2012
Location: Portugal
Old 05-01-2020 , 16:22   Making players glow crashes server.
Reply With Quote #1

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;
}
__________________
andrept4 is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:23.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode