Player dies and goes to hospital
#1

Hey so I need your guys help I'm working on a roleplay server and there is a problem with the death system. See normally when you get killed or dies your supposed to have the option to /service ems and wait till medical accepts you how ever instead of any of that happening. When you die you just spawn to the the hospital can anyone help me fix this please?!?!?!? I will provide anything you need thank you in advance
Reply
#2



Make your own code and if then you get any errors, show the code here and we'll report you the bugs and maybe also fix your errors. If you need someone to do that for you, find for a scripter then.
Reply
#3

Quote:
Originally Posted by Logic_
Посмотреть сообщение


Make your own code and if then you get any errors, show the code here and we'll report you the bugs and maybe also fix your errors. If you need someone to do that for you, find for a scripter then.
I have already I just can't seem to figure out where I'm failing to where they keep being spawned to the hospital and not having the option /service ems
Reply
#4

No idea, but it would be easier if returning 0 OnPlayerDeath would make player stuck at his death location (never tried)
Reply
#5

Quote:
Originally Posted by NJSPKING
Посмотреть сообщение
I will provide anything you need thank you in advance
Provide some code
Reply
#6

Код:
enum {
	STATE_NONE,
	STATE_DEATH,
	STATE_HOSPITAL
};

new SomeState[MAX_PLAYER];


public OnPlayerDeath(playerid, killer, reason)
{
	if (SomeState[playerid] == STATE_NONE)
	{
		// spawn player at last given location
		SomeState[playerid] = STATE_DEATH;
	}
	else if (somestate[playerid][ == PLAYER_STATE_DEATH)
	{
		// spawn player in hospital
		SomeState[playreid] = STATE_HOSPITAL;
	}
	else if (SomeState[playerid] == STATE_HOSPITAL)
	{
		// if player dies while being in hospital, put them back in hospital and add timer, on timer add so that STATE_NONE is brought back to the player
		SomeState[playerid] = STATE_HOSPITAL;
	}
	return 1;
}

CMD:service(playeird, params)
{
	new option[15];
	if (sscanf(params, "s[15]", option))
	{
		// add all options
		return SendClientMessage(playerid, -1, "Use /service (option)");
	}
	
	if (!strcmp(option, "ems"))
	{
		// check here if player's state (not GetPlayerState) is STATE_DEATH
	}
	return 1;
}
Simple way of doing it, it has some intentional errors, fix them so you actually read the code and my comments.
Reply
#7

Quote:
Originally Posted by aoky
Посмотреть сообщение
Provide some code
here you go sir

https://pastebin.com/rP82M5p5
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)