SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 20/08/2012, 07:30 AM   #11
Ben_Hatfield
Big Clucker
 
Ben_Hatfield's Avatar
 
Join Date: May 2011
Location: Canada
Posts: 87
Reputation: 0
Default Re: How to make player spawn at hospital after death

makes my pawno crash when i add
__________________


Ben_Hatfield is offline   Reply With Quote
Old 20/08/2012, 07:43 AM   #12
newbienoob
High-roller
 
newbienoob's Avatar
 
Join Date: Jan 2012
Location: Follow the moaning coming from your parents' bedroom
Posts: 1,533
Reputation: 265
Default Re: How to make player spawn at hospital after death

Not tested.
pawn Code:
new dead[MAX_PLAYERS], respawntimer; //at the top
//onplayerconnect
dead[playerid] = 0;

public OnPlayerSpawn(playerid)
{
    if(dead[playerid] == 1)
    {
        SetPlayerPos(); //hospital pos
        ApplyAnimation();//animation
        respawntimer = SetTimer("respawned",60000,false);//1 minute in the hospital
    }
    else
    {
        SetPlayerPos(); //your spawn locations
        return 1;
    }
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    dead[playerid] = 1;
    return 1;
}


forward respawned(playerid); //anywhere
public respawned(playerid) //anywhere
{
    SetPlayerPos(); //your spawn location
    SendClientMessage(playerid,-1,"Recovered!");
       dead[playerid] = 0;
        KillTimer(respawntimer);
    return 1;
}
newbienoob is offline   Reply With Quote
Old 20/08/2012, 08:34 AM   #13
trapstar2020
Huge Clucker
 
trapstar2020's Avatar
 
Join Date: Oct 2010
Location: Pawno.exe
Posts: 384
Reputation: 17
Default Re: How to make player spawn at hospital after death

and for the location just put in the coordinates like b4 like i should you but also add this

Code:
SetPlayerInterior(playerid,interiorworld)//put the int world of the hospital there
__________________
PM For help with anything
trapstar2020 is offline   Reply With Quote
Old 20/08/2012, 08:36 AM   #14
trapstar2020
Huge Clucker
 
trapstar2020's Avatar
 
Join Date: Oct 2010
Location: Pawno.exe
Posts: 384
Reputation: 17
Default Re: How to make player spawn at hospital after death

public OnPlayerDeath(playerid, killerid, reason)
{
SetPlayerPos(playerid,x,y,z);///sets the player who dies to this position
return 1;//ensure return 1; is in line like how i have it
}
__________________
PM For help with anything
trapstar2020 is offline   Reply With Quote
Old 03/12/2012, 06:50 AM   #15
Ben_Hatfield
Big Clucker
 
Ben_Hatfield's Avatar
 
Join Date: May 2011
Location: Canada
Posts: 87
Reputation: 0
Default Re: How to make player spawn at hospital after death

ive tried it all but my pawno always crashes when i try to compile after ive added the hospital stuff.
__________________


Ben_Hatfield is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
(ask)spawn player after death in hospital gondes Help Archive 4 07/05/2011 02:39 PM
Spawn at Hospital after death. Help me, sir! Daniel_June Help Archive 4 21/06/2010 08:34 PM
Help to make people respawn at hospital after death Mikkel Help Archive 10 06/05/2010 10:47 AM
Hospital Spawn On Death Help :S Jaztek_Hodzic Help Archive 8 08/06/2009 09:33 AM
[FilterScript] [FS]Spawn at hospital after death like in single player FreshKilla Filterscripts 12 20/03/2009 06:55 PM


All times are GMT. The time now is 09:04 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.