OnPlayerDeath - Problem - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: OnPlayerDeath - Problem (
/showthread.php?tid=262807)
OnPlayerDeath - Problem -
Arcanize - 19.06.2011
Hey!
I got problem with my
OnPlayerDeath public or
callback.
If i die, the server puts me in random spawns and change my skin to CJ's.
- Sometimes if I die, then the server says: "Stay within the world Boundries". And the monitor starts blinging (white-white-white).
______________
Here's my callback:
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
DoHospital(playerid);
pStats[playerid][pHospitalized] = 1;
// Teeb skinni korda
SetPlayerSkin(playerid, GetPlayerSkin(playerid));
pStats[playerid][pSkin] = GetPlayerSkin(playerid);
// -------------------------------------------------
pStats[playerid][pCopDuty] = 0;
DisablePlayerCheckpoint(playerid);
// -------------------------------------------------
OnPlayerDataSave(playerid);
return 1;
}
And DoHospital callback:
Код:
public DoHospital(playerid)
{
SendClientMessage(playerid, COLOR_YELLOW2, "Sa oled kriitiliselt vigastatud ja sind viidi haiglasse!");
SetPlayerPos(playerid, 1236.6205,306.6172,26.3991);
SetPlayerCameraPos(playerid, 1199.2200,296.6742,33.2644);
SetPlayerCameraLookAt(playerid, 1223.1254,304.0070,19.5754);
SetPlayerFacingAngle(playerid, 90.0769);
TogglePlayerControllable(playerid, false);
SetTimerEx("ReleaseFromHospital", 50000, 0, "d", playerid);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
return 1;
}
Thanks,
Arcanize
Re: OnPlayerDeath - Problem -
Stigg - 19.06.2011
This may help:
https://sampwiki.blast.hk/wiki/SetPlayerWorldBounds
Re: OnPlayerDeath - Problem -
Mr4rtur - 19.06.2011
You should put DoHospital in OnPlayerSpawn. Else ur setting player pos when not spawned etc.
Re: OnPlayerDeath - Problem -
Arcanize - 19.06.2011
Tried, put still
nothing...
Re: OnPlayerDeath - Problem -
Arcanize - 19.06.2011
Ideas?
Re: OnPlayerDeath - Problem -
Scenario - 19.06.2011
Check to make sure "OnPlayerDeath()" is being called.
Re: OnPlayerDeath - Problem -
Arcanize - 19.06.2011
Sorry, but I don't get the point now...
Re: OnPlayerDeath - Problem -
Scenario - 19.06.2011
Quote:
Originally Posted by Arcanize
Sorry, but I don't get the point now...
|
Okay, put this under "OnPlayerDeath():"
pawn Код:
print("\nIt appears OnPlayerDeath is being called properly.\n");
Go ahead and run your server and have your character die. Check the console, see if the message above appears.
Re: OnPlayerDeath - Problem -
Arcanize - 19.06.2011
Yes, the message arrives but that text comes again...
Re: OnPlayerDeath - Problem -
Arcanize - 20.06.2011
Double but...
Can the problem be in OnPlayerSpawn public?