05.04.2014, 10:01
PHP код:
public OnPlayerDeath(playerid, killerid, reason)
{
new playerState = GetPlayerState(killerid), vehicleid = GetPlayerVehicleID(playerid);
if (playerState == PLAYER_STATE_DRIVER)
{
new string[127];
if(IsAHelicopter(vehicleid))
{
RemovePlayerFromVehicle(killerid);
format(string, sizeof(string), "AdmCmd: %s was prisoned by %s, reason: Heli-Blading", PlayerRPName(killerid), PlayerRPName(playerid));
SendClientMessageToAll(TOMATO, string);
AccountData[killerid][pPrisoned] = 2;
AccountData[killerid][pPrisonTime] = 30 * 60;
SetPlayerPos(killerid, 264.6288, 77.5742, 1001.0391);
SetPlayerInterior(killerid, 6);
SetPlayerVirtualWorld(killerid, killerid+1337);
SetPlayerColor(killerid, 0xF4A41900);
ClearWeapons(killerid);
if (PlayerCuffed[killerid])
{
SetPlayerSpecialAction(killerid, SPECIAL_ACTION_NONE);
RemovePlayerAttachedObject(killerid, 1);
}
}
}
if(AccountData[playerid][pPrisoned] >= 1)
{
SetPlayerInterior(playerid, 6);
SetPlayerVirtualWorld(playerid, 1);
SetPlayerColor(playerid, 0xED9111FF);
SetPlayerPos(playerid, 264.2733, 77.4141, 1001.0391);
SetPlayerFacingAngle(playerid, 269.7870);
TogglePlayerControllable(playerid, 1);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
return 1;
}
else
{
switch(PlayerJustDied[playerid])
{
case 1:
{
PlayerJustDied[playerid] = 0;
AccountData[playerid][pHospitalized] = 1;
printf("1: Player %d is dieng | Just died? %d", playerid, PlayerJustDied[playerid]);
}
case 0:
{
GetPlayerPos(playerid, DeathStuff[playerid][DeathX], DeathStuff[playerid][DeathY], DeathStuff[playerid][DeathZ]);
GetPlayerFacingAngle(playerid, DeathStuff[playerid][DeathA]);
DeathStuff[playerid][DeathInt] = GetPlayerInterior(playerid);
DeathStuff[playerid][DeathHP] = 100;
for(new i = 0; i<13;i++)
{
GetPlayerWeaponData(playerid, i, DeathWeapons[playerid][i][0], DeathWeapons[playerid][i][1]);
}
PlayerJustDied[playerid] = 1;
AccountData[playerid][pHospitalized] = 0;
printf("0: Player %d is dieng | Just died? %d", playerid, PlayerJustDied[playerid]);
}
}
}
if (IsBeingSpeced[playerid])
{
foreach(Player,i)
{
if(SpectatingID[i] == playerid)
{
TogglePlayerSpectating(i,false);
}
}
}
return 1;
}