03.05.2017, 19:21
So, firstly. It doesn't put the player into the position as requested nor does it apply the animation - but it doesn't show the Injured Mode text and set his health to 25. A fix would be great.
Also, when a player takes damage from getting shot in the leg, it doesn't do the animation when he gets hit. Here is the full code:
PHP код:
public OnPlayerDeath(playerid, killerid, reason)
{
new Float:x, Float:y, Float:z;
new str[128];
new PlayerName[MAX_PLAYERS];
GetPlayerName(playerid, PlayerName, 24);
if(PlayerD[playerid][BrutallyW1] == 0)
{
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, x, y, z);
SetPlayerHealth(playerid, 25.0);
GameTextForPlayer(playerid, "~b~Injured~r~ Mode", 10000, 3);
ClearAnimations(playerid);
ApplyAnimation(playerid, "PED", "FLOOR_hit_f", 4.1, 1, 0, 0, 0, 0);
if(Character[playerid][Level] <= 10)
THIS DOES RETURN DON'T WORRY - I JUST SHOWED HALF OF IT.
{
Also, when a player takes damage from getting shot in the leg, it doesn't do the animation when he gets hit. Here is the full code:
PHP код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
new vid = GetPlayerVehicleID(playerid);
if(IsPlayerInAnyVehicle(playerid))
{
if(GetPlayerState(playerid == PLAYER_STATE_DRIVER))
{
if(PRESSED(KEY_HANDBRAKE))
{
if(Engine[vid] == 0)
{
if(CanDriveVehicle(playerid, vid))
{
Engine_TOGGLE(playerid, vid);
}
}
}
else if(PRESSED(KEY_LOOK_BEHIND))
{
Lights_TOGGLE(playerid, vid);
}
}
}
if(LoopAnim[playerid])
{
if(PRESSED(KEY_HANDBRAKE))
{
StopLoopingAnim(playerid);
TextDrawHideForPlayer(playerid,AnimText[playerid]);
}
}
if(LegHit[playerid] == 1) // Will happen only if the player is shot in his left/right leg.
{
if((newkeys & KEY_JUMP) && !(oldkeys & KEY_JUMP)) // When the users presses his Jump key -
{
ClearAnimations(playerid);
ApplyAnimation(playerid, "PED", "FALL_collapse", 4.1, 0, 0, 0, 0, 0); // Animation would be applied.
SendClientMessage(playerid, -1, "You can not jump! You've been hit on your leg!"); // Send client message about his injury in his leg.
}
if((newkeys & KEY_SPRINT) && (oldkeys & KEY_SPRINT)) // When the user presses the Sprint key -
{
ClearAnimations(playerid);
ApplyAnimation(playerid, "PED", "FALL_fall", 4.1, 0, 0, 0, 0, 0); // Different Animation would be applied.
SendClientMessage(playerid, -1, "You're having trouble running because of the Gun Shot Wound"); // Sending client message about his injury(ies) again.
}
}
return 1;
}