public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid) { if(PlayerInfo[issuerid][pFaction] == 1 && PD_Taser[issuerid] == 1 && weaponid == 23) { if(Paralized[playerid] == 0) { new Float:health; GetPlayerHealth(playerid, health); SetPlayerHealth(playerid, health+amount); ApplyAnimation(playerid, "SWEET", "LaFin_Sweet", 4.1, 0, 1, 1, 1, 0); TogglePlayerControllable(playerid, 0); Paralized[playerid] = 1; SetTimerEx("Tazz", 10000, false, "i", playerid); } } return 1; }
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ) { if (hittype == BULLET_HIT_TYPE_PLAYER) { if(PlayerInfo[playerid][pFaction] == 1 && PD_Taser[playerid] == 1 && weaponid == 23) { if(Paralized[hitid] == 0) { new Float:health; GetPlayerHealth(hitid, health); SetPlayerHealth(hitid, health+amount); ApplyAnimation(hitid, "SWEET", "LaFin_Sweet", 4.1, 0, 1, 1, 1, 0); TogglePlayerControllable(hitid, 0); Paralized[hitid] = 1; SetTimerEx("Tazz", 10000, false, "i", hitid); } return 0; } } return 1; }
new Float:health; GetPlayerHealth(hitid, health); SetPlayerHealth(hitid, health+amount);
So, then
Код:
new Float:health; GetPlayerHealth(hitid, health); SetPlayerHealth(hitid, health+amount); |
if(somethinghere) { new Float:x, Float:y, Float:z; switch(weaponid) { case 0: damage = 3; //Your weapon's damages //Heres a code for shotgun damage and no damage for beanbag. case 25: { if(!IsBBActive{issuerid}) { if(!Beanbagged{playerid}) { //Beanbag code here } else { //Else code here, aka a warning indicating you've shot him already } } else { // Your shotgun's weapon damage here } }
I suggest putting your damage script inside of OnPlayerTake and disable all default damages and then choose when to give damage
Example: Код:
if(somethinghere) { new Float:x, Float:y, Float:z; switch(weaponid) { case 0: damage = 3; //Your weapon's damages //Heres a code for shotgun damage and no damage for beanbag. case 25: { if(!IsBBActive{issuerid}) { if(!Beanbagged{playerid}) { //Beanbag code here } else { //Else code here, aka a warning indicating you've shot him already } } else { // Your shotgun's weapon damage here } } |