Код:
public OnPlayerDeath(playerid, killerid, reason)
{
//----------------------------- [ anti fake kill ] ---------------------------//
antifakekill[playerid] ++;
SetTimerEx("antifakekill2", 1000,false,"i",playerid);
//-------------------------- [ bomba nuclear vip ] ---------------------------//
if(BuscadoPorNuclear[playerid]==1)
{
HanDesactivadaoLaBomba[playerid]=1;
}
//---------------------------------- [ configuracion ] -----------------------//
BoCmd4[playerid] = 0;
BoCmd5[playerid] = 0;
poderesenauto[playerid] = 0;
TextDrawHideForPlayer(playerid,HAYTD[playerid]);
JoinedHay[playerid] = 0;
modoheno[playerid] = 0;
scoreheno[playerid] = 0;
tiempohen[playerid] = 0;
//---------------------------------- [ heno ] --------------------------------//
if(BoCmd3[playerid] == 1)
{
BoCmd3[playerid] = 0;
SetPlayerScore(playerid,GetPlayerScore(playerid)-100);
PlayerInfo[playerid][Kills] = GetPlayerScore(playerid);
GameTextForPlayer(playerid,"~g~~H~PERDISTE ~w~100 DE SCORE ~g~POR MORIR~n~~w~EN HENO", 3000, 3);
}
//--------------------------- [ evento ] -------------------------------------//
if(TaNoEvento[playerid])
{
TaNoEvento[playerid] = false;
}
if(GetVehicleModel(Cars[playerid]))
{
DestroyVehicle(Cars[playerid]);
}
//------------------------------ [ aquaman ] ---------------------------------//
new strs[128];
if(Minigamer_{playerid} == true)
{
if(inProgress > 1)
{
format(strs,sizeof(strs),"*"VERDECLARO"%s "BLAN"ha abandonado "ROJOS"aquaman"AZULES" minijuego, "ROJOS"clasificar %d",PlayerName2(playerid),Iter_Count(_Minigamer));
SendClientMessageToAll(LIME,strs);
Iter_Remove(_Minigamer,playerid);
Minigamer_{playerid} = false;
if(Iter_Count(_Minigamer) < 2)
{
foreach(_Minigamer,i)MinigameWinner(i);
}
}
else
{
SendClientMessage(playerid,LIME,""BLAN"Tu entrada para "ROJOS"aquaman"BLAN" minijuego ha sido cancelada." );
Iter_Remove(_Minigamer,playerid);
Minigamer_{playerid} = false;
}
}
//------------------------------- [ lspec ] ----------------------------------//
for(new x=0; x<MAX_PLAYERS; x++)
if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && PlayerInfo[x][SpecID] == playerid)
AdvanceSpectate(x);
//------------------------------- [ flecha ] ---------------------------------//
if(Empezado == 1)
{
if(killerid != INVALID_PLAYER_ID && playerid == Portador)
{
AttachObjectToPlayer(Flecha, killerid, 0, 0, 2, 0, 0, 0);
Portador = killerid;
GameTextForPlayer(killerid,"~g~~H~GANASTE ~w~20 DE SCORE ~g~POR MATAR~n~~w~AL PORTADOR DE LA FLECHA", 3000, 3);
SetPlayerScore(killerid,GetPlayerScore(killerid)+20);
PlayerInfo[killerid][Kills] = GetPlayerScore(killerid);
}
else if(killerid == INVALID_PLAYER_ID && playerid == Portador)
{
Suplantar();
}
}
//------------------------- [ carreras ] -------------------------------------//
if(Joined[playerid] == true)
{
JoinCount--;
Joined[playerid] = false;
DestroyVehicle(CreatedRaceVeh[playerid]);
DisablePlayerRaceCheckpoint(playerid);
TextDrawHideForPlayer(playerid, RaceInfo[playerid]);
TextDrawHideForPlayer(playerid, abandonar[playerid]);
CPProgess[playerid] = 0;
franco[playerid][tirador] = 1;
BoCmd[playerid] = 0;
KillTimer(InfoTimer[playerid]);
#if defined RACE_IN_OTHER_WORLD
SetPlayerVirtualWorld(playerid, 0);
#endif
}
if(BuildRace == playerid+1) BuildRace = 0;
//------------------------------- [ duelos ] ---------------------------------//
if (EnDuelo[playerid] == 1 && EnDuelo[killerid] == 1)
{
for (new i=1; i<= ARENAS; i++)
{
if ((Duelos[i][DesaId] == playerid || Duelos[i][DesaId] == killerid) && (Duelos[i][DesafiadoId] == playerid) || (Duelos[i][DesafiadoId] == killerid))
{
new str0[128];
format(str0,sizeof(str0),"-|Info|- Haz perdido el duelo contra %s",PlayerName2(killerid));
SendClientMessage(playerid,COLOR_DUELO,str0);
format(str0,sizeof(str0),"-|Info|- Haz ganado el duelo contra %s",PlayerName2(playerid));
SendClientMessage(killerid,COLOR_DUELO,str0);
SendClientMessage(killerid,COLOR_DUELO,"-|Info|- Ahora estas en las graderias, para volver a tener un duelo usa /duelo invitar.");
EnDuelo[playerid] = 0;
EnDuelo[killerid] = 0;
BoCmd2[playerid] = 0;
BoCmd2[killerid] = 0;
PlayerInfo[playerid][Bloqueado] = 0;
PlayerInfo[killerid][Bloqueado] = 0;
PlayerInfo[killerid][Dwin] ++;
PlayerInfo[playerid][Dlose] ++;
Duelos[i][DesafiadoId] = -1;
Duelos[i][DesaId] = -1;
Duelos[i][ArmasId] = -1;
Duelos[i][Libre] = 0;
ShowInformationTxt(killerid);
ShowInformationTxt(playerid);
switch (i)
{
case 1: {
SetPlayerPos(killerid,2626.5664,1206.4237,28.0004);
SetPlayerFacingAngle(killerid,274.9405);
SetPlayerVirtualWorld(killerid, 0);
}
case 2: {
SetPlayerPos(killerid,-1562.8058,310.9799,53.4609);
SetPlayerFacingAngle(killerid,278.5559);
SetPlayerVirtualWorld(killerid, 0);
}
case 3: {
SetPlayerPos(killerid,-2030.9362,-425.7924,71.554);
SetPlayerFacingAngle(killerid,145.0746);
SetPlayerVirtualWorld(killerid, 0);
GivePlayerWeapon(playerid,46,1);
}
case 4: {
SetPlayerPos(killerid,2792.4976,-1455.7574,40.048);
SetPlayerFacingAngle(killerid,353.4433);
SetPlayerVirtualWorld(killerid, 0);
}
}
for (new j=0; j<= MAX_PLAYERS; j++)
{
if (ViendoDuelo[j] == i)
{
new str20[256];
format(str20,sizeof(str20),"~r~%s ~w~es el ganador del duelo",PlayerName2(killerid));
GameTextForPlayer(j,str20,5000,0);
ViendoDuelo[j] =-1;
SetPlayerVirtualWorld(j, 0);
}
}
return 1;
}
}
}
if (EnDuelo[playerid] == 1 && EnDuelo[killerid] == 0)
{
}
//--------------------------------- [ hitman ] -------------------------------//
new playercash;
new ajustshit[256];
new killedplayer[MAX_PLAYER_NAME];
if(killerid == INVALID_PLAYER_ID)
{
}
else
{
if(bounty[playerid] > 0)
{
GetPlayerName(playerid, killedplayer, sizeof(killedplayer));
format(ajustshit, sizeof(ajustshit), "Has recibido una recompensa de %d de score por matar a %s.", bounty[playerid], killedplayer);
SendClientMessage(killerid, COLOR_YELLOW, ajustshit);
SetPlayerScore(killerid,GetPlayerScore(killerid)+bounty[playerid]);
PlayerInfo[killerid][Kills] = GetPlayerScore(killerid);
if(PlayerInfo[killerid][LoggedIn] == 1)
{
GuardarDatos(killerid);
SetPlayerVip(killerid);
SetPlayerVip2(killerid);
}
ShowInformationTxt(killerid);
bounty[playerid] = 0;
}
if(playercash > 0)
{
SetPlayerScore(killerid,GetPlayerScore(killerid)+playercash);
PlayerInfo[killerid][Kills] = GetPlayerScore(killerid);
if(PlayerInfo[killerid][LoggedIn] == 1)
{
GuardarDatos(killerid);
SetPlayerVip(killerid);
SetPlayerVip2(killerid);
}
ShowInformationTxt(killerid);
}
}
if(playercash > 0)
{
ResetPlayerMoney(playerid);
}
//------------------------------- [ stats ] ----------------------------------//
SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
PlayerInfo[killerid][Kills] = GetPlayerScore(killerid);
SetPlayerScore(playerid,GetPlayerScore(playerid)-1);
PlayerInfo[playerid][Kills] = GetPlayerScore(playerid);
PlayerInfo[playerid][Deaths]++;
if(IsPlayerConnected(killerid) && killerid != INVALID_PLAYER_ID)
{
if(GetPlayerWeapon(killerid) == 34){PlayerInfo[killerid][Experiencia]=PlayerInfo[killerid][Experiencia]+5;}
if(GetPlayerWeapon(killerid) == 33){PlayerInfo[killerid][Experiencia]=PlayerInfo[killerid][Experiencia]+4;}
if(GetPlayerWeapon(killerid) == 32){PlayerInfo[killerid][Experiencia]=PlayerInfo[killerid][Experiencia]+2;}
if(GetPlayerWeapon(killerid) == 30){PlayerInfo[killerid][Experiencia]=PlayerInfo[killerid][Experiencia]+3;}
if(GetPlayerWeapon(killerid) == 31){PlayerInfo[killerid][Experiencia]=PlayerInfo[killerid][Experiencia]+3;}
if(GetPlayerWeapon(killerid) == 29){PlayerInfo[killerid][Experiencia]=PlayerInfo[killerid][Experiencia]+3;}
if(GetPlayerWeapon(killerid) == 28){PlayerInfo[killerid][Experiencia]=PlayerInfo[killerid][Experiencia]+2;}
if(GetPlayerWeapon(killerid) == 27){PlayerInfo[killerid][Experiencia]=PlayerInfo[killerid][Experiencia]+4;}
if(GetPlayerWeapon(killerid) == 26){PlayerInfo[killerid][Experiencia]=PlayerInfo[killerid][Experiencia]+2;}
if(GetPlayerWeapon(killerid) == 25){PlayerInfo[killerid][Experiencia]=PlayerInfo[killerid][Experiencia]+5;}
if(GetPlayerWeapon(killerid) == 24){PlayerInfo[killerid][Experiencia]=PlayerInfo[killerid][Experiencia]+4;}
if(GetPlayerWeapon(killerid) == 23){PlayerInfo[killerid][Experiencia]=PlayerInfo[killerid][Experiencia]+3;}
if(GetPlayerWeapon(killerid) == 22){PlayerInfo[killerid][Experiencia]=PlayerInfo[killerid][Experiencia]+3;}
}
ShowInformationTxt(playerid);
ShowInformationTxt(killerid);
if(PlayerInfo[playerid][LoggedIn] == 1)
{
GuardarDatos(playerid);
SetPlayerVip(playerid);
SetPlayerVip2(playerid);
}
if(PlayerInfo[killerid][LoggedIn] == 1)
{
GuardarDatos(killerid);
SetPlayerVip(killerid);
SetPlayerVip2(killerid);
}
//------------------------ [ mensaje de vida y muerte ] ----------------------//
SetTimerEx("mvictoria", 3500, 0, "dd",killerid,playerid);
TextDrawSetString(vmensaje[playerid],KSMensajes[random(sizeof(KSMensajes))]);
TextDrawShowForPlayer(killerid,vmensaje[playerid]);
new c = random(5);
{
new minfo[400];
if (c == 0)
{
format(minfo, sizeof(minfo), "~>~ ~w~~h~eres demaciado lento ~<~");
TextDrawSetString(vmensaje[playerid],minfo);
TextDrawShowForPlayer(playerid,vmensaje[playerid]);
SetTimerEx("mmuerte", 3500, 0, "dd", playerid);
}
else if (c == 1)
{
format(minfo, sizeof(minfo), "~>~ ~w~~h~eres demaciado debil ~<~");
TextDrawSetString(vmensaje[playerid], minfo);
TextDrawShowForPlayer(playerid,vmensaje[playerid]);
SetTimerEx("mmuerte", 3500, 0, "dd", playerid);
}
else if (c == 2)
{
format(minfo, sizeof(minfo), "~>~ ~w~~h~eres un navo ~<~");
TextDrawSetString(vmensaje[playerid], minfo);
TextDrawShowForPlayer(playerid,vmensaje[playerid]);
SetTimerEx("mmuerte", 3500, 0, "dd", playerid);
}
else if (c == 3)
{
format(minfo, sizeof(minfo), "~>~ ~w~~h~contigo me hago premium ~<~");
TextDrawSetString(vmensaje[playerid], minfo);
TextDrawShowForPlayer(playerid,vmensaje[playerid]);
SetTimerEx("mmuerte", 3500, 0, "dd", playerid);
}
else if (c == 4)
{
format(minfo, sizeof(minfo), "~>~ ~w~~h~pierdo balas contigo ~<~");
TextDrawSetString(vmensaje[playerid], minfo);
TextDrawShowForPlayer(playerid,vmensaje[playerid]);
SetTimerEx("mmuerte", 3500, 0, "dd", playerid);
}
}
SetPlayerHealth(playerid, 100);
return 1;
}