Objects (Bottles and Cigars) spawning on Death spot
#1

Hi there!

I'm working on a RP gamemode, and i have a little (funny) bug. When a player dies, he is teleported to the LS Hospital. If you check the place where the player died, it always spawns a beer bottle or cigar there in the ground. Here's my code with OnPlayerDeath and OnPlayerSpawn.

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
	tPlayerStats_DeathHandler(playerid, killerid, reason);
	return 1;
}
The DeathHandler in the callback is just a pointer to the function below.

Код:
tPlayerStats_DeathHandler(playerid, killerid, reason)
{
	// Player has died, hide the speedometer in case the player was driving
	for(new i; i < 4; i++)
		TextDrawHideForPlayer(playerid, TextDrawsd[playerid][i]);
	for(new i; i < 15; i++)
		TextDrawHideForPlayer(playerid, TextDraws[TDSpeedClock][i]);
	
	SendClientMessage(playerid, COLOR_RED, "Oh no! You passed out! You've been taken to hospital by Ambulance!");
	new adminstring[512], deadplayer[MAX_PLAYER_NAME], killername[MAX_PLAYER_NAME];
	GetPlayerName(playerid, deadplayer, sizeof(deadplayer));
	if(killerid != INVALID_PLAYER_ID)
	{
		GetPlayerName(killerid, killername, sizeof(killername));
		format(adminstring,sizeof(adminstring),"[DEATH] %s(%i) >>> %s(%i) >>> %s", deadplayer, playerid, killername, killerid, DeathReason[reason]);
	}
	else
	{
		format(adminstring,sizeof(adminstring),"[DEATH] %s(%i) >>> %s", deadplayer, playerid, DeathReason[reason]);
	}
	tChat_AdminMsg(COLOR_LIGHTBLUE, adminstring);
	
	SendDeathMessage(killerid, playerid, reason);
	PlayerInfo[playerid][Dead] = 1;
	SetSpawnInfo(playerid, 0, 0, 1200.85, -1338.408, 15, 0, 0, 0, 0, 0, 0, 0);
	
	return 1;
}
The Player skin is set in the OnPlayerSpawn callback, which is:

Код:
public OnPlayerSpawn(playerid)
{
	new IsPlayerDead;
	IsPlayerDead = PlayerInfo[playerid][Dead];
	if(IsPlayerDead)
	{
		SetPlayerSkin(playerid, PlayerInfo[playerid][Skin]);
		PlayerInfo[playerid][Dead] = 0;
		GivePlayerMoney(playerid, 100);
	}
	
	return 1;
}
Hope anyone knows what the problem/bug is.
Reply
#2

Like you said: it's a bug It's nothing about your script ... I have that bug also sometimes
Reply
#3

Quote:
Originally Posted by Michael@Belgium
Посмотреть сообщение
Like you said: it's a bug It's nothing about your script ... I have that bug also sometimes
It is? Wow, not something i was aware of. Thanks!
Reply
#4

It was reported in 0.3d Section that similar bugs occurs. Maybe it will be fixed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)