When you die inside of an event you get sent to the hospital?
#1

In an event if you die in it, you get a message saying "wasted" and you get sent to the hospital. I want it so when you die, you get sent back to your original coordinates?
Reply
#2

original being default spawn point when one connects to server? or point where one dies ?
Reply
#3

Like the spot you're in when you /joinevent, when you die, you go back to the point before you joined the event
Reply
#4

public OnPlayerDeath(playerid, killerid, reason)
{
if(playerisinevent[playerid]) // or whatever variable that defines the player is in an event
{
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid,A);
SetSpawnInfo(playerid, playerid, PlayerInfo[playerid][pModel],X, Y, Z, A, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
}
else
{
// else they arent in an event, and you want to send em to hell or something!
}
return 1;
}
Reply
#5

That doesn't work.
Reply
#6

post what you got .. else we are just gonna play guessing games
Reply
#7

Код:
if(IsAtEvent[playerid]) // or whatever variable that defines the player is in an event
{
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid,A);
SetSpawnInfo(playerid, playerid, PlayerInfo[playerid][pModel],X, Y, Z, A, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
return 1;
}
This is what I have but when I die in an event, I still get sent to the hospital.
Reply
#8

on top
pawn Код:
new Float:EventX[MAX_PLAYERS],Float:EventY[MAX_PLAYERS],Float:EventZ[MAX_PLAYERS];
new EventInt[MAX_PLAYERS];
new EventVW[MAX_PLAYERS];
new NeedEventSpawn[MAX_PLAYERS];

OnPlayerdDeath

GetPlayerPos(playerid,EventX[playerid],EventY[playerid],EventZ[playerid]);
EventInt[playerid] = GetPlayerInterior(playerid);
EventVW[playerid] = GetPlayerVirtualWorld(playerid);
NeedEventSpawn[playerid] = 1;

OnPlayerSpawn

if(NeedEventSpawn[playerid] == 1) //Place this in the top of OnPlayerspawn, but after all others things, in place where you starts to set pos on spawns, etc.
{
NeedEventSpawn[playerid] = 0;
SetPlayerInterior(playerid,EventInt[playerid]);
SetPlayerPos(playerid,,EventX[playerid],EventY[playerid],EventZ[playerid]);
SetPlayerVirtualWorld(playerid,EventVW[playerid]);
return 1;
}
Reply
#9

Код:
 : error 021: symbol already defined: "EventX"
 : error 010: invalid function or declaration
 : error 010: invalid function or declaration
 : error 033: array must be indexed (variable "EventX")
 : error 035: argument type mismatch (argument 2)
 : error 035: argument type mismatch (argument 2)
 : error 033: array must be indexed (variable "EventX")
 : error 033: array must be indexed (variable "EventX")
 : error 033: array must be indexed (variable "EventY")
 : error 033: array must be indexed (variable "EventZ")
 : error 033: array must be indexed (variable "EventInt")
 : error 035: argument type mismatch (argument 2)
 : error 033: array must be indexed (variable "EventInt")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


13 Errors.
I did what you said.
Reply
#10

Bump.....
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)