18.08.2010, 03:17
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?
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; }
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;
}
: 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.