public OnPlayerDeath(playerid, killerid, reason) { // printf("OnPlayerDeath: playerid: %d, killerid: %d, reason: %s", playerid, killerid, reason); //debug ClearGuns(playerid); SetPlayerColor(playerid, TCOLOR_HOSPITAL); 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));
public OnPlayerDeath
{
if(IsAtEvent[playerid] == 0)
{
SetPlayerPos(); //Use your coords for event
//Also but all the script that you want to happen when they spawn at the event
}
else(IsAtEvent[playerid] == 1)
{
SetPlayerPos(); //Use your outside event spawn positions here
}
};
if(IsAtEvent[playerid] == 1) { SetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]); SetPlayerArmour(playerid, PlayerInfo[playerid][pArmor]); SetPlayerInterior(playerid, PlayerInfo[playerid][pInt]); SetPlayerPos(playerid, PlayerInfo[playerid][pEventj_x], PlayerInfo[playerid][pEventj_y], PlayerInfo[playerid][pEventj_z]); SetPlayerFacingAngle(playerid, PlayerInfo[playerid][pSPos_r]); SetCameraBehindPlayer(playerid); }
if(IsAtEvent[playerid] == 1) { SetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]); SetPlayerArmour(playerid, PlayerInfo[playerid][pArmor]); SetPlayerInterior(playerid, PlayerInfo[playerid][pInt]); SetPlayerPos(playerid, PlayerInfo[playerid][pEventj_x], PlayerInfo[playerid][pEventj_y], PlayerInfo[playerid][pEventj_z]); SetPlayerFacingAngle(playerid, PlayerInfo[playerid][pSPos_r]); SetCameraBehindPlayer(playerid); }
Код:
if(IsAtEvent[playerid] == 1) { SetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]); SetPlayerArmour(playerid, PlayerInfo[playerid][pArmor]); SetPlayerInterior(playerid, PlayerInfo[playerid][pInt]); SetPlayerPos(playerid, PlayerInfo[playerid][pEventj_x], PlayerInfo[playerid][pEventj_y], PlayerInfo[playerid][pEventj_z]); SetPlayerFacingAngle(playerid, PlayerInfo[playerid][pSPos_r]); SetCameraBehindPlayer(playerid); } |