[debug] Run time error 11: "Divide by zero" [18:02:35] [debug] AMX backtrace: [18:02:35] [debug] #0 00030bfc in public ExplodeBodyParts (playerid=0) at :3254 [18:02:35] [debug] #1 0002de60 in ?? (... <3 arguments>) at 3027 [18:02:35] [debug] #2 0000d924 in public OnPlayerDeath (playerid=0, killerid=65535, reason=255) at pawno\include\YSI\y_hooks/impl.inc:742
Line 3245 SetPlayerVirtualWorld(playerid, 69 * 69 * 69 / playerid); |
Line 3027 if(IsPlayerConnected(killerid) && killerid != INVALID_PLAYER_ID && killerid != playerid) |
Run time error 11: "Divide by zero"
pawn Код:
The solution is: do not divide with the playerid, find some other way to set a high number of virtual world. |
SetPlayerVirtualWorld( playerid, ( playerid + 10 ) * ( playerid + 10 ) + playerid );
By not dividing with 0. For example, I'd use something like:
pawn Код:
|
public ExplodeBodyParts(playerid) { new Float:aPos[3], Objects[8]; GetPlayerPos(playerid, aPos[0], aPos[1], aPos[2]); if(!GetPlayerInterior(playerid)) GetPointZPos(aPos[0], aPos[1], aPos[2]); Objects[0] = CreateObject(2905, aPos[0], aPos[1], aPos[2], 0.0, 0.0, 0.0); Objects[1] = CreateObject(2906, aPos[0], aPos[1], aPos[2], 0.0, 0.0, 0.0); Objects[2] = CreateObject(2907, aPos[0], aPos[1], aPos[2], 0.0, 0.0, 0.0); Objects[3] = CreateObject(2908, aPos[0], aPos[1], aPos[2], 0.0, 0.0, 0.0); Objects[4] = CreateObject(2906, aPos[0], aPos[1], aPos[2], 0.0, 0.0, 0.0); Objects[5] = CreateObject(2907, aPos[0], aPos[1], aPos[2], 0.0, 0.0, 0.0); Objects[6] = CreateObject(2908, aPos[0], aPos[1], aPos[2], 0.0, 0.0, 0.0); Objects[7] = CreateObject(2906, aPos[0], aPos[1], aPos[2], 0.0, 0.0, 0.0); #if defined BLOOD_EFFECT CreateBloodEffect(aPos[0], aPos[1], aPos[2] - 0.5); #endif for(new i = Objects[0], j; i <= Objects[7]; ++i, ++j) { EffectOnObject(i, aPos[0], aPos[1], aPos[2]); playerPart[i][Player] = playerid; playerPart[i][Part] = j; playerPart[i][EndEffect] = false; } SetPVarInt(playerid, "goreObjectIDStart", Objects[0]); SetPVarInt(playerid, "goreOldVirtualWorld", GetPlayerVirtualWorld(playerid)); SetPlayerVirtualWorld( playerid, ( playerid + 10 ) * ( playerid + 10 ) + playerid ); return 1; }