You can't stop the death, but a lot of servers does that system in another way...
Do something like that
Код:
enum death_system
{
Float:DX,
Float:DY,
Float:DZ,
Float:DA,
bool:Status
};
new DeathInfo[MAX_PLAYERS][death_system];
In your hospital script place
Код:
if(!DeathInfo[playerid][Status])
OnPlayerDeath
Код:
new Float:x,Float:y,Float:z,Float:a;
DeathInfo[playerid][DX] = x;
DeathInfo[playerid][DY] = y;
DeathInfo[playerid][DZ] = z;
DeathInfo[playerid][DA] = a;
DeathInfo[playerid][Status] = true;
OnPlayerSpawn
Код:
if(DeathInfo[playerid][Status])
{
SetPlayerPos(playerid,DeathInfo[playerid][DX],DeathInfo[playerid][DY],DeathInfo[playerid][DZ]);
SetPlayerFacingAngle(playerid,DeathInfo[playerid][DA]);
SetPlayerHealth(playerid,1.0);
//Animation crack or something you would like to use
}
Now it's simple, if he accepts to death do
Код:
if(DeathInfo[playerid][Status])
{
DeathInfo[playerid][Status]=false;
SetPlayerHealth(playerid,0);
}
Quote:
Originally Posted by Lordzy
I suggest you to work on server sided health system which will then help you to work on features like these.
|
It would be good for making an Anticheat, but for those things only that would be really annoying x