OnPlayerDeath stuff (Script) -
Kyance - 21.02.2014
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
Re: OnPlayerDeath stuff (Script) -
Vanter - 21.02.2014
SendDeathMessage(killerid,playerid,reason);
Re: OnPlayerDeath stuff (Script) -
FilesMAker - 21.02.2014
Try that :
Код:
if(SpawnedBy{ i })
{
SendDeathMessage(playerid, killerid, reason);
return 1;
}
Re: OnPlayerDeath stuff (Script) -
Kyance - 21.02.2014
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
Re: OnPlayerDeath stuff (Script) -
Kyance - 21.02.2014
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
Re: OnPlayerDeath stuff (Script) -
FilesMAker - 21.02.2014
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
Re: OnPlayerDeath stuff (Script) -
Kyance - 21.02.2014
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
Re: OnPlayerDeath stuff (Script) -
Konstantinos - 21.02.2014
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);
}
Re: OnPlayerDeath stuff (Script) -
FilesMAker - 21.02.2014
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 ?
Re: OnPlayerDeath stuff (Script) -
Kyance - 21.02.2014
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.