Raised This Month: $7 Target: $400
 1% 

Solved Vector distance and TE_SetupBeamRingPoint


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KoreanPeople
Junior Member
Join Date: Jun 2019
Old 07-10-2019 , 06:00   Vector distance and TE_SetupBeamRingPoint
Reply With Quote #1

this code is used skill client rayfilterpos radius 300.0 healing survivor

Code:
public Action NanoHealMachineTimer(Handle timer, any client) {
	static float checkDuration = 0.0;
	decl Float:pos[3];
	
	if(GetClientTeam(client) == TEAM_SURVIVOR && !IsFakeClient(client) && IsPlayerAlive(client)) {
		if(checkDuration < 10.0) {
			for(new i = 1; i <= MaxClients; i++) {
				if(GetClientTeam(i) == TEAM_SURVIVOR && !IsFakeClient(i) && IsPlayerAlive(i) && IsClientInGame(i)) {
					GetClientEyePosition(i, pos);
					if(GetVectorDistance(pos, trsPos[client]) < 300.0) {
						if(GetEntProp(i, Prop_Data, "m_iHealth") < GetEntProp(i, Prop_Data, "m_iMaxHealth")) {
							SetEntProp(i, Prop_Data, "m_iHealth", GetEntProp(i, Prop_Data, "m_iHealth") + 1);
						} else {
							SetEntProp(i, Prop_Data, "m_iHealth", GetEntProp(i, Prop_Data, "m_iMaxHealth"));
						}
					}
				}
			}
			checkDuration += 1.0;
			PrintToChat(client, "if & if %d", checkDuration);
		}
		else {
			PrintToChat(client, "\x04Nano machine duration end");
			checkDuration = 0.0;
			return Plugin_Stop;
		}
		PrintToChat(client, "LAST %d", checkDuration);
	}
	return Plugin_Continue;
}
and this code create entity ring effect
but, ring radius and heal radius = not equal..

Code:
public Action MedicNanoHealMachineLingEffect1(Handle timer, any client) {
	decl Outlinecolor[4];
	Outlinecolor[0] = 0;
	Outlinecolor[1] = 255;
	Outlinecolor[2] = 0;
	Outlinecolor[3] = 255;
	decl CenterColor[4];
	CenterColor[0] = 0;
	CenterColor[1] = 255;
	CenterColor[2] = 0;
	CenterColor[3] = 255;
	
	float CenterLing[3];
	CenterLing[0] = trsPos[client][0];
	CenterLing[1] = trsPos[client][1];
	CenterLing[2] = trsPos[client][2];
	CenterLing[2] += 100;
	float OutlineLing[3];
	OutlineLing[0] = trsPos[client][0];
	OutlineLing[1] = trsPos[client][1];
	OutlineLing[2] = trsPos[client][2];
	OutlineLing[2] += 30;
	
	// Outline
	TE_SetupBeamRingPoint(OutlineLing, 299.0, 300.0, g_BeamSprite, g_HaloSprite, 0, 10, 10.0, 4.0, 0.0, Outlinecolor, 5, 0);
	TE_SendToAll();
	// Center
	TE_SetupBeamRingPoint(CenterLing, 10.0, 60.0, g_BeamSprite, g_HaloSprite, 0, 10, 10.0, 8.0, 3.0, CenterColor, 5, 0);
	TE_SendToAll();
	
	return Plugin_Continue;
}

public Action MedicNanoHealMachineLingEffect2(Handle timer, any client) {
	static int checkDuration = 0;
	decl InnerColor[4];
	InnerColor[0] = 255;
	InnerColor[1] = 255;
	InnerColor[2] = 0;
	InnerColor[3] = 255;
	
	float InnerlineLing[3];
	InnerlineLing[0] = trsPos[client][0];
	InnerlineLing[1] = trsPos[client][1];
	InnerlineLing[2] = trsPos[client][2];
	InnerlineLing[2] += 30;
	
	if(checkDuration < 10.0) {
		TE_SetupBeamRingPoint(InnerlineLing, 60.0, 300.0, g_BeamSprite, g_HaloSprite, 0, 10, 1.0, 2.0, 0.0, InnerColor, 10, 0);
		TE_SendToAll();
		checkDuration += 1;
	} else {
		checkDuration = 0;
		return Plugin_Stop;
	}
	return Plugin_Continue;
}
pls solved...

Last edited by DarkDeviL; 07-11-2019 at 08:10. Reason: Restore to previous version. + Solved tag
KoreanPeople is offline
Reply


Thread Tools
Display Modes

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 22:24.


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