Spawn at hospital when dead
#1

I have tried my best, but it still doesnt work..

Everytime I die, I am getting teleported to the hospital, then spawn at the starting position..


Suggestions?
Reply
#2

You'll need to show some code if you want help.
Reply
#3

public OnPlayerDeath(playerid, killerid, reason)
{
SendClientMessage(playerid,0xFFCC00,"You died,The hospital takes 100 dollars from you for the health threatment");
SendClientMessage(playerid,0xFFCC00,"They also take another 50 dollars because of the ride back to four dragons");
GivePlayerMoney(playerid,-150);
SetPlayerPos(playerid, 1607.2252, 1819.2676, 10.8280);


This is what I have so far..
Reply
#4

You should set player's position to hospital at OnPlayerSpawn callback, not OnPlayerDeath. But make some variable for players which you'll set to true when he dies and you'll check if it's setted to true at OnPlayerSpawn callback - and if it is, then set his position to hospital.
Reply
#5

Quote:
Originally Posted by Don Correlli
You should set player's position to hospital at OnPlayerSpawn callback, not OnPlayerDeath. But make some variable for players which you'll set to true when he dies and you'll check if it's setted to true at OnPlayerSpawn callback - and if it is, then set his position to hospital.
To be honest, I suck at those things..And the tutorials on WIKI doesnt help more.. They just say: Add this, then this, and do like me. Now you're done,,
Reply
#6

pawn Код:
new
    bool:playerDied[MAX_PLAYERS];

public OnPlayerDeath(playerid, killerid, reason)
{
  playerDied[playerid] = true;
  return true;
}

public OnPlayerSpawn(playerid)
{
  if(playerDied[playerid] == true)
  {
    // set his position to the hospital.
    playerDied[playerid] = false; // reset the variable.
  }
  return true;
}

public OnPlayerDisconnect(playerid, reason)
{
  playerDied[playerid] = false; // reset the variable.
  return true;
}
Reply
#7

Quote:
Originally Posted by Don Correlli
pawn Код:
new
    bool:playerDied[MAX_PLAYERS];

public OnPlayerDeath(playerid, killerid, reason)
{
  playerDied[playerid] = true;
  return true;
}

public OnPlayerSpawn(playerid)
{
  if(playerDied[playerid] == true)
  {
    // set his position to the hospital.
    playerDied[playerid] = false; // reset the variable.
  }
  return true;
}

public OnPlayerDisconnect(playerid, reason)
{
  playerDied[playerid] = false; // reset the variable.
  return true;
}
As I said.. I suck at those things, I have no idea where to put it, what to do, or anything.. But giving up is the last thing i wanna to :S
Reply
#8

Then you should start here maybe - http://forum.sa-mp.com/index.php?topic=2750.0
Reply
#9

Quote:
Originally Posted by Don Correlli
Then you should start here maybe - http://forum.sa-mp.com/index.php?topic=2750.0
Thanks a lot man, now I gotta start all on new with my script.. everything got fucked up now, because u sent me that shit.. -.-
Reply
#10

It's not my fault if you don't know how and where to use the code.
Reply
#11

Quote:
Originally Posted by ee100
Quote:
Originally Posted by Don Correlli
Then you should start here maybe - http://forum.sa-mp.com/index.php?topic=2750.0
Thanks a lot man, now I gotta start all on new with my script.. everything got fucked up now, because u sent me that shit.. -.-
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
	SendClientMessage(playerid,0xFFCC00,"You died,The hospital takes 100 dollars from you for the health threatment");
	SendClientMessage(playerid,0xFFCC00,"They also take another 50 dollars because of the ride back to four dragons");
	GivePlayerMoney(playerid,-150);
  return
}

public OnVehicleSpawn(vehicleid)
{
	return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
	return 1;
}

public OnPlayerText(playerid, text[])
{
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
What is wrong here? I got many errors.
Reply
#12

Quote:
Originally Posted by ee100
What is wrong here? I got many errors.
Too many things, just check the link i gave you and read some BASIC things about PAWN.
Reply
#13

Quote:
Originally Posted by Don Correlli
It's not my fault if you don't know how and where to use the code.
Sorry..I overreacted, its just that I am new to this.. I am going to learn it..
Reply
#14

Quote:
Originally Posted by Don Correlli
Quote:
Originally Posted by ee100
What is wrong here? I got many errors.
Too many things, just check the link i gave you and read some BASIC things about PAWN.
I looked at basic scripting, but there was none, I got a wiki error..
Reply
#15

http://www.compuphase.com/pawn/pawn.htm
Reply
#16

Quote:
Originally Posted by Don Correlli
Then you should start here maybe - http://forum.sa-mp.com/index.php?topic=2750.0
Your a idiot all you do is go to help topics and post that link. People KNOW about that. They want help from someone you idiot.
Reply
#17

Another immature kid? Suck off pal.
He wanted a code, i gave him a code. He wants to learn PAWN but he doesn't want to read, so what should i do? I can't force him to read the manual.

And if you're talking about idiots, look at yourself first and you'll find a good idiot.
Reply
#18

Quote:
Originally Posted by Don Correlli
Another immature kid? Suck off pal.
He wanted a code, i gave him a code. He wants to learn PAWN but he doesn't want to read, so what should i do? I can't force him to read the manual.

And if you're talking about idiots, look at yourself first and you'll find a good idiot.
You're so mature. Fuck off kid. You're a wannabe. Grow some balls, hit puberty, then talk to me. Kthx.
Reply
#19

I have only one thing for you: grow up and don't act like a child. Don't live your life on the internet Mr. e-gangsta. =)
Reply
#20

Quote:
Originally Posted by Don Correlli
Another immature kid? Suck off pal.
He wanted a code, i gave him a code. He wants to learn PAWN but he doesn't want to read, so what should i do? I can't force him to read the manual.

And if you're talking about idiots, look at yourself first and you'll find a good idiot.
True, its my fault. It is my fault that I dont know where to put it, it is my fault that i tried on my own.. And so on
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)