OnPlayerDeath - 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: OnPlayerDeath (
/showthread.php?tid=497767)
OnPlayerDeath -
Ananisiki - 28.02.2014
~~~~~~
Re: OnPlayerDeath -
Ananisiki - 28.02.2014
Anyone?
Re: OnPlayerDeath -
Ananisiki - 01.03.2014
Bump
Re: OnPlayerDeath -
Smileys - 01.03.2014
could you explain what exactly does NOT work?
what's this piece of code supposed to do.
what does not work.
Re: OnPlayerDeath -
Ananisiki - 01.03.2014
Its supposed to show up when a player dies or when a player gets killed, if i suicide the message won't send..
Re: OnPlayerDeath -
Smileys - 01.03.2014
put this in your GM, it's got some debug msgs to determine where the problem occurs.
pawn Код:
print( "starting" );
if(IsPlayerConnected(killerid) && killerid != INVALID_PLAYER_ID)
{
print( "1" );
new WeapName[32], Name[MAX_PLAYER_NAME], KillerName[MAX_PLAYER_NAME];
print( "2" );
GetWeaponName(reason, WeapName, sizeof(WeapName));
printf( "wepName: %s", WeapName );
GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
printf( "pName: %s", Name );
GetPlayerName(killerid, KillerName, MAX_PLAYER_NAME);
printf( "kname: %s", KillerName );
format(string, sizeof(string),"%s (%d) Died. Killed By: %s (%d) - %s. ", Name, playerid, KillerName, killerid, WeapName);
printf( "%s", string );
SendClientMessageToAll(COLOR_DARKRED, string);
print( "7" );
SendDeathMessage(killerid, playerid, reason);
print( "8" );
}
else
{
print( "9" );
new Name[MAX_PLAYER_NAME];
print( "10" );
GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
printf( "%s", Name );
format(string, sizeof(string),"%s (%d) Died.", Name, playerid);
printf( "%s", string );
SendClientMessageToAll(COLOR_DARKRED, string);
print( "13" );
SendDeathMessage(killerid, playerid, reason);
print( "14" );
}
print( "end!" );
go ingame, suicide or get killed, and paste the server-log here.
Re: OnPlayerDeath -
Ananisiki - 01.03.2014
pawn Код:
[13:38:27] Number of vehicle models: 10
[13:38:27] Incoming connection: 127.0.0.1:55380
[13:38:27] [npc:join] [BOT]TestBot has joined the server (0:127.0.0.1)
[13:39:27] [death] Ananisiki died 255
[13:39:58] [death] Ananisiki died 54
Re: OnPlayerDeath -
Konstantinos - 01.03.2014
It should call OnPlayerDeath, so post the whole callback.
Re: OnPlayerDeath -
Zex Tan - 01.03.2014
Try to use the OnPlayerDeath reason
pawn Код:
switch(reason)
{
case 53: // Drowned
case 54: // Collision
default: // This happens when it is a different reason
}
Re: OnPlayerDeath -
Ananisiki - 01.03.2014
That is all i got in my server_log