03.02.2018, 08:29
The Injured system in my server is to prevent a player respawning after they die (I meant, respawning in his death place and cant move)
And the problem is, how to make the player invulnerable, so they don't get to the hospital when they got shot/hurt while the player is injured?
Please help me edit this OnPlayerTakeDamage
And the problem is, how to make the player invulnerable, so they don't get to the hospital when they got shot/hurt while the player is injured?
Please help me edit this OnPlayerTakeDamage
PHP код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
if(bodypart == 3) PlayerInfo[playerid][pBodyStatus][0] -= frandom(1.0);
if(bodypart == 4) PlayerInfo[playerid][pBodyStatus][1] -= frandom(1.0);
if(bodypart == 5) PlayerInfo[playerid][pBodyStatus][3] -= frandom(1.0);
if(bodypart == 6) PlayerInfo[playerid][pBodyStatus][2] -= frandom(1.0);
if(bodypart == 7) PlayerInfo[playerid][pBodyStatus][5] -= frandom(1.0);
if(bodypart == 8) PlayerInfo[playerid][pBodyStatus][4] -= frandom(1.0);
ShowBloodScreen(playerid, amount);
new status[64], Float:health, Float:armor, string[128];
GetPlayerHealth(playerid, health);
GetPlayerArmour(playerid, armor);
format(status, sizeof(status), "Stranger_%d\n{ff0000}H: %.1f\n{ffffff}A: %.1f", RandMask[playerid], health, armor);
UpdateDynamic3DTextLabelText(MaskText[playerid], 0xFFFFFFFF, status);
if(issuerid != INVALID_PLAYER_ID && weaponid == 31 && bodypart == 9)
{
if(!PlayerInfo[playerid][pHS])
{
PlayerInfo[playerid][pHS] = 1;
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetTimerEx("KillPlayer",2000,0,"i",playerid);
}
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9)
{
if(!PlayerInfo[playerid][pHS])
{
PlayerInfo[playerid][pHS] = 1;
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetTimerEx("KillPlayer",2000,0,"i",playerid);
}
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 24 && bodypart == 9)
{
if(!PlayerInfo[playerid][pHS])
{
PlayerInfo[playerid][pHS] = 1;
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetTimerEx("KillPlayer",2000,0,"i",playerid);
}
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 30 && bodypart == 9)
{
if(!PlayerInfo[playerid][pHS])
{
PlayerInfo[playerid][pHS] = 1;
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetTimerEx("KillPlayer",2000,0,"i",playerid);
}
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 25 && bodypart == 9)
{
if(!PlayerInfo[playerid][pHS])
{
PlayerInfo[playerid][pHS] = 1;
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetTimerEx("KillPlayer",2000,0,"i",playerid);
}
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 27 && bodypart == 9)
{
if(!PlayerInfo[playerid][pHS])
{
PlayerInfo[playerid][pHS] = 1;
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetTimerEx("KillPlayer",2000,0,"i",playerid);
}
}
if(issuerid != INVALID_PLAYER_ID && bodypart == 7)
{
if(!PlayerInfo[playerid][pLLS])
{
PlayerInfo[playerid][pLLS] = 1;
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
ApplyAnimation(playerid,"CRACK", "crckdeth2", 4.1, 1, 0, 0, 1, 600);
}
}
if(issuerid != INVALID_PLAYER_ID && bodypart == 8)
{
if(!PlayerInfo[playerid][pRLS])
{
PlayerInfo[playerid][pRLS] = 1;
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
ApplyAnimation(playerid,"CRACK", "crckdeth2", 4.1, 1, 0, 0, 1, 600);
}
}
if(issuerid != INVALID_PLAYER_ID && bodypart == 5)
{
if(!PlayerInfo[playerid][pLAS])
{
PlayerInfo[playerid][pLAS] = 1;
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
}
if(issuerid != INVALID_PLAYER_ID && bodypart == 6)
{
if(!PlayerInfo[playerid][pRAS])
{
PlayerInfo[playerid][pRAS] = 1;
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
}
if(issuerid != INVALID_PLAYER_ID && bodypart == 4)
{
if(!PlayerInfo[playerid][pCS])
{
if(health < 15)
{
PlayerInfo[playerid][pCS] = 1;
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetTimerEx("KillPlayer",3000,0,"i",playerid);
}
}
}
if(issuerid != INVALID_PLAYER_ID && bodypart == 3)
{
if(!PlayerInfo[playerid][pTS])
{
if(health < 15)
{
PlayerInfo[playerid][pTS] = 1;
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetTimerEx("KillPlayer",3000,0,"i",playerid);
}
if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT && GetPVarInt(playerid, "Injured") == 1)
{
SetPlayerHealth(playerid, 19.0);
}
}
}
return 1;
}
PHP код:
if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT && GetPVarInt(playerid, "Injured") == 1)
{
SetPlayerHealth(playerid, 19.0);
}
}
}
return 1;
Or is there any setplayerhealth, that gives god mode but on the screen, player doesn't see full health, but they see no health.