#1

Код:
[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
Quote:

Line 3245

SetPlayerVirtualWorld(playerid, 69 * 69 * 69 / playerid);

Quote:

Line 3027

if(IsPlayerConnected(killerid) && killerid != INVALID_PLAYER_ID && killerid != playerid)

Reply
#2

pawn Код:
Run time error 11: "Divide by zero"
The runtime error says it all. You do (69 * 69 * 69) / 0 (playerid = 0).

The solution is: do not divide with the playerid, find some other way to set a high number of virtual world.
Reply
#3

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
pawn Код:
Run time error 11: "Divide by zero"
The runtime error says it all. You do (69 * 69 * 69) / 0 (playerid = 0).

The solution is: do not divide with the playerid, find some other way to set a high number of virtual world.
So how I make it right? "find some other way to set a high number of virtual world"
Reply
#4

By not dividing with 0. For example, I'd use something like:

pawn Код:
SetPlayerVirtualWorld( playerid, ( playerid + 10 ) * ( playerid + 10 ) + playerid );
It's a unique virtual world for each player (I suppose).
Reply
#5

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
By not dividing with 0. For example, I'd use something like:

pawn Код:
SetPlayerVirtualWorld( playerid, ( playerid + 10 ) * ( playerid + 10 ) + playerid );
It's a unique virtual world for each player (I suppose).
Wow nice, I see you fixed the debug problem.

Anyways, this is what I am trying to apply in my fs.
https://sampforum.blast.hk/showthread.php?tid=286384

Код:
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;
}
Why is that in my screen it didn't show any body part object it only show blood pop out after I use /kill? But do you think it will show body parts when I kill someone?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)