08.05.2017, 20:20
Hello, I'd like to know what I am doing wrong with my system. Long-story-short I just wanted to create a brutally wounded system, a basic one. So, it goes like this: I set every player to be on the same team so I can use custom damages for every weapon for better handling and so on. I introduced the Deagle and had it to do -25 damage per shot. When the player has 25 HP or less, he would be put in an animation and frozen onto the ground. The first problem itself is that the player can't move his camera (and this is kinda annoying for me tbh) because of the TogglePlayerControlable, and the second problem is that once the player gets shot again (because he's brutally wounded, he'd get killed after being shot one more time) he would be shown for other players as he stopped from doing his animation.
TL; DR: I want to fix the TogglePlayerControllable issue so the player will be able to move his camera. And I want to fix the animation problem where he'd be shown as stopping his animation for the other players (aka just standing).
TL; DR: I want to fix the TogglePlayerControllable issue so the player will be able to move his camera. And I want to fix the animation problem where he'd be shown as stopping his animation for the other players (aka just standing).
Код:
public OnPlayerTakeDamage( playerid, issuerid, Float: amount, weaponid, bodypart ){ new Float: health, Float: armour ; GetPlayerHealth( playerid, health ) ; GetPlayerArmour( playerid, armour ) ; if( health > 25 ){ if( GetPlayerWeapon( issuerid ) == 24 ){ SetPlayerHealth( playerid, health-25 ) ; }}else if( health <= 25 && GetIntVar( playerid, "BrutallyWounded" ) == 0 ) { TogglePlayerControllable( playerid, 0 ) ; ApplyAnimation( playerid, "WUZI", "CS_Dead_Guy", 4.1, 0, 0, 1, 1, 300000, 1 ) ; SetIntVar( playerid, "BrutallyWounded", 1 ) ; SCM( playerid, -1, "DEBUG: You are now in BW mode." ) ; SCM( issuerid, -1, "DEBUG: Your victim is now in BW mode." ) ; } return 1; } public OnPlayerWeaponShot( playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ ) { if( hittype == BULLET_HIT_TYPE_PLAYER ){ new Float: health, Float: armour ; GetPlayerHealth( hitid, health ) ; GetPlayerArmour( hitid, armour ) ; if( health <= 25 && GetIntVar( hitid, "BrutallyWounded" ) == 1 ) { SetIntVar( hitid, "BrutallyWounded", 2 ) ; SCM( hitid, -1, "DEBUG: You are now dead." ) ; SCM( playerid, -1, "DEBUG: Player is now dead." ) ; } } return 1; }