1 Problem
#1

Well i want if player dies from splat, it just says "(My Name) has been killed by (Random person Name). Weapon: Splat
I want it to say "(My Name) has been killed from: Splat
pawn Код:
for(new i; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerInRangeOfPoint(i,10,X,Y,Z))
        {
            if(reason != 47 || reason != 51 || reason != 53 || reason != 54)
            {
                format(str,sizeof(str),"%s has been killed by %s. Weapon: %s",Nam,pname,WeapName);
                SendClientMessage(i,-1,str);
            }
            else if(reason == 47 || reason == 51 || reason == 53 || reason == 54)
            {
                format(str,sizeof(str),"%s has been killed from: %s",Nam,WeapName);
                SendClientMessage(i,-1,str);
            }
        }
    }
Reply
#2

What do you want us to help you with?

EDIT:Add comments in your code for better understand of other's. The first if is for all the weapons and the other "if" is for splat? right? So its correct it should work.
Reply
#3

Have you defined your weapons? If yes, can you show it?
Reply
#4

Like this?

EDIT: Just re-read your post, your code would work if you replaced the "||" 's with "&&" 's for the first if statement

pawn Код:
for(new i; i < MAX_PLAYERS; i++)
{
    if(IsPlayerInRangeOfPoint(i,10,X,Y,Z))
    {
        if(reason != 47 && reason != 51 && reason != 53 && reason != 54)
        {
            format(str,sizeof(str),"%s has been killed by %s. Weapon: %s",Nam,pname,WeapName);
            SendClientMessage(i,-1,str);
        }
        else
        {
            new ReasonString[64];
            switch(reason)
            {
                case 47: ReasonString = "Fake Pistol";
                case 51: ReasonString = "Explosion";
                case 53: ReasonString = "Drowned";
                case 54: ReasonString = "Splat";
            }
            format(str,sizeof(str),"%s has been killed via %s",Nam, ReasonString);
            SendClientMessage(i,-1,str);
        }
    }
}
Reply
#5

Thank you rob
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)