[FilterScript] Sistema de /heridas | Editado por mi.

¿Tienes un FilterScript muy bueno y quieres compartirlo con los demás? ¿Qué esperas? ¡Muéstranoslo aquí!

Moderador: Ayudantes

Reglas del Foro
  • Al liberar un FilterScript, debes informar sobre qué trata el código claramente, imágenes o vídeos y la explicación de cómo usarlo.
  • En caso de que quieras publicar un TextDraw que únicamente cumpla una función estética (como ser un TextDraw que muestra el nombre del servidor), es decir, no cumple ninguna función más que decorativa/visual (a diferencia de un TextDraw que realiza la función de velocímetro y contiene los códigos para ello, por ejemplo), debe ir en la sección Guías y Aportes.
  • Si el link de descarga no funciona, el tema será eliminado.
  • Si no eres el autor del FilterScript o has utilizado códigos de otros autores, recuerda colocar los créditos correspondientes. (El plagio es motivo de sanción).
Responder
Avatar de Usuario
[L]ucatito
Aprendiz
Aprendiz
Mensajes: 111
Registrado: 18 Abr 2018 20:56
Ubicación: Buenos Aires, Argentina.
Reputación: 8

23 Sep 2018 10:19

¡Buenas noches/dias! Hoy les traigo un sistema de heridas, el cúal al colocar /heridas [ID] nos mostrara un cuadro con el daño, el arma utiliza y la parte del cuepo.

•Creditos:

-Hreesang - Por crear el filterscript en si.
-Emmet_ - Por crear el include: sscanf2.
-Zeex - Por crear el include: zcmd.
-[L]ucatito - Traducirlo al español y editarlo.

•Comandos:

-/heridas - Para ver las heridas de un jugador.

•Includes necesarios:

-a_samp
-sscanf2
-zcmd

•Código:
 Codigo Pawno:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175

//=====================INCLUDES=====================

#include 	<a_samp>
#include	<zcmd>
#include	<sscanf2>

//=====================DIALOGOS======================

#define		DIALOG_DAMAGE		1927

//==================PANEL DE CONTROL===================

#define 	FILTERSCRIPT
#define		MAX_DAMAGES			1000

#define		SCM					SendClientMessage
#define		FORMAT:%0(%1)		format(%0, sizeof(%0), %1)

#define		BODY_PART_TORSO 	3
#define 	BODY_PART_GROIN 	4
#define 	BODY_PART_RIGHT_ARM 5
#define 	BODY_PART_LEFT_ARM 	6
#define	 	BODY_PART_RIGHT_LEG 7
#define 	BODY_PART_LEFT_LEG 	8
#define 	BODY_PART_HEAD 		9

//===================ENUM'S====================

enum dmgInfo
{
	dmgDamage,
	dmgWeapon,
	dmgBodypart,
	dmgKevlarhit,
	dmgSeconds,
}
new DamageInfo[MAX_PLAYERS][MAX_DAMAGES][dmgInfo];

public OnFilterScriptInit()
{
	print("\n ==================================");
	print(" |          Damage System         |");
	print(" ==================================\n");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

stock ResetPlayerDamages(playerid)
{
	for(new id = 0; id < MAX_DAMAGES; id++)
	{
		if(DamageInfo[playerid][id][dmgDamage] != 0)
		{
			DamageInfo[playerid][id][dmgDamage] = 0;
			DamageInfo[playerid][id][dmgWeapon] = 0;
			DamageInfo[playerid][id][dmgBodypart] = 0;
			DamageInfo[playerid][id][dmgKevlarhit] = 0;
			DamageInfo[playerid][id][dmgSeconds] = 0;
		}
	}
	return 1;
}

public OnPlayerConnect(playerid)
{
	ResetPlayerDamages(playerid);
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
	ResetPlayerDamages(playerid);
	return 1;
}

stock ShowPlayerDamages(playerid, toid)
{
	new 
	str[1000], str1[500], count = 0, name[MAX_PLAYER_NAME];
	GetPlayerName(playerid, name, sizeof(name));
	for(new id = 0; id < MAX_DAMAGES; id++)
	{
		if(DamageInfo[playerid][id][dmgDamage] != 0) count++;
	}
	if(count == 0) return ShowPlayerDialog(toid, DIALOG_DAMAGE, DIALOG_STYLE_LIST, name, "Este usuario no tiene heridas", "Close", "");
	else if(count > 0)
	{
		for(new id = 0; id < MAX_DAMAGES; id++)
		{
			if(DamageInfo[playerid][id][dmgDamage] != 0)
			{
				FORMAT:str1("DAÑO: %d | ARMA: %s | PARTE: %s\n", DamageInfo[playerid][id][dmgDamage], GetWeaponNameEx(DamageInfo[playerid][id][dmgWeapon]), GetBodypartName(DamageInfo[playerid][id][dmgBodypart]), DamageInfo[playerid][id][dmgKevlarhit], gettime() - DamageInfo[playerid][id][dmgSeconds]);
				strcat(str, str1);
			}
		}
		ShowPlayerDialog(toid, DIALOG_DAMAGE, DIALOG_STYLE_LIST, name, str, "Close", "");
	}
	return 1;
}

stock GetName(playerid)
{
	new name;
	GetPlayerName(playerid, name, sizeof(name));
	return name;
}
CMD:heridas(playerid, params[])
{
	new 
	id, Float: pPos[3];
	if(sscanf(params, "u", id)) return SCM(playerid, 0xFF6347FF, "Utiliza: {FFFFFF}/heridas [playerid/PartOfName]");
	if(!IsPlayerConnected(id)) return SCM(playerid, 0xFF6347FF, "Usuario no conectado.");
	
	GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
	if(IsPlayerInRangeOfPoint(playerid, 7.0, pPos[0], pPos[1], pPos[2]))
	{
		ShowPlayerDamages(id, playerid);
	}
	else return SCM(playerid, 0xB8BAC6FF, "You're too far away.");
	return 1;
}

public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
	if(IsPlayerConnected(playerid))
	{
		new 
		id, Float: pHP, Float: pArm;
		GetPlayerHealth(playerid, pHP);
		GetPlayerArmour(playerid, pArm);
		for(new i = 0; i < MAX_DAMAGES; i++)
		{
			if(!DamageInfo[playerid][i][dmgDamage])
			{
				id = i;
				break;
			}
		}
		
		DamageInfo[playerid][id][dmgDamage] = floatround(amount, floatround_round);
		DamageInfo[playerid][id][dmgWeapon] = weaponid;
		DamageInfo[playerid][id][dmgBodypart] = bodypart;
		if(pArm > 0) DamageInfo[playerid][id][dmgKevlarhit] = 1;
		else if(pArm < 1) DamageInfo[playerid][id][dmgKevlarhit] = 0;
		DamageInfo[playerid][id][dmgSeconds] = gettime();
	}
	return 1;
}

stock GetWeaponNameEx(weaponid)
{
	new weaponname[60];
	GetWeaponName(weaponid, weaponname, sizeof(weaponname));
	return weaponname;
}

stock GetBodypartName(bodypart)
{
	new bodyname[60];
	switch(bodypart)
	{
		case BODY_PART_TORSO: FORMAT:bodyname("TORSO");
		case BODY_PART_GROIN: FORMAT:bodyname("INGLE");
		case BODY_PART_RIGHT_ARM: FORMAT:bodyname("BRAZO DERECHO");
		case BODY_PART_LEFT_ARM: FORMAT:bodyname("BRAZO IZQUIERDO");
		case BODY_PART_RIGHT_LEG: FORMAT:bodyname("PIERNA DERECHA");
		case BODY_PART_LEFT_LEG: FORMAT:bodyname("PIERNA IZQUIERDA");
		case BODY_PART_HEAD: FORMAT:bodyname("CABEZA");
	}
	return bodyname;
}
  Cantidad de llaves: Abiertas(24)-Cerradas(24) | Lineas Totales: 175
Avatar de Usuario
Daniel Walker
Avanzado
Avanzado
Mensajes: 465
Registrado: 04 Feb 2017 17:10
Ubicación: Bogotá
Contactar:
Reputación: 36

23 Sep 2018 12:05

[L]ucatito escribió:
23 Sep 2018 10:19
¡Buenas noches/dias! Hoy les traigo un sistema de heridas, el cúal al colocar /heridas [ID] nos mostrara un cuadro con el daño, el arma utiliza y la parte del cuepo.

•Creditos:

-Hreesang - Por crear el filterscript en si.
-Emmet_ - Por crear el include: sscanf2.
-Zeex - Por crear el include: zcmd.
-[L]ucatito - Traducirlo al español y editarlo.

•Comandos:

-/heridas - Para ver las heridas de un jugador.

•Includes necesarios:

-a_samp
-sscanf2
-zcmd

•Código:
 Codigo Pawno:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175

//=====================INCLUDES=====================

#include 	<a_samp>
#include	<zcmd>
#include	<sscanf2>

//=====================DIALOGOS======================

#define		DIALOG_DAMAGE		1927

//==================PANEL DE CONTROL===================

#define 	FILTERSCRIPT
#define		MAX_DAMAGES			1000

#define		SCM					SendClientMessage
#define		FORMAT:%0(%1)		format(%0, sizeof(%0), %1)

#define		BODY_PART_TORSO 	3
#define 	BODY_PART_GROIN 	4
#define 	BODY_PART_RIGHT_ARM 5
#define 	BODY_PART_LEFT_ARM 	6
#define	 	BODY_PART_RIGHT_LEG 7
#define 	BODY_PART_LEFT_LEG 	8
#define 	BODY_PART_HEAD 		9

//===================ENUM'S====================

enum dmgInfo
{
	dmgDamage,
	dmgWeapon,
	dmgBodypart,
	dmgKevlarhit,
	dmgSeconds,
}
new DamageInfo[MAX_PLAYERS][MAX_DAMAGES][dmgInfo];

public OnFilterScriptInit()
{
	print("\n ==================================");
	print(" |          Damage System         |");
	print(" ==================================\n");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

stock ResetPlayerDamages(playerid)
{
	for(new id = 0; id < MAX_DAMAGES; id++)
	{
		if(DamageInfo[playerid][id][dmgDamage] != 0)
		{
			DamageInfo[playerid][id][dmgDamage] = 0;
			DamageInfo[playerid][id][dmgWeapon] = 0;
			DamageInfo[playerid][id][dmgBodypart] = 0;
			DamageInfo[playerid][id][dmgKevlarhit] = 0;
			DamageInfo[playerid][id][dmgSeconds] = 0;
		}
	}
	return 1;
}

public OnPlayerConnect(playerid)
{
	ResetPlayerDamages(playerid);
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
	ResetPlayerDamages(playerid);
	return 1;
}

stock ShowPlayerDamages(playerid, toid)
{
	new 
	str[1000], str1[500], count = 0, name[MAX_PLAYER_NAME];
	GetPlayerName(playerid, name, sizeof(name));
	for(new id = 0; id < MAX_DAMAGES; id++)
	{
		if(DamageInfo[playerid][id][dmgDamage] != 0) count++;
	}
	if(count == 0) return ShowPlayerDialog(toid, DIALOG_DAMAGE, DIALOG_STYLE_LIST, name, "Este usuario no tiene heridas", "Close", "");
	else if(count > 0)
	{
		for(new id = 0; id < MAX_DAMAGES; id++)
		{
			if(DamageInfo[playerid][id][dmgDamage] != 0)
			{
				FORMAT:str1("DAÑO: %d | ARMA: %s | PARTE: %s\n", DamageInfo[playerid][id][dmgDamage], GetWeaponNameEx(DamageInfo[playerid][id][dmgWeapon]), GetBodypartName(DamageInfo[playerid][id][dmgBodypart]), DamageInfo[playerid][id][dmgKevlarhit], gettime() - DamageInfo[playerid][id][dmgSeconds]);
				strcat(str, str1);
			}
		}
		ShowPlayerDialog(toid, DIALOG_DAMAGE, DIALOG_STYLE_LIST, name, str, "Close", "");
	}
	return 1;
}

stock GetName(playerid)
{
	new name;
	GetPlayerName(playerid, name, sizeof(name));
	return name;
}
CMD:heridas(playerid, params[])
{
	new 
	id, Float: pPos[3];
	if(sscanf(params, "u", id)) return SCM(playerid, 0xFF6347FF, "Utiliza: {FFFFFF}/heridas [playerid/PartOfName]");
	if(!IsPlayerConnected(id)) return SCM(playerid, 0xFF6347FF, "Usuario no conectado.");
	
	GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
	if(IsPlayerInRangeOfPoint(playerid, 7.0, pPos[0], pPos[1], pPos[2]))
	{
		ShowPlayerDamages(id, playerid);
	}
	else return SCM(playerid, 0xB8BAC6FF, "You're too far away.");
	return 1;
}

public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
	if(IsPlayerConnected(playerid))
	{
		new 
		id, Float: pHP, Float: pArm;
		GetPlayerHealth(playerid, pHP);
		GetPlayerArmour(playerid, pArm);
		for(new i = 0; i < MAX_DAMAGES; i++)
		{
			if(!DamageInfo[playerid][i][dmgDamage])
			{
				id = i;
				break;
			}
		}
		
		DamageInfo[playerid][id][dmgDamage] = floatround(amount, floatround_round);
		DamageInfo[playerid][id][dmgWeapon] = weaponid;
		DamageInfo[playerid][id][dmgBodypart] = bodypart;
		if(pArm > 0) DamageInfo[playerid][id][dmgKevlarhit] = 1;
		else if(pArm < 1) DamageInfo[playerid][id][dmgKevlarhit] = 0;
		DamageInfo[playerid][id][dmgSeconds] = gettime();
	}
	return 1;
}

stock GetWeaponNameEx(weaponid)
{
	new weaponname[60];
	GetWeaponName(weaponid, weaponname, sizeof(weaponname));
	return weaponname;
}

stock GetBodypartName(bodypart)
{
	new bodyname[60];
	switch(bodypart)
	{
		case BODY_PART_TORSO: FORMAT:bodyname("TORSO");
		case BODY_PART_GROIN: FORMAT:bodyname("INGLE");
		case BODY_PART_RIGHT_ARM: FORMAT:bodyname("BRAZO DERECHO");
		case BODY_PART_LEFT_ARM: FORMAT:bodyname("BRAZO IZQUIERDO");
		case BODY_PART_RIGHT_LEG: FORMAT:bodyname("PIERNA DERECHA");
		case BODY_PART_LEFT_LEG: FORMAT:bodyname("PIERNA IZQUIERDA");
		case BODY_PART_HEAD: FORMAT:bodyname("CABEZA");
	}
	return bodyname;
}
  Cantidad de llaves: Abiertas(24)-Cerradas(24) | Lineas Totales: 175
Hermoso aporte muchas gracias amigo!!!
DESCANSA EN PAZ X


Sad Vibes Forever


Ocupado por estudios pero volveré, lo siento por la inactividad :,c


Diseños y Webs: Mostrar
DISEÑOS NEXT GAMING TEMPLATE PHOTOSHOP: viewtopic.php?f=80&t=26789
WEB HTML TEMPLATE PARA ROLEPLAY SAMP: viewtopic.php?f=68&t=26792
LOGOS FZ [2 ESTILOS] PLANTILLA: viewtopic.php?f=80&t=26821
BANNER FZ PLANTILLA: viewtopic.php?f=80&t=26838
PINCELES PARA PHOTOSHOP CS6: viewtopic.php?f=80&t=27196&p=136303#p136303
RANGOS PARA FORO SMF (ROLEPLAY) viewtopic.php?f=80&t=27301
HEADER PARA SERVER ZOMBIE: viewtopic.php?f=80&t=27415
HEADER + LOGO VERDES ROLEPLAY: https://pawnscript.com/foro/viewtopic.php?f=80&t=28307
FILTERSCRIPT: Mostrar
Sistema de Casas Sub Esp: viewtopic.php?f=81&t=27585
Avatar de Usuario
Franco12
Aprendiz
Aprendiz
Mensajes: 128
Registrado: 06 Feb 2017 21:17
Ubicación: Server Closed The Connection.
Reputación: 6

23 Sep 2018 19:22

[L]ucatito escribió:
23 Sep 2018 10:19
¡Buenas noches/dias! Hoy les traigo un sistema de heridas, el cúal al colocar /heridas [ID] nos mostrara un cuadro con el daño, el arma utiliza y la parte del cuepo.

•Creditos:

-Hreesang - Por crear el filterscript en si.
-Emmet_ - Por crear el include: sscanf2.
-Zeex - Por crear el include: zcmd.
-[L]ucatito - Traducirlo al español y editarlo.

•Comandos:

-/heridas - Para ver las heridas de un jugador.

•Includes necesarios:

-a_samp
-sscanf2
-zcmd

•Código:
 Codigo Pawno:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175

//=====================INCLUDES=====================

#include 	<a_samp>
#include	<zcmd>
#include	<sscanf2>

//=====================DIALOGOS======================

#define		DIALOG_DAMAGE		1927

//==================PANEL DE CONTROL===================

#define 	FILTERSCRIPT
#define		MAX_DAMAGES			1000

#define		SCM					SendClientMessage
#define		FORMAT:%0(%1)		format(%0, sizeof(%0), %1)

#define		BODY_PART_TORSO 	3
#define 	BODY_PART_GROIN 	4
#define 	BODY_PART_RIGHT_ARM 5
#define 	BODY_PART_LEFT_ARM 	6
#define	 	BODY_PART_RIGHT_LEG 7
#define 	BODY_PART_LEFT_LEG 	8
#define 	BODY_PART_HEAD 		9

//===================ENUM'S====================

enum dmgInfo
{
	dmgDamage,
	dmgWeapon,
	dmgBodypart,
	dmgKevlarhit,
	dmgSeconds,
}
new DamageInfo[MAX_PLAYERS][MAX_DAMAGES][dmgInfo];

public OnFilterScriptInit()
{
	print("\n ==================================");
	print(" |          Damage System         |");
	print(" ==================================\n");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

stock ResetPlayerDamages(playerid)
{
	for(new id = 0; id < MAX_DAMAGES; id++)
	{
		if(DamageInfo[playerid][id][dmgDamage] != 0)
		{
			DamageInfo[playerid][id][dmgDamage] = 0;
			DamageInfo[playerid][id][dmgWeapon] = 0;
			DamageInfo[playerid][id][dmgBodypart] = 0;
			DamageInfo[playerid][id][dmgKevlarhit] = 0;
			DamageInfo[playerid][id][dmgSeconds] = 0;
		}
	}
	return 1;
}

public OnPlayerConnect(playerid)
{
	ResetPlayerDamages(playerid);
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
	ResetPlayerDamages(playerid);
	return 1;
}

stock ShowPlayerDamages(playerid, toid)
{
	new 
	str[1000], str1[500], count = 0, name[MAX_PLAYER_NAME];
	GetPlayerName(playerid, name, sizeof(name));
	for(new id = 0; id < MAX_DAMAGES; id++)
	{
		if(DamageInfo[playerid][id][dmgDamage] != 0) count++;
	}
	if(count == 0) return ShowPlayerDialog(toid, DIALOG_DAMAGE, DIALOG_STYLE_LIST, name, "Este usuario no tiene heridas", "Close", "");
	else if(count > 0)
	{
		for(new id = 0; id < MAX_DAMAGES; id++)
		{
			if(DamageInfo[playerid][id][dmgDamage] != 0)
			{
				FORMAT:str1("DAÑO: %d | ARMA: %s | PARTE: %s\n", DamageInfo[playerid][id][dmgDamage], GetWeaponNameEx(DamageInfo[playerid][id][dmgWeapon]), GetBodypartName(DamageInfo[playerid][id][dmgBodypart]), DamageInfo[playerid][id][dmgKevlarhit], gettime() - DamageInfo[playerid][id][dmgSeconds]);
				strcat(str, str1);
			}
		}
		ShowPlayerDialog(toid, DIALOG_DAMAGE, DIALOG_STYLE_LIST, name, str, "Close", "");
	}
	return 1;
}

stock GetName(playerid)
{
	new name;
	GetPlayerName(playerid, name, sizeof(name));
	return name;
}
CMD:heridas(playerid, params[])
{
	new 
	id, Float: pPos[3];
	if(sscanf(params, "u", id)) return SCM(playerid, 0xFF6347FF, "Utiliza: {FFFFFF}/heridas [playerid/PartOfName]");
	if(!IsPlayerConnected(id)) return SCM(playerid, 0xFF6347FF, "Usuario no conectado.");
	
	GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
	if(IsPlayerInRangeOfPoint(playerid, 7.0, pPos[0], pPos[1], pPos[2]))
	{
		ShowPlayerDamages(id, playerid);
	}
	else return SCM(playerid, 0xB8BAC6FF, "You're too far away.");
	return 1;
}

public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
	if(IsPlayerConnected(playerid))
	{
		new 
		id, Float: pHP, Float: pArm;
		GetPlayerHealth(playerid, pHP);
		GetPlayerArmour(playerid, pArm);
		for(new i = 0; i < MAX_DAMAGES; i++)
		{
			if(!DamageInfo[playerid][i][dmgDamage])
			{
				id = i;
				break;
			}
		}
		
		DamageInfo[playerid][id][dmgDamage] = floatround(amount, floatround_round);
		DamageInfo[playerid][id][dmgWeapon] = weaponid;
		DamageInfo[playerid][id][dmgBodypart] = bodypart;
		if(pArm > 0) DamageInfo[playerid][id][dmgKevlarhit] = 1;
		else if(pArm < 1) DamageInfo[playerid][id][dmgKevlarhit] = 0;
		DamageInfo[playerid][id][dmgSeconds] = gettime();
	}
	return 1;
}

stock GetWeaponNameEx(weaponid)
{
	new weaponname[60];
	GetWeaponName(weaponid, weaponname, sizeof(weaponname));
	return weaponname;
}

stock GetBodypartName(bodypart)
{
	new bodyname[60];
	switch(bodypart)
	{
		case BODY_PART_TORSO: FORMAT:bodyname("TORSO");
		case BODY_PART_GROIN: FORMAT:bodyname("INGLE");
		case BODY_PART_RIGHT_ARM: FORMAT:bodyname("BRAZO DERECHO");
		case BODY_PART_LEFT_ARM: FORMAT:bodyname("BRAZO IZQUIERDO");
		case BODY_PART_RIGHT_LEG: FORMAT:bodyname("PIERNA DERECHA");
		case BODY_PART_LEFT_LEG: FORMAT:bodyname("PIERNA IZQUIERDA");
		case BODY_PART_HEAD: FORMAT:bodyname("CABEZA");
	}
	return bodyname;
}
  Cantidad de llaves: Abiertas(24)-Cerradas(24) | Lineas Totales: 175
Buen aporte.
Retirado de SAMP/Pawn/PawnScript/Script
Avatar de Usuario
dello
Ayudante
Ayudante
Mensajes: 251
Registrado: 09 Jun 2014 19:08
Reputación: 5

23 Sep 2018 19:26

[L]ucatito escribió:
23 Sep 2018 10:19
Spoiler:
¡Buenas noches/dias! Hoy les traigo un sistema de heridas, el cúal al colocar /heridas [ID] nos mostrara un cuadro con el daño, el arma utiliza y la parte del cuepo.

•Creditos:

-Hreesang - Por crear el filterscript en si.
-Emmet_ - Por crear el include: sscanf2.
-Zeex - Por crear el include: zcmd.
-[L]ucatito - Traducirlo al español y editarlo.

•Comandos:

-/heridas - Para ver las heridas de un jugador.

•Includes necesarios:

-a_samp
-sscanf2
-zcmd

•Código:
 Codigo Pawno:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175

//=====================INCLUDES=====================

#include 	<a_samp>
#include	<zcmd>
#include	<sscanf2>

//=====================DIALOGOS======================

#define		DIALOG_DAMAGE		1927

//==================PANEL DE CONTROL===================

#define 	FILTERSCRIPT
#define		MAX_DAMAGES			1000

#define		SCM					SendClientMessage
#define		FORMAT:%0(%1)		format(%0, sizeof(%0), %1)

#define		BODY_PART_TORSO 	3
#define 	BODY_PART_GROIN 	4
#define 	BODY_PART_RIGHT_ARM 5
#define 	BODY_PART_LEFT_ARM 	6
#define	 	BODY_PART_RIGHT_LEG 7
#define 	BODY_PART_LEFT_LEG 	8
#define 	BODY_PART_HEAD 		9

//===================ENUM'S====================

enum dmgInfo
{
	dmgDamage,
	dmgWeapon,
	dmgBodypart,
	dmgKevlarhit,
	dmgSeconds,
}
new DamageInfo[MAX_PLAYERS][MAX_DAMAGES][dmgInfo];

public OnFilterScriptInit()
{
	print("\n ==================================");
	print(" |          Damage System         |");
	print(" ==================================\n");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

stock ResetPlayerDamages(playerid)
{
	for(new id = 0; id < MAX_DAMAGES; id++)
	{
		if(DamageInfo[playerid][id][dmgDamage] != 0)
		{
			DamageInfo[playerid][id][dmgDamage] = 0;
			DamageInfo[playerid][id][dmgWeapon] = 0;
			DamageInfo[playerid][id][dmgBodypart] = 0;
			DamageInfo[playerid][id][dmgKevlarhit] = 0;
			DamageInfo[playerid][id][dmgSeconds] = 0;
		}
	}
	return 1;
}

public OnPlayerConnect(playerid)
{
	ResetPlayerDamages(playerid);
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
	ResetPlayerDamages(playerid);
	return 1;
}

stock ShowPlayerDamages(playerid, toid)
{
	new 
	str[1000], str1[500], count = 0, name[MAX_PLAYER_NAME];
	GetPlayerName(playerid, name, sizeof(name));
	for(new id = 0; id < MAX_DAMAGES; id++)
	{
		if(DamageInfo[playerid][id][dmgDamage] != 0) count++;
	}
	if(count == 0) return ShowPlayerDialog(toid, DIALOG_DAMAGE, DIALOG_STYLE_LIST, name, "Este usuario no tiene heridas", "Close", "");
	else if(count > 0)
	{
		for(new id = 0; id < MAX_DAMAGES; id++)
		{
			if(DamageInfo[playerid][id][dmgDamage] != 0)
			{
				FORMAT:str1("DAÑO: %d | ARMA: %s | PARTE: %s\n", DamageInfo[playerid][id][dmgDamage], GetWeaponNameEx(DamageInfo[playerid][id][dmgWeapon]), GetBodypartName(DamageInfo[playerid][id][dmgBodypart]), DamageInfo[playerid][id][dmgKevlarhit], gettime() - DamageInfo[playerid][id][dmgSeconds]);
				strcat(str, str1);
			}
		}
		ShowPlayerDialog(toid, DIALOG_DAMAGE, DIALOG_STYLE_LIST, name, str, "Close", "");
	}
	return 1;
}

stock GetName(playerid)
{
	new name;
	GetPlayerName(playerid, name, sizeof(name));
	return name;
}
CMD:heridas(playerid, params[])
{
	new 
	id, Float: pPos[3];
	if(sscanf(params, "u", id)) return SCM(playerid, 0xFF6347FF, "Utiliza: {FFFFFF}/heridas [playerid/PartOfName]");
	if(!IsPlayerConnected(id)) return SCM(playerid, 0xFF6347FF, "Usuario no conectado.");
	
	GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
	if(IsPlayerInRangeOfPoint(playerid, 7.0, pPos[0], pPos[1], pPos[2]))
	{
		ShowPlayerDamages(id, playerid);
	}
	else return SCM(playerid, 0xB8BAC6FF, "You're too far away.");
	return 1;
}

public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
	if(IsPlayerConnected(playerid))
	{
		new 
		id, Float: pHP, Float: pArm;
		GetPlayerHealth(playerid, pHP);
		GetPlayerArmour(playerid, pArm);
		for(new i = 0; i < MAX_DAMAGES; i++)
		{
			if(!DamageInfo[playerid][i][dmgDamage])
			{
				id = i;
				break;
			}
		}
		
		DamageInfo[playerid][id][dmgDamage] = floatround(amount, floatround_round);
		DamageInfo[playerid][id][dmgWeapon] = weaponid;
		DamageInfo[playerid][id][dmgBodypart] = bodypart;
		if(pArm > 0) DamageInfo[playerid][id][dmgKevlarhit] = 1;
		else if(pArm < 1) DamageInfo[playerid][id][dmgKevlarhit] = 0;
		DamageInfo[playerid][id][dmgSeconds] = gettime();
	}
	return 1;
}

stock GetWeaponNameEx(weaponid)
{
	new weaponname[60];
	GetWeaponName(weaponid, weaponname, sizeof(weaponname));
	return weaponname;
}

stock GetBodypartName(bodypart)
{
	new bodyname[60];
	switch(bodypart)
	{
		case BODY_PART_TORSO: FORMAT:bodyname("TORSO");
		case BODY_PART_GROIN: FORMAT:bodyname("INGLE");
		case BODY_PART_RIGHT_ARM: FORMAT:bodyname("BRAZO DERECHO");
		case BODY_PART_LEFT_ARM: FORMAT:bodyname("BRAZO IZQUIERDO");
		case BODY_PART_RIGHT_LEG: FORMAT:bodyname("PIERNA DERECHA");
		case BODY_PART_LEFT_LEG: FORMAT:bodyname("PIERNA IZQUIERDA");
		case BODY_PART_HEAD: FORMAT:bodyname("CABEZA");
	}
	return bodyname;
}
  Cantidad de llaves: Abiertas(24)-Cerradas(24) | Lineas Totales: 175
Muy buen aporte! Muchas gracias por aportarlo. -hi
Licenciatura en Cs de la computación

tostad0r - Toaster - Dello


Avatar de Usuario
[L]ucatito
Aprendiz
Aprendiz
Mensajes: 111
Registrado: 18 Abr 2018 20:56
Ubicación: Buenos Aires, Argentina.
Reputación: 8

23 Sep 2018 19:29

Gracias a todos!
Avatar de Usuario
Blazek
Aprendiz
Aprendiz
Mensajes: 2
Registrado: 03 Feb 2019 02:23
Reputación: 0

17 Abr 2019 21:23

Estuvo muy bueno tu aporte te llevas mi +1
Responder