View difference between Paste ID: MEp51Rdz and zV9YRsih
SHOW: | | - or go back to the newest paste.
1
/*
2
3
		 SISTEMA DE RECOMPENSAS
4
		    By:Lucas_Alemao
5
		          ou
6
			  [iPs]Lucas
7
*/
8
9
10
#include a_samp
11
#include zcmd
12
13
//Defina o valor inicial da recomepnsa.
14
#define 	VALOR_INICIAL 1200
15
16
#define GetarDado(%0,%1) %1[%0]
17
18
const Verde = 0x12C41E96;
19
20
new Recompensa[MAX_PLAYERS];
21
new Matou[MAX_PLAYERS];
22
new Seguidos[MAX_PLAYERS];
23-
new str[256];
23+
new str[150];
24
25
public OnFilterScriptInit()
26
{
27
	print("\n\nFS de recompensas By [iPs]Lucas carregado com sucesso\n\n");
28
	return 1;
29
}
30
31
public OnPlayerConnect(playerid)
32
{
33
	Recompensa[playerid] = 0;
34
	Matou[playerid] = 0;
35
	Seguidos[playerid] = 0;
36
	return 1;
37
}
38
39
public OnPlayerDeath(playerid, killerid, reason)
40
{
41
	Matou[killerid]++;
42
	Matou[playerid] = 0;
43
	Seguidos[killerid]++;
44
	if(GetarDado(killerid, Matou) == 1)
45
	{
46
		Recompensa[killerid] = VALOR_INICIAL;
47
	}
48
	else if(GetarDado(killerid, Seguidos) >= 5)
49
	{
50
	    format(str, sizeof(str), "[ATENÇÃO] O Jogador {0EF01D}%s{12C41E} ja matou %d pessoas consecutivas. Sua cabeça está valendo $%d.", Nome(killerid), GetarDado(killerid, Matou), GetarDado(killerid, Recompensa));
51
	    SendClientMessageToAll(Verde, str);
52
	    Recompensa[killerid] = Recompensa[killerid]*2;
53
	    Seguidos[killerid] = 0;
54
	}
55
	if(GetarDado(playerid, Recompensa) > 0)
56
	{
57
	    GivePlayerMoney(killerid, Recompensa[playerid]);
58
		format(str, sizeof(str), "[ATENÇÃO] O Jogador {0EF01D}%s{12C41E} Matou {0EF01D}%s{12C41E} e ganhou uma recompensa de $%d.", Nome(killerid), Nome(playerid), GetarDado(playerid, Recompensa));
59
		SendClientMessageToAll(Verde, str);
60
		Recompensa[playerid] = 0;
61
		Seguidos[playerid] = 0;
62
	}
63
}
64
65
CMD:cabecas(playerid)
66
{
67
    for(new i = 0; i < MAX_PLAYERS; ++i)
68
    {
69
        if(Matou[i] >= 5)
70
        {
71
            format(str, sizeof(str), "%s - $%d - Matou: %d", Nome(i), GetarDado(i, Recompensa), GetarDado(i, Matou));
72
            SendClientMessage(playerid, Verde, str);
73
		}
74
	}
75
	return 1;
76
}
77
78
stock Nome(playerid)
79
{
80
	new pname[24];
81
	GetPlayerName(playerid, pname, 24);
82
	return pname;
83
}