[Ajuda] OnplayerDeath
#1

Preciso de ajuda com uma coisa aki.
sabe q tem aqueles nbs q usam auto fake kill. e estavam acabando com meu sv
Eu achei esse anti fake kill aki:http://forum.sa-mp.com/showpost.php?...67&postcount=8

Ele funcionou perfeitamente , mas dai bugou as outras coisas do onplayerdeath
Antes quando o player matava aparecia uma mensagem na tela,
e o player fikava procurado
mas depois q coloquei o ant fake kill
parou de funcionar isso
Aki esta o meu onplayerdath:

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{

 totaldemortes[playerid]++;
    if(totaldemortes[playerid] >  2) return SendClientMessage(playerid,-1,"Crйditos a tio le le leo.!"),Ban(playerid);
    SetTimerEx("funfa", 1000, false, "i",playerid);
    return 1;

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);
GameTextForPlayer(playerid,"~p~voce morreu..", 2500, 5);
dini_IntSet(file, "usoudroga", 1);
TextDrawShowForPlayer(playerid, topblack);
TextDrawShowForPlayer(playerid, bottomblack);
algemado[playerid] = 0;
GPS_Spawned[playerid] = 0;
autoescola[playerid] = 0;
sequestro[playerid] = 0;
prefls[playerid] = 0;
prefsf[playerid] = 0;
preflv[playerid] = 0;
nobarls[playerid] = 0;
nobarsf[playerid] = 0;
nobarlv[playerid] = 0;
nobarfc[playerid] = 0;
nautlls[playerid] = 0;
dini_IntSet(file, "convitent", 0);
dini_IntSet(file, "Entrevista", 0);
dini_IntSet(file2, "DM", 1);
SetPlayerWantedLevel(killerid, 1);
dini_IntSet(file, "usoudroga", 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(DMlb == 1){
new string[256];
format(string, sizeof(string), "(INFO) O jogador %s nгo foi preso porque o DM estava liberado!",kname);
SendClientMessageToAll(msgdm3, string);
return 1;
}
if(dini_Int(file, "Preso") == 1){
SetPlayerPos(playerid, 263.8820,77.4002,1001.0391);
SetPlayerInterior(playerid, 6);
SetPlayerHealth(playerid,99999);
ResetPlayerWeapons(playerid);
TogglePlayerControllable(playerid, 1);
SendClientMessage(playerid, msgdm, "(INFO) Vocк estб preso, para ser solto consulte um advogado ou pague fianзa pelo saldo bancario. /fianca");
preso[playerid] = 1;
dini_IntSet(file2, "ofmaconha", 0);
dini_IntSet(file2, "ofcocaina", 0);
dini_IntSet(file2, "ofcrack", 0);
dini_IntSet(file, "usoudroga", 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);
}
/*if(DMLiberados[playerid] == 1){
new string[256];
format(string, sizeof(string), "| ANTI-DM | O jogador %s nгo foi preso por matar na base da Swat! (DM Liberado)",kname);
SendClientMessageToAll(msgdm3, string);
return 1;
}
if(DMLiberadoy[playerid] == 1){
new string[256];
format(string, sizeof(string), "| ANTI-DM | O jogador %s nгo foi preso por matar na base da CV! (DM Liberado)",kname);
SendClientMessageToAll(msgdm3, string);
return 1;
}*/

if(DMLiberado2[playerid] == 1){
new string[256];
format(string, sizeof(string), "* %s matou %s na favela e nгo foi colocado na lista de procurados!",kname, aname);
SendClientMessageToAll(0xA80000AA, string);
SetSpawnInfo(playerid, 0,dini_Int(file, "Skin"), 2122.4463, -1212.4840, 23.9644, 93.7454, 0, 0, 0, 0, 0, 0);
ClearAnimations(playerid);
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_NONE);
TogglePlayerControllable(playerid, 1);
return 1;
}
if(nogame[playerid] == 1){
new string[256];
format(string, sizeof(string), "| ANTI-DM | O jogador %s nгo foi preso por matar em um Game! (DM Liberado)",kname);
SendClientMessageToAll(msgdm3, string);
return 1;
}
if(noevento[playerid] == 1){
new string[256];
format(string, sizeof(string), "* %s matou alguem no Evento e nгo foi colocado na lista de procurados!",kname);
SendClientMessageToAll(msgdm3, string);
return 1;
}
if(dini_Int(file2, "DM") == 1){
new string[256];
format(string, sizeof(string), "* %s matou  %s e estб sendo procurado pela Policia!",kname, aname);
SendClientMessageToAll(Vermelho, string);
dini_IntSet(file2, "Procurado", 1);
Procurados[killerid] = 1;
SetPlayerWantedLevel(killerid, 1);
}

return 1;
}

oq eu fiz de errado ?
eu coloquei no local errado o ant fake kill?
Reply
#2

cara a unica funзao nesse codigo ae que esta emitindo palavras na tela
e
pawn Код:
GameTextForPlayer(playerid,"~p~voce morreu..", 2500, 5);
cade as outras que vc fala que tinha ?
Reply
#3

pawn Код:
SetTimerEx("funfa", 1000, false, "i",playerid);
return 1;
O return 1... todo o resto do code apуs o 1 return nгo irб funcionar.

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{

    totaldemortes[playerid]++;
    if(totaldemortes[playerid] >  2) return SendClientMessage(playerid,-1,"Crйditos a tio le le leo.!"),Ban(playerid);
    SetTimerEx("funfa", 1000, false, "i",playerid);

    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);
    GameTextForPlayer(playerid,"~p~voce morreu..", 2500, 5);
    dini_IntSet(file, "usoudroga", 1);
    TextDrawShowForPlayer(playerid, topblack);
    TextDrawShowForPlayer(playerid, bottomblack);
    algemado[playerid] = 0;
    GPS_Spawned[playerid] = 0;
    autoescola[playerid] = 0;
    sequestro[playerid] = 0;
    prefls[playerid] = 0;
    prefsf[playerid] = 0;
    preflv[playerid] = 0;
    nobarls[playerid] = 0;
    nobarsf[playerid] = 0;
    nobarlv[playerid] = 0;
    nobarfc[playerid] = 0;
    nautlls[playerid] = 0;
    dini_IntSet(file, "convitent", 0);
    dini_IntSet(file, "Entrevista", 0);
    dini_IntSet(file2, "DM", 1);
    SetPlayerWantedLevel(killerid, 1);
    dini_IntSet(file, "usoudroga", 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(DMlb == 1) {
        new string[256];
        format(string, sizeof(string), "(INFO) O jogador %s nгo foi preso porque o DM estava liberado!",kname);
        SendClientMessageToAll(msgdm3, string);
        return 1;
    }
    if(dini_Int(file, "Preso") == 1) {
        SetPlayerPos(playerid, 263.8820,77.4002,1001.0391);
        SetPlayerInterior(playerid, 6);
        SetPlayerHealth(playerid,99999);
        ResetPlayerWeapons(playerid);
        TogglePlayerControllable(playerid, 1);
        SendClientMessage(playerid, msgdm, "(INFO) Vocк estб preso, para ser solto consulte um advogado ou pague fianзa pelo saldo bancario. /fianca");
        preso[playerid] = 1;
        dini_IntSet(file2, "ofmaconha", 0);
        dini_IntSet(file2, "ofcocaina", 0);
        dini_IntSet(file2, "ofcrack", 0);
        dini_IntSet(file, "usoudroga", 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);
    }
/*if(DMLiberados[playerid] == 1){
new string[256];
format(string, sizeof(string), "| ANTI-DM | O jogador %s nгo foi preso por matar na base da Swat! (DM Liberado)",kname);
SendClientMessageToAll(msgdm3, string);
return 1;
}
if(DMLiberadoy[playerid] == 1){
new string[256];
format(string, sizeof(string), "| ANTI-DM | O jogador %s nгo foi preso por matar na base da CV! (DM Liberado)",kname);
SendClientMessageToAll(msgdm3, string);
return 1;
}*/

    if(DMLiberado2[playerid] == 1) {
        new string[256];
        format(string, sizeof(string), "* %s matou %s na favela e nгo foi colocado na lista de procurados!",kname, aname);
        SendClientMessageToAll(0xA80000AA, string);
        SetSpawnInfo(playerid, 0,dini_Int(file, "Skin"), 2122.4463, -1212.4840, 23.9644, 93.7454, 0, 0, 0, 0, 0, 0);
        ClearAnimations(playerid);
        SetPlayerSpecialAction(playerid,SPECIAL_ACTION_NONE);
        TogglePlayerControllable(playerid, 1);
        return 1;
    }
    if(nogame[playerid] == 1) {
        new string[256];
        format(string, sizeof(string), "| ANTI-DM | O jogador %s nгo foi preso por matar em um Game! (DM Liberado)",kname);
        SendClientMessageToAll(msgdm3, string);
        return 1;
    }
    if(noevento[playerid] == 1) {
        new string[256];
        format(string, sizeof(string), "* %s matou alguem no Evento e nгo foi colocado na lista de procurados!",kname);
        SendClientMessageToAll(msgdm3, string);
        return 1;
    }
    if(dini_Int(file2, "DM") == 1) {
        new string[256];
        format(string, sizeof(string), "* %s matou  %s e estб sendo procurado pela Policia!",kname, aname);
        SendClientMessageToAll(Vermelho, string);
        dini_IntSet(file2, "Procurado", 1);
        Procurados[killerid] = 1;
        SetPlayerWantedLevel(killerid, 1);
    }

    return 1;
}
Reply
#4

Falei errado , sao mensagens no chat
pawn Код:
format(string, sizeof(string), "| ANTI-DM | O jogador %s nгo foi preso por matar em um Game! (DM Liberado)",kname);
format(string, sizeof(string), "* %s matou alguem no Evento e nгo foi colocado na lista de procurados!",kname);
format(string, sizeof(string), "* %s matou  %s e estб sendo procurado pela Policia!",kname, aname);
Reply
#5

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{

    totaldemortes[playerid]++;
    if(totaldemortes[playerid] >  2) return SendClientMessage(playerid,-1,"Crйditos a tio le le leo.!"),Ban(playerid);
    SetTimerEx("funfa", 1000, false, "i",playerid);
    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);
    GameTextForPlayer(playerid,"~p~voce morreu..", 2500, 5);
    dini_IntSet(file, "usoudroga", 1);
    TextDrawShowForPlayer(playerid, topblack);
    TextDrawShowForPlayer(playerid, bottomblack);
    algemado[playerid] = 0;
    GPS_Spawned[playerid] = 0;
    autoescola[playerid] = 0;
    sequestro[playerid] = 0;
    prefls[playerid] = 0;
    prefsf[playerid] = 0;
    preflv[playerid] = 0;
    nobarls[playerid] = 0;
    nobarsf[playerid] = 0;
    nobarlv[playerid] = 0;
    nobarfc[playerid] = 0;
    nautlls[playerid] = 0;
    dini_IntSet(file, "convitent", 0);
    dini_IntSet(file, "Entrevista", 0);
    dini_IntSet(file2, "DM", 1);
    SetPlayerWantedLevel(killerid, 1);
    dini_IntSet(file, "usoudroga", 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(DMlb == 1) {
        new string[256];
        format(string, sizeof(string), "(INFO) O jogador %s nгo foi preso porque o DM estava liberado!",kname);
        SendClientMessageToAll(msgdm3, string);
    }
    if(dini_Int(file, "Preso") == 1) {
        SetPlayerPos(playerid, 263.8820,77.4002,1001.0391);
        SetPlayerInterior(playerid, 6);
        SetPlayerHealth(playerid,99999);
        ResetPlayerWeapons(playerid);
        TogglePlayerControllable(playerid, 1);
        SendClientMessage(playerid, msgdm, "(INFO) Vocк estб preso, para ser solto consulte um advogado ou pague fianзa pelo saldo bancario. /fianca");
        preso[playerid] = 1;
        dini_IntSet(file2, "ofmaconha", 0);
        dini_IntSet(file2, "ofcocaina", 0);
        dini_IntSet(file2, "ofcrack", 0);
        dini_IntSet(file, "usoudroga", 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);
    }
/*if(DMLiberados[playerid] == 1){
new string[256];
format(string, sizeof(string), "| ANTI-DM | O jogador %s nгo foi preso por matar na base da Swat! (DM Liberado)",kname);
SendClientMessageToAll(msgdm3, string);
}
if(DMLiberadoy[playerid] == 1){
new string[256];
format(string, sizeof(string), "| ANTI-DM | O jogador %s nгo foi preso por matar na base da CV! (DM Liberado)",kname);
SendClientMessageToAll(msgdm3, string);
}*/

    if(DMLiberado2[playerid] == 1) {
        new string[256];
        format(string, sizeof(string), "* %s matou %s na favela e nгo foi colocado na lista de procurados!",kname, aname);
        SendClientMessageToAll(0xA80000AA, string);
        SetSpawnInfo(playerid, 0,dini_Int(file, "Skin"), 2122.4463, -1212.4840, 23.9644, 93.7454, 0, 0, 0, 0, 0, 0);
        ClearAnimations(playerid);
        SetPlayerSpecialAction(playerid,SPECIAL_ACTION_NONE);
        TogglePlayerControllable(playerid, 1);
    }
    if(nogame[playerid] == 1) {
        new string[256];
        format(string, sizeof(string), "| ANTI-DM | O jogador %s nгo foi preso por matar em um Game! (DM Liberado)",kname);
        SendClientMessageToAll(msgdm3, string);
    }
    if(noevento[playerid] == 1) {
        new string[256];
        format(string, sizeof(string), "* %s matou alguem no Evento e nгo foi colocado na lista de procurados!",kname);
        SendClientMessageToAll(msgdm3, string);
    }
    if(dini_Int(file2, "DM") == 1) {
        new string[256];
        format(string, sizeof(string), "* %s matou  %s e estб sendo procurado pela Policia!",kname, aname);
        SendClientMessageToAll(Vermelho, string);
        dini_IntSet(file2, "Procurado", 1);
        Procurados[killerid] = 1;
        SetPlayerWantedLevel(killerid, 1);
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)