25.06.2016, 06:46
When i shoot a player with a beanbag, server crashes and restarts, here is my code i have a custom damage script under onplayertakedamage and it is new, once i implemented it, the beanbag and taser stopped working. I have case 25(shotgun). The first part is my check if Beanbag is active, and if player is not beanbagged already then it does the code, server crashed on the shot with /rubberbullets activated, the player doesnt do an animation ethier, it crashes by then.i have no idea what is wrong with my code.
Код:
case 25: { if(BeanbagActive{issuerid}) { if(!Beanbag{playerid}) { OnAnim{playerid} = true; ApplyAnimation(playerid, "SWEET", "Sweet_injuredloop", 4.0,0,0,0,1,0); ActionMessage(playerid, 20.0, "was hit by a rubber bullet and falls on the ground"); SCM(playerid, COLOR_WHITE, "You have just been hit by a rubber bullet shotgun. You will be able to get up in 15 seconds."); Beanbag{playerid} = true; SetTimerEx("BeanbagReset", 15000, false, "i", playerid); SCM(issuerid, COLOR_YELLOWG, "HINT: You hit %s with a rubber bullet!", GetName(playerid)); } else { SCM(issuerid, COLOR_LIGHTRED, "This player has already been hit with a beanbag."); } } else { GetPlayerPos(playerid, x, y, z); distance = GetPlayerDistanceFromPoint(issuerid, x, y, z); if (distance <= 10) damage = 64; if (distance > 10 && distance < 20.0) damage = 54; if (distance >= 20.0 && distance < 30.0) damage = 43; if (distance >= 30.0) damage = 35; } }