What the heck. [Hospital] - 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: What the heck. [Hospital] (
/showthread.php?tid=212217)
What the heck. [Hospital] -
hanzen - 16.01.2011
I've made a basic hospital system for my script, whenever a player is killed he is sent to the hospital where he's released after a minute. (Using a timer).
It works like charm however if you tab out and the time expires before you tab back in you will start falling and you will recieve a smoke. :S
Re: What the heck. [Hospital] -
hanzen - 17.01.2011
=> UP
(Seems like no-one have any clue about any of my issues, since my last two posts have 0 replies and 24 views).
Re: What the heck. [Hospital] -
Kase - 17.01.2011
You should post that piece of code, otherwise we can't help you!
Re: What the heck. [Hospital] -
hanzen - 17.01.2011
How is a SetPlayerPos() TogglePlayerControllable() relevant? The problem is regarding a special action that tends to appear.
Re: What the heck. [Hospital] -
Tenshi - 17.01.2011
Why not use
in order:
pawn Код:
// ClearAnimations(playerid); // purely optional
SpawnPlayer(playerid); // for some servers this is an issue with weapons and weapon spawns
// then ...
SetPlayerPos()
// if you have anticheat add something to ignore or clear him of cheats reported, not not important.
and see what happens after the player maximizes (you know?)
Re: What the heck. [Hospital] -
hanzen - 17.01.2011
Quote:
Originally Posted by Tenshi
Why not use
in order:
pawn Код:
// ClearAnimations(playerid); // purely optional SpawnPlayer(playerid); // for some servers this is an issue with weapons and weapon spawns // then ... SetPlayerPos() // if you have anticheat add something to ignore or clear him of cheats reported, not not important.
and see what happens after the player maximizes (you know?)
|
I'm already using SpawnPlayer and SetPlayerPos(), it works like a charm unless the player minimizes the window.
Re: What the heck. [Hospital] -
Tenshi - 17.01.2011
is the player falling close to the location of this hospital or where he is being re-spawned?
( also is it same virtual world? )
Re: What the heck. [Hospital] -
Toreno - 17.01.2011
You can use OnPlayerPause by The_Moddler.
Example;
Create a variable.
pawn Код:
new InHospital[MAX_PLAYERS];
Then set it to 0 OnPlayerConnect.
pawn Код:
public OnPlayerConnect(playerid)
{
InHospital[playerid] = 0;
return 1;
}
Then:
pawn Код:
public OnPlayerPause(playerid)
{
if(InHospital[playerid] == 1) // You could kill the timer.
return 1;
}
public OnPlayerUnPause(playerid)
{
if(InHospital[playerid] == 1) // Start the timer again.
return 1;
}
It's just an idea... I don't know why it does it like that.