Scripting Help
#1

I've been doing some research and was brain storming on my idea. What I'm looking for is when you die you stay in the same place so a medic can come get you by doing (/ems), but I can't figure it out. When I get killed it sends me DIRECTLY to hospital, how can I make it to where I stay there until somebody kills me while i'm down(cant move) or until I bleed out or just give up (/accept death)
Reply
#2

You'll have to work on creating custom death system then. Because once the player dies, they get spawned automatically. I suggest you to work on server sided health system which will then help you to work on features like these. There's an include named "weapon-config.inc" by Slice that can help you with what you're looking for. I never used it since I've already got what I want but I guess that's what's probably you're gonna need unless you're going to create your own system.
Reply
#3

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
Reply
#4

Quote:
Originally Posted by darkdrago
Посмотреть сообщение
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);
}

It would be good for making an Anticheat, but for those things only that would be really annoying x
To make it more realistic, my idea is a lot better. Or to improve what you said, I'd suggest using SetSpawnInfo under OnPlayerDeath.
Reply
#5

Quote:
Originally Posted by Lordzy
Посмотреть сообщение
To make it more realistic, my idea is a lot better. Or to improve what you said, I'd suggest using SetSpawnInfo under OnPlayerDeath.
Well, if he wanna improve it he could set it then spawn the player immediately, but my system was just an example to make him understand how it could work
Reply
#6

https://sampforum.blast.hk/showthread.php?tid=558839 this might give you an idea of how you could make the custom death.
Reply
#7

Quote:
Originally Posted by GoldenLion
Посмотреть сообщение
https://sampforum.blast.hk/showthread.php?tid=558839 this might give you an idea of how you could make the custom death.
It doesn't help him to what he wanna do, that's just an explaining of OnPlayerTakeDamage and OnPlayerGiveDamage
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)