SA-MP Forums Archive
When players die in a event, they get sent to the hospital? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: When players die in a event, they get sent to the hospital? (/showthread.php?tid=169508)



When players die in a event, they get sent to the hospital? - Mr. Despair - 19.08.2010

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?


Re: When players die in a event, they get sent to the hospital? - [NWA]Hannes - 19.08.2010

Код:
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;



Re: When players die in a event, they get sent to the hospital? - Cameltoe - 19.08.2010

Show us ur "send to hospital" function and event function


Re: When players die in a event, they get sent to the hospital? - Mr. Despair - 19.08.2010

Код:
//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));



Re: When players die in a event, they get sent to the hospital? - Darklom - 19.08.2010

^ That should work.