07.08.2018, 00:32
(
Последний раз редактировалось InsaneBR; 07.08.2018 в 04:04.
)
PHP код:
#include <a_samp>
new
Team[2],
kills_Team[2]
;
public OnFilterScriptExit()
{
for(new n = 0; n < 2; n++) {
kills_Team[n] = 0;
Team[n] = 0;
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
SetPlayerTeam(playerid, 0);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
SendDeathMessage(killerid, playerid, reason);
new str[45];
if(GetPlayerTeam(playerid) > 0 && GetPlayerTeam(playerid) != GetPlayerTeam(killerid))
{
switch(GetPlayerTeam(killerid)) {
case 1:kills_Team[0]++, format(str, 45, "~b~Time 1 ~w~] ~r~Time 2~n~~b~%i ~w~X ~r~%i", kills_Team[0], kills_Team[1]), GameTextForAll(str, 1000, 4);
case 2:kills_Team[1]++, format(str, 45, "~b~Time 1 ~w~] ~r~Time 2~n~~b~%i ~w~X ~r~%i", kills_Team[0], kills_Team[1]), GameTextForAll(str, 1000, 4);
}
}
if(kills_Team[0] > 19 || kills_Team[1] > 19)
{
new strWin[65];
format(strWin, 65, "O Time %i fez 20 assassinatos e venceu a guerra contra o Time %i.", GetPlayerTeam(killerid), GetPlayerTeam(playerid));
SendClientMessageToAll(-1, strWin);
for(new n = 0; n < 2; n++) {
kills_Team[n] = 0;
Team[n] = 0;
}
for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++) {
if(GetPlayerTeam(i) == GetPlayerTeam(killerid)) {
GivePlayerMoney(i, 5000);
}
SetPlayerTeam(i, 0);
}
}
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/time", cmdtext, true, 5) == 0)
{
if(GetPlayerTeam(playerid) > 0) return SendClientMessage(playerid, -1, "Vocк jб entrou em um time!");
if(Team[1] < Team[0]) {
SetPlayerTeam(playerid, 2), SendClientMessage(playerid, -1, "Vocк entrou no time 2!"), Team[1]++;
}
else SetPlayerTeam(playerid, 1), SendClientMessage(playerid, -1, "Vocк entrou no time 1!"), Team[0]++;
return 1;
}
return 0;
}