26.07.2013, 18:28
ai a OnPlayerDeath
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
new string[256];
new aname[MAX_PLAYER_NAME];
new kname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
GetPlayerName(killerid, kname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
format(file2, sizeof(file2), PASTA_CONTAS, kname);
antifakekill[playerid] ++;
SetTimerEx("antifakekill2", 1000,false,"i",playerid);
if(IndicatorStatus[playerid] >=1 )
{
IndicatorStatus[playerid] = 0;
for(new i; i<MAX_VEHICLES; i++)
{
DestroyObject(gIndicator1[playerid][i]);
DestroyObject(gIndicator2[playerid][i]);
DestroyObject(gIndicator3[playerid][i]);
DestroyObject(gIndicator4[playerid][i]);
}
}
if(GetTickCount() > FloodTimer[playerid])
{
FloodAlert[playerid] = 0;
}
#if defined FGPSUser
if(GetPVarInt(playerid, "YEAH") == 1)
{
DestroyDynamicRaceCP(PlayerInfo[playerid][FGPS_RCP]);
DestroyDynamicObject(PlayerInfo[playerid][FGPSObject]);
SetPVarInt(playerid, "YEAH", 0);
DeletePVar(playerid, "Spongebob");
DeletePVar(playerid, "Mario");
DeletePVar(playerid, "SpiderPig");
DeletePVar(playerid, "FAIL");
#if defined UseTd
PlayerTextDrawHide(playerid, PlayerInfo[playerid][F_GPSTD]);
PlayerTextDrawDestroy(playerid, PlayerInfo[playerid][F_GPSTD]);
PlayerInfo[playerid][F_GPSTD] = PlayerText:INVALID_TEXT_DRAW;
#endif
}
#endif
FloodTimer[playerid] = GetTickCount() +TimerFlood;
FloodAlert[playerid]++;
if(FloodAlert[playerid] > 1 && FloodAlert[playerid] < AlertFlood-1)
{
format(string, sizeof(string), "[ x ] Anti-Kill-Flood [ x ]{FFFFFF} Vocк tem %d/%d avisos.", FloodAlert[playerid], AlertFlood);
SendClientMessage(playerid, Amarelo, string);
}
else if(FloodAlert[playerid] == AlertFlood-1)
{
format(string, sizeof(string), "[ x ] Anti-Kill-Flood [ x ]{FFFFFF} Vocк tem %d/%d avisos. Mais um e vocк serб kickado.", FloodAlert[playerid], AlertFlood);
SendClientMessage(playerid, Amarelo, string);
}
else if(FloodAlert[playerid] == AlertFlood)
{
format(string, sizeof(string), "[ KICK ]{FFFFFF} O jogador{FF0000} %s {FFFFFF}foi kickado automaticamente. Motivo: Flood Kill", PlayerName(playerid));
SendClientMessageToAll(Vermelho, string);
KickLog(string);
Kick(playerid);
return 1;
}
if(ProvocoLoja1[playerid] == 1)
{
format(string, sizeof(string), "Mataram %s em um Roubo a Loja de Armas. Dinheiro Foi devolvido ao Estabelecimento.", aname);
SendClientMessageToAll(msgdm3, string);
ProvocoLoja1[playerid] = 0; roubando[playerid] = 0; rouboloja1 = 0; KillTimer(tempoloja1); temporouboloja1 = 0;
}
if(ProvocoBanco[playerid] == 1)
{
format(string, sizeof(string), "Mataram %s em um Roubo ao Banco. Dinheiro Foi devolvido ao Estabelecimento.", aname);
SendClientMessageToAll(msgdm3, string);
ProvocoBanco[playerid] = 0; roubando[playerid] = 0; roubobanco = 0; KillTimer(tempobanco); temporoubobanco = 0;
}
if(Provocobinco[playerid] == 1)
{
format(string, sizeof(string), "Mataram %s em um Roubo a Binco. Dinheiro Foi devolvido ao Estabelecimento.", aname);
SendClientMessageToAll(msgdm3, string);
Provocobinco[playerid] = 0; roubando[playerid] = 0; roubobinco = 0; KillTimer(tempobinco); temporoubobinco = 0;
}
if(Provococlube[playerid] == 1)
{
format(string, sizeof(string), "Mataram %s em um Roubo ao Clube! o Dinheiro Foi devolvido ao Estabelecimento.", aname);
SendClientMessageToAll(msgdm3, string);
Provocobinco[playerid] = 0; roubando[playerid] = 0; rouboclube = 0; KillTimer(tempoclube); temporouboclube = 0;
}
#if defined BomberUser
if(GetPVarInt(playerid, "nearExp") != INVALID_PLAYER_ID && killerid == INVALID_PLAYER_ID)
{
killerid = GetPVarInt(playerid, "nearExp");
if(killerid == playerid)
{
killerid = INVALID_PLAYER_ID;
}
reason = 51;
}
#endif
SendDeathMessage(killerid, playerid, reason);
if(cercado[playerid] == 1)
{
UncagePlayer(playerid);
cercado[playerid] = 0;
}
// ================================ Anim Loops =====================================
#if defined AnimLoopsUser
if(gPlayerUsingLoopingAnim[playerid])
{
gPlayerUsingLoopingAnim[playerid] = 0;
SendClientMessage(playerid, Blue, "Para sair do anime tecle 'Espaзo'.");
}
#endif
// =================================================================================
dini_IntSet(file, "convitent", 0);
dini_IntSet(file, "Entrevista", 0);
if(autoescola[playerid] == 1)
{
if(IsPlayerInAnyVehicle(playerid))
{
new id = GetPlayerVehicleID(playerid);
DestroyVehicle(id);
id = INVALID_VEHICLE_ID;
}
}
if(dini_Int(file, "usoudroga") == 1)
{
TextDrawHideForPlayer(playerid, drogas1);
TextDrawHideForPlayer(playerid, drogas2);
dini_IntSet(file, "usoudroga", 0);
}
TextDrawShowForPlayer(playerid, topblack);
TextDrawShowForPlayer(playerid, bottomblack);
SetTimerEx("HideTopblack", 3000, 0, "d", playerid);
algemado[playerid] = 0;
GPS_Spawned[playerid] = 0;
autoescola[playerid] = 0;
sequestro[playerid] = 0;
xprefls[playerid] = 0;
prefsf[playerid] = 0;
preflv[playerid] = 0;
nobanco[playerid] = 0;
nobarls[playerid] = 0;
nobarsf[playerid] = 0;
nobarlv[playerid] = 0;
nobarfc[playerid] = 0;
nautlls[playerid] = 0;
nautllv[playerid] = 0;
if(GetClosestHospital(playerid) == 0)
{
SetSpawnInfo(playerid, 1, dini_Int(file, "Skin"), -2651.6501, 634.4510, 14.4531, 180.0000, 0, 0, 0, 0, 0, 0);
}
else if(GetClosestHospital(playerid) == 1)
{
SetSpawnInfo(playerid, 1 ,dini_Int(file, "Skin"), 1173.5842, -1324.5615, 15.1953, 278.4624, 0, 0, 0, 0, 0, 0);
}
else if(GetClosestHospital(playerid) == 2)
{
SetSpawnInfo(playerid, 1, dini_Int(file, "Skin"), 2031.9415, -1404.3578, 17.2614, 165.8180, 0, 0, 0, 0, 0, 0);
}
else if(GetClosestHospital(playerid) == 3)
{
SetSpawnInfo(playerid, 1, dini_Int(file, "Skin"), 1582.5615, 1768.7921, 10.8203, 93.7454, 0, 0, 0, 0, 0, 0);
}
if(dini_Int(file, "Preso") == 1)
{
preso[playerid] = 1;
dini_IntSet(file, "ofmaconha", 0);
dini_IntSet(file, "ofcocaina", 0);
dini_IntSet(file, "ofcrack", 0);
dini_IntSet(file, "tmaconha", 0);
dini_IntSet(file, "tcrack", 0);
dini_IntSet(file, "tcocaina", 0);
dini_IntSet(file, "Maconha", 0);
dini_IntSet(file, "Crack", 0);
dini_IntSet(file, "Cocaina", 0);
ResetPlayerWeapons(playerid);
SetPlayerHealth(playerid, 999999);
SetPlayerWantedLevel(playerid, 2);
SetPlayerPos(playerid, 263.8820, 77.4002, 1001.0391);
SetPlayerInterior(playerid, 6);
TogglePlayerControllable(playerid, 1);
SendClientMessage(playerid, msgdm, " Vocк estб preso, para ser solto consulte um advogado");
SendClientMessage(playerid, msgdm, "ou pague fianзa pelo saldo bancario /fianca");
}
if(reason == 53 || reason == 54 || reason == 255)
{
if(DMlb == 1)
{
format(string, sizeof(string), "%s morreu com DM liberado!", aname);
SendClientMessageToAll(msgdm3, string);
}
if(nogame[playerid] == 1)
{
if(IsPlayerInAnyVehicle(playerid))
{
new id = GetPlayerVehicleID(playerid);
DestroyVehicle(id);
id = INVALID_VEHICLE_ID;
}
format(string, sizeof(string), "| ANTI-DM | %s morreu em um Game!", aname);
SendClientMessageToAll(msgdm3, string);
}
if(noevento[playerid] == 1)
{
format(string, sizeof(string), "%s morreu em um Evento!", aname);
SendClientMessageToAll(msgdm3, string);
}
morreu[playerid]++;
}
else
{
if(noevento[playerid] == 1)
{
format(string, sizeof(string), "%s matou alguem em um Evento!", kname);
SendClientMessageToAll(msgdm3, string);
}
if(dini_Int(file2, "DM") == 1)
{
if(DMlb == 1) return SendClientMessage(killerid, Verde, "[ x ]{FFFFFF} Vocк matou com DM liberado portanto nгo levou aviso.");
SetPlayerWantedLevel(killerid, 4);
dini_IntSet(file2, "Procurado", 1);
Procurados[killerid] = 1;
new stringG[500];
aviso[killerid]+=1;
new pName[MAX_PLAYER_NAME];
GetPlayerName(killerid, pName, sizeof(pName));
format(stringG, sizeof(stringG), "{FF0000}[ ANTI DM ] {FFFFFF}O Jogador{FF0000} %s {FFFFFF}foi avisado a nгo cometer DM {FF0000}[ %d/3 ]", pName, aviso[killerid]);
SendClientMessageToAll(Blue, stringG);
SendClientMessage(killerid, Vermelho, "[ x ] {FFFFFF} Vocк estб sendo procurado por matar alguem");
if(aviso[killerid]>= 3)
{
format(stringG, sizeof(stringG), "{FF0000}[ ANTI DM ] {FFFFFF}O Jogador{FF0000} %s {FFFFFF}foi kickado automaticamente. Motivo: DM 3/3" ,pName);
SendClientMessageToAll(Blue, stringG);
SetTimerEx("KickCMD", 1000, 0, "d", killerid);
}
}
}
morreu[playerid]++;
matou[killerid]++;
dini_IntSet(file2, "DM", 1);
return 1;
}