19.08.2010, 21:39
How can I make it so players get sent back to their coordinates when they die in the event and not get sent to the hospital?
new Died[MAX_PLAYERS]; new Float:eX, Float:eY, Float:eZ; OnPlayerConnect Died[playerid] = 0; OnPlayerDeath // add your own event check here GetPlayerPos(playerid, eX, eY, eZ); Died[playerid] = 1; OnPlayerSpawn SetPlayerPos(playerid, eX, eY, eZ); Died[playerid] = 0;
//events new Float: EventX, Float: EventY, Float: EventZ, EventInt, EventWorld; new EventHP = 100, EventArmour = 0, ActiveEvent = 0, EventJoinText = 0, EventLocked = 0; new EventWeapon1, EventWeapon2, EventWeapon3, EventWeapon4, EventWeapon5; new EventText[128]; new IsAtEvent[MAX_PLAYERS]; new RefundingNumber[MAX_PLAYERS]; new RefundingID[MAX_PLAYERS]; new Params[4][8]; //ipinfo new FileData[7][128]; //ipinfo
public OnPlayerDeath(playerid, killerid, reason)
{
// printf("OnPlayerDeath: playerid: %d, killerid: %d, reason: %s", playerid, killerid, reason); //debug
ClearGuns(playerid);
SetPlayerColor(playerid, TCOLOR_HOSPITAL);
GameTextForPlayer(playerid,"~w~Wasted",4000,2);
SetPlayerVirtualWorld(playerid, 0);
PlayerInfo[playerid][pOnDuty] = 0;
PlayerInfo[playerid][pBombs] = 0;
PlayerInfo[playerid][pScope] = 0;
PlayerInfo[playerid][pLocal] = 999;
PlayerInfo[playerid][pVirtualWorld] = 0;
PlayerInfo[killerid][pKills] += 1;
CapturingTimer[playerid] = 0;
STDPlayer[playerid] = 0;
IsAtEvent[playerid] = 0;
new name[MAX_PLAYER_NAME];
new killa[MAX_PLAYER_NAME];
new string[128];
new caller = Mobile[playerid];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(killerid, killa, sizeof(killa));