Код:
public OnPlayerDeath(playerid, killerid, reason)
{
new string[128];
if(IsPlayerConnected(killerid))
{
if(killerid != playerid)
{
if(AdminDuty[playerid])
{
if(!AdminDuty[killerid])
{
KickPlayer(killerid,"System","Killing an administrator on duty with abuse.");
format(string, sizeof(string), "[INFO:] System has kicked %s, Reason: Killing an administrator on duty with abuse. ", PlayerName(killerid));
KickLog(string);
}
}
SetPlayerWantedLevelEx(killerid,GetPlayerWantedLevelEx(playerid)+1);
}
}
return 1;
}
Код:
public SetPlayerSpawn(playerid)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pFaction] != 255 && DynamicFactions[PlayerInfo[playerid][pFaction]][fType] == 3 || PlayerInfo[playerid][pFaction] != 255 && DynamicFactions[PlayerInfo[playerid][pFaction]][fType] == 9)
{
OnDuty[playerid] = 1;
}
if(PlayerInfo[playerid][pCrashed])
{
SetPlayerPos(playerid,PlayerInfo[playerid][pCrashX],PlayerInfo[playerid][pCrashY],PlayerInfo[playerid][pCrashZ]);
SetPlayerInterior(playerid,PlayerInfo[playerid][pCrashInt]);
SetPlayerVirtualWorld(playerid,PlayerInfo[playerid][pCrashW]);
PlayerInfo[playerid][pCrashed] = 0;
GameTextForPlayer(playerid, "~r~Crashed...~n~~g~Returning to previous position.", 7000, 6);
if(PlayerInfo[playerid][pSex] == 1)
{
PlayerLocalMessage(playerid,15.0,"was set back to his previous position.");
}
else
{
PlayerLocalMessage(playerid,15.0,"was set back to her previous position.");
}
return 1;
}
if(AdminDuty[playerid])
{
SetPlayerColor(playerid,COLOR_ADMINDUTY);
SetPlayerHealth(playerid,99999);
SetPlayerArmour(playerid,99999);
}
if(PlayerInfo[playerid][pFaction] != 255)
{
SetPlayerToFactionColor(playerid);
SetPlayerToFactionSkin(playerid);
SetPlayerInterior(playerid, 0);
}
if(PlayerInfo[playerid][pJailed] == 1)
{
SetPlayerVirtualWorld(playerid,2); //BUILDING ID 2, MAKE SURE PD IS ID 2
SetPlayerInterior(playerid, 6);
SetPlayerPos(playerid,263.9933,77.0126,1001.0391);
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[ERROR:] You havn't finished your jail time!");
return 1;
}
new house = PlayerInfo[playerid][pHouseKey];
if(house != 255)
{
if(PlayerInfo[playerid][pSpawnPoint])
{
SetPlayerInterior(playerid,Houses[house][ExitInterior]);
SetPlayerPos(playerid, Houses[house][ExitX], Houses[house][ExitY],Houses[house][ExitZ]);
SetPlayerVirtualWorld(playerid,house);
return 1;
}
}
if(PlayerInfo[playerid][pFaction] != 255)
{
if(PlayerInfo[playerid][pSpawnPoint] == 0)
{
SetPlayerPos(playerid,DynamicFactions[PlayerInfo[playerid][pFaction]][fX],DynamicFactions[PlayerInfo[playerid][pFaction]][fY],DynamicFactions[PlayerInfo[playerid][pFaction]][fZ]);
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid,0);
if(PlayerInfo[playerid][pDonateRank] > 0)
{
if (PlayerInfo[playerid][pGun1] > 0)
{
GivePlayerWeapon(playerid, PlayerInfo[playerid][pGun1], PlayerInfo[playerid][pAmmo1]);
PlayerInfo[playerid][pGun1] = 0; PlayerInfo[playerid][pAmmo1] = 0;
SetPlayerInterior(playerid, 0);
}
if (PlayerInfo[playerid][pGun2] > 0)
{
GivePlayerWeapon(playerid, PlayerInfo[playerid][pGun2], PlayerInfo[playerid][pAmmo2]);
PlayerInfo[playerid][pGun2] = 0; PlayerInfo[playerid][pAmmo2] = 0;
SetPlayerInterior(playerid, 0);
}
if (PlayerInfo[playerid][pGun3] > 0)
{
GivePlayerWeapon(playerid, PlayerInfo[playerid][pGun3], PlayerInfo[playerid][pAmmo3]);
PlayerInfo[playerid][pGun3] = 0; PlayerInfo[playerid][pAmmo3] = 0;
SetPlayerInterior(playerid, 0);
}
if (PlayerInfo[playerid][pGun4] > 0)
{
GivePlayerWeapon(playerid, PlayerInfo[playerid][pGun4], PlayerInfo[playerid][pAmmo4]);
PlayerInfo[playerid][pGun4] = 0; PlayerInfo[playerid][pAmmo4] = 0;
SetPlayerInterior(playerid, 0);
}
}
else
{
if (PlayerInfo[playerid][pGun1] > 0)
{
GivePlayerWeapon(playerid, PlayerInfo[playerid][pGun1], PlayerInfo[playerid][pAmmo1]);
PlayerInfo[playerid][pGun1] = 0; PlayerInfo[playerid][pAmmo1] = 0;
SetPlayerInterior(playerid, 0);
}
if (PlayerInfo[playerid][pGun2] > 0)
{
GivePlayerWeapon(playerid, PlayerInfo[playerid][pGun2], PlayerInfo[playerid][pAmmo2]);
PlayerInfo[playerid][pGun2] = 0; PlayerInfo[playerid][pAmmo2] = 0;
SetPlayerInterior(playerid, 0);
}
}
return 1;
}
}
else
{
//====================[Setting Civilian Position]==========================
SetPlayerPos(playerid,CivilianSpawn[X],CivilianSpawn[Y],CivilianSpawn[Z]);
SetPlayerVirtualWorld(playerid, CivilianSpawn[World]);
SetPlayerInterior(playerid, 0);
SetPlayerFacingAngle(playerid,CivilianSpawn[Angle]);
if(PlayerInfo[playerid][pDonateRank] > 0)
{
if (PlayerInfo[playerid][pGun1] > 0)
{
GivePlayerWeapon(playerid, PlayerInfo[playerid][pGun1], PlayerInfo[playerid][pAmmo1]);
PlayerInfo[playerid][pGun1] = 0; PlayerInfo[playerid][pAmmo1] = 0;
}
if (PlayerInfo[playerid][pGun2] > 0)
{
GivePlayerWeapon(playerid, PlayerInfo[playerid][pGun2], PlayerInfo[playerid][pAmmo2]);
PlayerInfo[playerid][pGun2] = 0; PlayerInfo[playerid][pAmmo2] = 0;
}
if (PlayerInfo[playerid][pGun3] > 0)
{
GivePlayerWeapon(playerid, PlayerInfo[playerid][pGun3], PlayerInfo[playerid][pAmmo3]);
PlayerInfo[playerid][pGun3] = 0; PlayerInfo[playerid][pAmmo3] = 0;
}
if (PlayerInfo[playerid][pGun4] > 0)
{
GivePlayerWeapon(playerid, PlayerInfo[playerid][pGun4], PlayerInfo[playerid][pAmmo4]);
PlayerInfo[playerid][pGun4] = 0; PlayerInfo[playerid][pAmmo4] = 0;
}
}
else
{
if (PlayerInfo[playerid][pGun1] > 0)
{
GivePlayerWeapon(playerid, PlayerInfo[playerid][pGun1], PlayerInfo[playerid][pAmmo1]);
PlayerInfo[playerid][pGun1] = 0; PlayerInfo[playerid][pAmmo1] = 0;
}
if (PlayerInfo[playerid][pGun2] > 0)
{
GivePlayerWeapon(playerid, PlayerInfo[playerid][pGun2], PlayerInfo[playerid][pAmmo2]);
PlayerInfo[playerid][pGun2] = 0; PlayerInfo[playerid][pAmmo2] = 0;
}
}
//=========================================================================
return 1;
}
}
return 1;
}