SA-MP Forums Archive
[HELP] onplayerdeath text - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [HELP] onplayerdeath text (/showthread.php?tid=516426)



[HELP] onplayerdeath text - Luca12 - 31.05.2014

Hello I was make when player kill some cop then he get message that he is kill a cop and when cop kill civilan he get you kill the civilian and when civilian kill civilian he get message murder of first degre but the problem is I can't fix it when leader kill his own member then leader should get the message you kill the your own member but instead it says you get murder of firts degre.

here is the code

pawn Код:
if(IsACop(playerid) && IsPlayerConnected(killerid) && PlayerInfo[killerid][Member] != 1 && PlayerInfo[killerid][Leader != 1 && PlayerInfo[killerid][Member] != 2 && PlayerInfo[killerid][Leader] != 2
        && PlayerInfo[killerid][Member] != 3 && PlayerInfo[killerid][Leader] != 3)
        {
            PlayerInfo[playerid][Deaths]++;
            PlayerInfo[killerid][Kills]++;
            SetCrime(killerid,"You kill the cop!","Nepoznato");
            return 1;
        }
        if(IsPlayerConnected(playerid) && IsACop(killerid))
        {
            PlayerInfo[playerid][Deaths]++;
            PlayerInfo[killerid][Kills]++;
            SCM(killerid,COLOR_LIGHTRED,"You kill the civilian");
            return 1;
        }
if(PlayerInfo[killerid][Leader] == 1 && PlayerInfo[killerid][Member] == 1)
        {
            PlayerInfo[playerid][Deaths]++;
            PlayerInfo[killerid][Kills]++;
            SCM(killerid,COLOR_LIGHTRED,"You kill your own member");
            return 1;
        }
        if(IsPlayerConnected(playerid) && IsPlayerConnected(killerid) && PlayerInfo[killerid][Member] != 1 && PlayerInfo[killerid][Leader] != 1 && PlayerInfo[killerid][Member] != 2 && PlayerInfo[killerid][Leader] != 2
        && PlayerInfo[killerid][Member] != 16 && PlayerInfo[killerid][Leader] != 16)
        {
            PlayerInfo[playerid][Smrti]++;
            PlayerInfo[killerid][Ubojstava]++;
            PostaviZlocin(killerid,"Murder of first degre!","Nepoznato");
            return 1;
        }



Re: [HELP] onplayerdeath text - SyntaxQ - 31.05.2014

pawn Код:
if(PlayerInfo[killerid][Leader] == 1 && PlayerInfo[killerid][Member] == 1)
Change this to
pawn Код:
if(PlayerInfo[killerid][Leader] == 1 && PlayerInfo[playerid][Member] == 1)
This means that the killerid is leader but the playerid (that got killed) is the member, so send message to the killerid (the guy who killed) that he killed his own member.


Re : [HELP] onplayerdeath text - S4t3K - 31.05.2014

Try replacing

PHP код:

if(PlayerInfo[killerid][Leader] == && PlayerInfo[killerid][Member] == 1)
        {
            
PlayerInfo[playerid][Deaths]++;
            
PlayerInfo[killerid][Kills]++;
            
SCM(killerid,COLOR_LIGHTRED,"You kill your own member");
            return 
1;
        } 
by

PHP код:

if(PlayerInfo[killerid][Leader] == && PlayerInfo[playerid][Member] == 1)
        {
            
PlayerInfo[playerid][Deaths]++;
            
PlayerInfo[killerid][Kills]++;
            
SCM(killerid,COLOR_LIGHTRED,"You kill your own member");
            return 
1;
        } 
EDIT : Too late.


Re: [HELP] onplayerdeath text - Luca12 - 31.05.2014

I try like that and not working it says murder of first degre I make mistake when I post the code for member beacuse it's not there and I forget to change killerid to playerid. Thanks