Код:
----------- That is my On death-----------------
public OnPlayerDeath(playerid, killerid, reason)
{
PlayerInfo[playerid][pSkin] = GetPlayerSkin(playerid);
PlayerInfo[playerid][pHospital] = 1;
SafeResetPlayerWeapons(playerid);
ResetPlayerWantedLevelEx(playerid);
InShamal[playerid] = 0;
InAndrom[playerid] = 0;
CopOnDuty[playerid] = 0;
if(AdminDuty[playerid] == 1)
{
PlayerInfo[playerid][pHospital] = 1;
}
return 1;
}
--------------------------- Set Spawn ----------------
Код:
public SetPlayerSpawn(playerid)
{
if(IsPlayerConnected(playerid))
{
SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
if(PlayerInfo[playerid][pLoadPos])
{
SetPlayerPos(playerid,PlayerInfo[playerid][pLoadPosX],PlayerInfo[playerid][pLoadPosY],PlayerInfo[playerid][pLoadPosZ]);
SetPlayerInterior(playerid,PlayerInfo[playerid][pLoadPosInt]);
SetPlayerVirtualWorld(playerid,PlayerInfo[playerid][pLoadPosW]);
PlayerInfo[playerid][pLoadPos] = 0;
return 1;
}
if(PlayerInfo[playerid][pRegistered] == 0)
{
TogglePlayerControllable(playerid, 0);
}
if(PlayerCuffed[playerid] == 1)
{
PlayerInfo[playerid][pJailed] = 1;
PlayerInfo[playerid][pJailTime] = 15;
}
/* if(PlayerInfo[playerid][pHospital] > 0)
{
DoHospital(playerid);
return 1;
}*/
if(AdminDuty[playerid])
{
SetPlayerColor(playerid,COLOR_ADMINDUTY);
SetPlayerHealth(playerid,999);
SetPlayerArmour(playerid,999);
}
if(PlayerInfo[playerid][pFaction] != 255)
{
SetPlayerToFactionColor(playerid);
SetPlayerToFactionSkin(playerid);
}
if(PlayerInfo[playerid][pJailed] > 0)
{
if(PlayerInfo[playerid][pJailed] == 1)
{
SetPlayerVirtualWorld(playerid,2);
SetPlayerInterior(playerid,6);
SetPlayerPos(playerid,264.5743,77.5118,1001.0391);
SendClientMessage(playerid, COLOR_WHITE, "Do your time!");
return 1;
}
else if(PlayerInfo[playerid][pJailed] == 2)
{
SetPlayerVirtualWorld(playerid,0);
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,3312.4163,-1935.4459,10.9682);
SendClientMessage(playerid, COLOR_WHITE, "Do your 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);
return 1;
}
}
else
{
SetPlayerPos(playerid,CivilianSpawn[X],CivilianSpawn[Y],CivilianSpawn[Z]);
SetPlayerVirtualWorld(playerid, CivilianSpawn[World]);
SetPlayerInterior(playerid, CivilianSpawn[Interior]);
SetPlayerFacingAngle(playerid,CivilianSpawn[Angle]);
return 1;
}
}
return 1;
}
Spawn and death, now.. i tested this by parachuting and than doing gotols without pulling chute and doing /kill. ill post those two as well
Код:
if(strcmp(cmd, "/kill", true) == 0)
{
if(IsPlayerConnected(playerid))
{
ClearAnimations(playerid);
SetPlayerHealth(playerid, 0.0);
PlayerInfo[playerid][pHospital] = 1;
return 1;
}
}
-----------------------
i
Код:
f(strcmp(cmd, "/skydive", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 1)
{
new Float:rx, Float:ry, Float:rz;
GetPlayerPos(playerid, rx, ry, rz);
if (IsPlayerConnected(playerid))
{
SafeGivePlayerWeapon(playerid, 46, 0);
SetPlayerPos(playerid,rx, ry, rz+1500);
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "[Error:] You are not authorized to use that command");
}
}
return 1;
}