OnPlayerDeath stuff (Script)
#1

eh, i kinda figured out how to "get" the Kill-message to show, but i get an error
Код:
 test2.pwn(2647) : error 035: argument type mismatch (argument 1)
..
Script:
pawn Код:
/*OnPlayerDeath*/
for(new i = 0; i < MAX_PLAYERS; i ++)
    {
        if(IsPlayerConnected(i))
        {
            if(IsPlayerInRangeOfPoint(i, 10.5, MPos[0], MPos[1], MPos[2]))
            {
                if(SpawnedBy{ i }) //The minigun spawner, gets set at "SpawnedBy"!!!
                {
                    new name[MAX_PLAYER_NAME];
                    GetPlayerName(i, name, sizeof(name));
                    SendDeathMessage(name, playerid, 38); //Line 2647!!
                    return 1;
                }
            }
        }
    }
I tried doing this:
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i ++)
    {
        if(IsPlayerConnected(i))
        {
            if(IsPlayerInRangeOfPoint(i, 10.5, MPos[0], MPos[1], MPos[2]))
            {
                if(SpawnedBy{ i })
                {
                    GetPlayerName(i, killerid, 24); //2645
                    SendDeathMessage(killerid, playerid, 38);
                    return 1;
                }
            }
        }
    }
But then i got this error:
Код:
test2.pwn(2645) : error 035: argument type mismatch (argument 2)
EDIT:
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i ++)
    {
        if(IsPlayerConnected(i))
        {
            if(IsPlayerInRangeOfPoint(i, 10.5, MPos[0], MPos[1], MPos[2]))
            {
                if(SpawnedBy{ i })
                {
                    killerid = new name[MAX_PLAYER_NAME];
                    GetPlayerName(i, name, sizeof(name));
                    SendDeathMessage(name, playerid, 38);
                    return 1;
                }
            }
        }
    }
that didn't work out either e__e
:c
Reply
#2

SendDeathMessage(killerid,playerid,reason);
Reply
#3

Try that :

Код:
                if(SpawnedBy{ i })
                {
                    SendDeathMessage(playerid, killerid, reason);
                    return 1;
                }
Reply
#4

Quote:
Originally Posted by Vanter
Посмотреть сообщение
SendDeathMessage(killerid,playerid,reason);
Read the topic again ..
I already have that, i want it so:
If a player gets KILLED by AN ADMIN SPAWNED >> MINIGUN <<, then the KILL-MESSAGE is sent like:

MinigunSpawner(SpawnedBy{ i }) ( MINIGUN( 38 ) ) PLAYER
Reply
#5

Quote:
Originally Posted by FilesMAker
Посмотреть сообщение
Try that :

Код:
                if(SpawnedBy{ i })
                {
                    SendDeathMessage(playerid, killerid, reason);
                    return 1;
                }
(Sorry for double-post)

That sends the "suicide"(skull) death-message.

Kyance (skull) xd
Reply
#6

Remove using name edit just put the player id and the game will show his name, no need to check his name !

Replace reason by 38
Reply
#7

Quote:
Originally Posted by FilesMAker
Посмотреть сообщение
Remove using name edit just put the player id and the game will show his name, no need to check his name !

Replace reason by 38
Still sends the suicide reason :c
Reply
#8

I don't get why do you use a loop or get the name at all.

pawn Код:
if(IsPlayerInRangeOfPoint(killerid, 10.5, MPos[0], MPos[1], MPos[2]))
{
    if(SpawnedBy{killerid}) SendDeathMessage(killerid, playerid, 38);
}
Reply
#9

Impossible i think their is another code who send that.
Answer those questions :
- did you replace reason by 38 ?
- Search by Ctrl+F on your script "SendDeathMessage" without quotes and tell me did you find another code ?
Reply
#10

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
I don't get why do you use a loop or get the name at all.

pawn Код:
if(IsPlayerInRangeOfPoint(killerid, 10.5, MPos[0], MPos[1], MPos[2]))
{
    if(SpawnedBy{killerid}) SendDeathMessage(killerid, playerid, 38);
}
Eh, it still sends me the suicide reason.
Should i put that on the timer maybe?;d

@Files:
#1: yea
#2: Yeah, i do, but even if i remove it, it still sends me the regular suicide reason.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)