09.08.2015, 16:22
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
TextDrawHideForPlayer(playerid,txtTimeDisp);
if(killerid == INVALID_PLAYER_ID) {
SendDeathMessage(INVALID_PLAYER_ID,playerid,reason);
new kname[MAX_PLAYER_NAME];
GetPlayerName(killerid, kname, MAX_PLAYER_NAME);
format(file2, sizeof(file2), PASTA_CONTAS, kname);
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
TextDrawHideForPlayer(playerid,txtTimeDisp);
TextDrawHideForPlayer(playerid,txtTimeDisp1);
PlayerInfo[playerid][pUsoudroga] = 0 ;
if(PlayerInfo[playerid][pPlano] == 0){
SendClientMessage(playerid, Branco, " | INFO | Vocк perdeu a consciкncia e foi levado para hospital mais prуximo.");
SendClientMessage(playerid, Branco, " | INFO | Foi retirado 600,00 R$ de sua conta bancбria para pagar o tratamento!");
SendClientMessage(playerid, Branco, " | INFO | Adquira seu convкnio mйdico e pague 100,00 mensais!");
dini_IntSet(file, "SaldoBancario", dini_Int(file, "SaldoBancario")-600);
TogglePlayerControllable(playerid, 1);
GameTextForPlayer(playerid, "~r~~h~Se Ferrou...", 1000, 1);
/*new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
CreateObject(2803, X, Y, Z-1.0, 0.0, 0.0, A);
SetPlayerPos(playerid, X, Y, Z+6);*/
if((GetPlayerInterior(playerid) == 0))
{
if(PlayerInfo[ playerid ][pProfissao] == Lixeiro)
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
SetTimerEx("CriaObjetoP",3000, false, "fff", X, Y, Z);
}
}
}
if(PlayerInfo[playerid][pPlano] == 1){
dini_IntSet(file, "SaldoBancario", dini_Int(file, "SaldoBancario")+95);
SendClientMessage(playerid, Branco, " | INFO | Vocк perdeu a consciкncia e foi levado para hospital mais prуximo.");
SendClientMessage(playerid, Branco, " | INFO | Seu plano de saъde cobriu as dispesas de seu tratamento!");
}
Spawnado[playerid] = false;
Algemado[playerid] = false;
sequestro[playerid] = 0;
profls[playerid] = 0;
profsf[playerid] = 0;
proflv[playerid] = 0;
nobarls[playerid] = 0;
nobarsf[playerid] = 0;
nobarlv[playerid] = 0;
nobarfc[playerid] = 0;
nautlls[playerid] = 0;
PlayerInfo[playerid][pConvitent] = 0;
dini_IntSet(file, "Entrevista", 0);
dini_IntSet(file2, "DM", 1);
if(preso [ playerid ] == 1){
SetPlayerPos(playerid, 263.8820,77.4002,1001.0391);
SetPlayerInterior(playerid, 6);
SetPlayerHealth(playerid,99999);
ResetPlayerWeapons(playerid);
TogglePlayerControllable(playerid, 1);
SendClientMessage(playerid, Verde, " | CADEIA | Vocк estб preso, para ser solto consulte um advogado ou pague fianзa. /fianca");
preso[playerid] = 1;
PlayerInfo[killerid][pOfmaconha] = 0;
PlayerInfo[killerid][pOfcrack] = 0;
PlayerInfo[killerid][pUsoudroga] = 0;
PlayerInfo[playerid][pTmaconha] = 0;
PlayerInfo[playerid][pTcrack] = 0;
PlayerInfo[playerid][pTcocaina] = 0;
}
if(dini_Int(file, "Sequestrado") == 1){
SetPlayerHealth(playerid,99999);
ResetPlayerWeapons(playerid);
TogglePlayerControllable(playerid, 1);
SetPlayerPos(playerid, -10.6667,2329.0613,24.3034);
SendClientMessage(playerid, Verde, " | CATIVEIRO | Vocк foi sequestrado, pague o resgate ou aguarde as autoridades.");
sequestrado[playerid] = 1;
}
if(IsPlayerInLs(playerid))
{
SetSpawnInfo(playerid, 0,dini_Int(file, "Skin"), 1175.1531,-1312.8925,13.9880,266.1378,0,0,0,0,0,0);
ClearAnimations(playerid);
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_NONE);
}
else if(IsPlayerInLv(playerid)){
SetSpawnInfo(playerid, 0,dini_Int(file, "Skin"), 1607.0583,1821.1628,10.8280,356.5667,0,0,0,0,0,0);
ClearAnimations(playerid);
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_NONE);
}
else if(IsPlayerInFc(playerid)){
SetSpawnInfo(playerid, 0,dini_Int(file, "Skin"), -316.3103,1053.5731,20.2879,1.6997,0,0,0,0,0,0);
ClearAnimations(playerid);
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_NONE);
}
else if(IsPlayerInSf(playerid)){
SetSpawnInfo(playerid, 0,dini_Int(file, "Skin"), -2652.3159,636.1181,14.4531,179.9128,0,0,0,0,0,0);
ClearAnimations(playerid);
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_NONE);
}
}else{
SendDeathMessage(killerid,playerid,reason);
new kname[MAX_PLAYER_NAME];
GetPlayerName(killerid, kname, MAX_PLAYER_NAME);
format(file2, sizeof(file2), PASTA_CONTAS, kname);
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
new playercash;
playercash = GetPlayerGrana(playerid);
ResetPlayerGrana(playerid);
PlayerInfo[playerid][pUsoudroga] = 0;
Algemado[playerid] = false;
sequestro[playerid] = 0;
profls[playerid] = 0;
profsf[playerid] = 0;
proflv[playerid] = 0;
nobarls[playerid] = 0;
nobarsf[playerid] = 0;
nobarlv[playerid] = 0;
nobarfc[playerid] = 0;
nautlls[playerid] = 0;
PlayerInfo[playerid][pConvitent] = 0;
dini_IntSet(file, "Entrevista", 0);
dini_IntSet(file2, "DM", 1);
if(IsPlayerInLs(playerid))
{
SetSpawnInfo(playerid, 0,dini_Int(file, "Skin"), 1175.1531,-1312.8925,13.9880,266.1378,0,0,0,0,0,0);
ClearAnimations(playerid);
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_NONE);
}
else if(IsPlayerInLv(playerid)){
SetSpawnInfo(playerid, 0,dini_Int(file, "Skin"), 1607.0583,1821.1628,10.8280,356.5667,0,0,0,0,0,0);
ClearAnimations(playerid);
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_NONE);
}
else if(IsPlayerInFc(playerid)){
SetSpawnInfo(playerid, 0,dini_Int(file, "Skin"), -316.3103,1053.5731,20.2879,1.6997,0,0,0,0,0,0);
ClearAnimations(playerid);
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_NONE);
}
else if(IsPlayerInSf(playerid)){
SetSpawnInfo(playerid, 0,dini_Int(file, "Skin"), -2652.3159,636.1181,14.4531,179.9128,0,0,0,0,0,0);
ClearAnimations(playerid);
}
if(DMlb == 1){
GetPlayerName(playerid, aname, sizeof(aname));
format(file2, sizeof(file2), PASTA_CONTAS, aname);
new string[128];
format(string, sizeof(string), "* | INFO | %s feriu alguem mais nгo foi colocado na lista de procurados porque o DM estava liberado!",kname);
SendClientMessageToAll(VerdeClaro, string);
return 1;
}
if(preso [ playerid ] == 1){
SetPlayerHealth(playerid,99999);
ResetPlayerWeapons(playerid);
TogglePlayerControllable(playerid, 1);
SendClientMessage(playerid, VerdeFlorecente, " | CADEIA | Vocк estб preso, para ser solto consulte um advogado ou pague fianзa. /fianca");
preso[playerid] = 1;
PlayerInfo[killerid][pOfmaconha] = 0;
PlayerInfo[killerid][pOfcocaina] = 0;
PlayerInfo[killerid][pOfcrack] = 0;
PlayerInfo[killerid][pUsoudroga] = 0;
PlayerInfo[playerid][pTmaconha] = 0;
PlayerInfo[playerid][pTcrack] = 0;
PlayerInfo[playerid][pTcocaina] = 0;
}
if(dini_Int(file, "Sequestrado") == 1){
SetPlayerHealth(playerid,99999);
ResetPlayerWeapons(playerid);
TogglePlayerControllable(playerid, 1);
SetPlayerPos(playerid, -10.6667,2329.0613,24.3034);
SendClientMessage(playerid, Verde, " | CATIVEIRO | Vocк foi sequestrado, pague o resgate ou aguartrde as autoridades.");
sequestrado[playerid] = 1;
}
if(EntrouDM[playerid] == 1)
{
KDS[playerid][Deaths] ++;//Aumenta Death
KDS[killerid][Kills] ++;//A
}
if(DMLiberado2[playerid] == 1){
new string[128];
format(string, sizeof(string), " | ANTI - DM | %s feriu alguem na favela e nгo foi colocado na lista de procurados!",kname);
SendClientMessageToAll(VerdeClaro, string);
SetSpawnInfo(playerid, 0,dini_Int(file, "Skin"), 2186.5198,-1194.8774,24.3102,267.5424,0,0,0,0,0,0);
ClearAnimations(playerid);
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_NONE);
TogglePlayerControllable(playerid, 1);
DMLiberado2[playerid] = 0;
EntrouDM[playerid] = 0;
return 1;
}
if(IsPlayerInAnyVehicle(killerid)) // Coisas novas 3
{
new string[128];
new pname[MAX_PLAYER_NAME];
aviso[killerid]++;
GetPlayerName(killerid, pname, sizeof pname);
format(string, sizeof(string), "| ANTI - DB | O Administrador Sneep_Grynn avisou o jogador: %s. ( Motivo: Drive-By (%d / 3) )", pname,aviso[killerid]);
SendClientMessageToAll(Azul, string);
format(string, sizeof(string), "| ANTI - DM | %s foi preso(a) automaticamente por matar!",pname, killerid);
SendClientMessageToAll(VerdeClaro, string);
SetPlayerPos(killerid, 263.8820,77.4002,1001.0391);
SetPlayerInterior(killerid, 6);
SetPlayerHealth(killerid,99999);
ResetPlayerWeapons(killerid);
TogglePlayerControllable(killerid, 1);
preso[killerid] = 1;
SendClientMessage(killerid, VerdeFlorecente, " | INFO | Vocк estб preso, para ser solto consulte um advogado ou pague fianзa por saldo bancario. /fianca");
dini_IntSet(file2, "Preso",1);
if(IsPlayerInLs(killerid)){
Dplos[killerid] = 1;
}else if(IsPlayerInLv(killerid)){
Dpventura[killerid] = 1;
}else if(IsPlayerInFc(killerid)){
Dpford[killerid] = 1;
}else if(IsPlayerInSf(killerid)){
Dpsan[killerid] = 1;
}
if(aviso[killerid] == 3)
{
format(string, sizeof(string), " | TSSVAdmin | O Moderador Sneep_Grynn kickou o jogador %s ( Motivo: limite de avisos )",pname);
SendClientMessageToAll(Azul, string);
SetPlayerPos(killerid, 831.9581,-1102.1510,24.2969);
GameTextForPlayer(killerid,"~r~kickado~w~!", 2500, 3);
Kick(killerid);
}
return 0;
}
new string[128];
if(noevento[playerid] == 1){
format(string, sizeof(string), " | INFO | %s feriu alguem no Evento e nгo foi colocado na lista de procurados!",kname);
SendClientMessageToAll(VerdeClaro, string);
return 1;
}
if(dini_Int(file2, "DM") == 1){
format(string, sizeof(string), "| ANTI - DM | %s foi preso(a) automaticamente por matar!",kname, aname);
SendClientMessageToAll(VerdeClaro, string);
SetPlayerPos(killerid, 263.8820,77.4002,1001.0391);
SetPlayerInterior(killerid, 6);
SetPlayerHealth(killerid,99999);
ResetPlayerWeapons(killerid);
GivePlayerGrana(killerid, playercash);
TogglePlayerControllable(killerid, 1);
SendClientMessage(killerid, VerdeFlorecente, " | INFO | Vocк estб preso, para ser solto consulte um advogado ou pague fianзa por saldo bancario. /fianca");
preso[killerid] = 1;
if(IsPlayerInLs(killerid)){
Dplos[killerid] = 1;
}else if(IsPlayerInLv(killerid)){
Dpventura[killerid] = 1;
}else if(IsPlayerInFc(killerid)){
Dpford[killerid] = 1;
}else if(IsPlayerInSf(killerid)){
Dpsan[killerid] = 1;
}
}
}
return 1;
}