SA-MP Forums Archive
Help, Log crashdetect[+rep] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help, Log crashdetect[+rep] (/showthread.php?tid=578222)



Help, Log crashdetect[+rep] - SHFaCeBook - 17.06.2015

hello



i get this error in logs, in line "7165"
Код:
[debug] #0 0004ef40 in public OnPlayerTakeDamage (playerid=1, issuerid=65535, Float:amount=4.40574, weaponid=54, bodypart=3) at C:\Users\hp\Downloads\Compressed\samp037_svr_R1_win32\beta\gamemodes\beta.pwn:7165
Код:
#0 0004ef40 in public OnPlayerTakeDamage (playerid=1, issuerid=65535, Float:amount=27.85016, weaponid=54, bodypart=3) at C:\Users\hp\Downloads\Compressed\samp037_svr_R1_win32\beta\gamemodes\beta.pwn:7165
this line
what wrong here?
Код:
ShotTimes[issuerid]++;
full code
pawn Код:
if(GetDistanceBetweenPlayers(issuerid, playerid) < 41)
    {
        ShotTimes[issuerid]++;
        if(playerid == LastShot[issuerid])
        {
            format(string, 256, "+~g~%.0f~w~ damage (~g~ %s~w~) (x ~g~ %d~w~)", amount, PlayerInfo[playerid][pNume], ShotTimes[issuerid]);
            LastShot[issuerid] = playerid;
        }
        else
        {
            LastShot[issuerid] = playerid;
            ShotTimes[issuerid] = 1;
            format(string, 256, "+~g~%.0f~w~ damage (~g~%s~w~) (x ~g~%d~w~)", amount, PlayerInfo[playerid][pNume], ShotTimes[issuerid]);
        }
        if(PlayerInfo[issuerid][pDMGInformer] != 0)
        {
            TextDrawSetString(Damage1[issuerid], string);
            TextDrawShowForPlayer(issuerid, Damage1[issuerid]);
            ShotTime2[issuerid] = 5;
        }
    }
    else
    {
        ShotTimes[issuerid]++;
        format(string, 256, "+~g~%.0f~w~ damage (x ~g~%d~w~)", amount, ShotTimes[issuerid]);
        if(PlayerInfo[issuerid][pDMGInformer] != 0)
        {
            TextDrawSetString(Damage1[issuerid], string);
            TextDrawShowForPlayer(issuerid, Damage1[issuerid]);
            LastShot[issuerid] = playerid;
            ShotTime2[issuerid] = 5;
        }
    }
    if(issuerid == INVALID_PLAYER_ID)
    {
        if(PlayerInfo[playerid][pDMGInformer] != 0)
        {
            format(string, 256, "-~r~%.0f~w~ damage", amount);
            TextDrawSetString(Damage0[playerid], string);
            TextDrawShowForPlayer(playerid, Damage0[playerid]);
            ShotTime[playerid] = 5;
        }
    }
    else
    {
        if(PlayerInfo[playerid][pDMGInformer] != 0)
        {
            format(string, 256, "-~r~%.0f~w~ damage(~r~%s~w~) (x ~r~%d ~w~)", amount, PlayerInfo[issuerid][pNume],ShotTimes[issuerid]);
            TextDrawSetString(Damage0[playerid], string);
            TextDrawShowForPlayer(playerid, Damage0[playerid]);
            ShotTime[playerid] = 5;
        }
    }
    return 1;
}



Re: Help, Log crashdetect[+rep] - McBan - 17.06.2015

Not tested but try this:

Код:
if(GetDistanceBetweenPlayers(issuerid, playerid) < 41)
	{
		ShotTimes[issuerid]++;
		if(playerid == LastShot[issuerid])
		{
			format(string, 256, "+~g~%.0f~w~ damage (~g~ %s~w~) (x ~g~ %d~w~)", amount, PlayerInfo[playerid][pNume], ShotTimes[issuerid]);
			LastShot[issuerid] = playerid;
		}
		else
		{
			ShotTimes[issuerid] = 1;
			format(string, 256, "+~g~%.0f~w~ damage (~g~%s~w~) (x ~g~%d~w~)", amount, PlayerInfo[playerid][pNume], ShotTimes[issuerid]);
		}
		if(PlayerInfo[issuerid][pDMGInformer] != 0)
		{
			TextDrawSetString(Damage1[issuerid], string);
			TextDrawShowForPlayer(issuerid, Damage1[issuerid]);
			ShotTime2[issuerid] = 5;
		}
	}
	else
	{
		ShotTimes[issuerid]++;
		format(string, 256, "+~g~%.0f~w~ damage (x ~g~%d~w~)", amount, ShotTimes[issuerid]);
		if(PlayerInfo[issuerid][pDMGInformer] != 1)
		{
			TextDrawSetString(Damage1[issuerid], string);
			TextDrawShowForPlayer(issuerid, Damage1[issuerid]);
			LastShot[issuerid] = playerid;
			ShotTime2[issuerid] = +5;
		}
	}
	if(issuerid == INVALID_PLAYER_ID)
	{
		if(PlayerInfo[playerid][pDMGInformer] != 0)
		{
			format(string, 256, "-~r~%.0f~w~ damage", amount);
			TextDrawSetString(Damage0[playerid], string);
			TextDrawShowForPlayer(playerid, Damage0[playerid]);
			ShotTime[playerid] = 5;
		}
	}
	else
	{
		if(PlayerInfo[playerid][pDMGInformer] != 0)
		{
			format(string, 256, "-~r~%.0f~w~ damage(~r~%s~w~) (x ~r~%d ~w~)", amount, PlayerInfo[issuerid][pNume],ShotTimes[issuerid]);
			TextDrawSetString(Damage0[playerid], string);
			TextDrawShowForPlayer(playerid, Damage0[playerid]);
			ShotTime[playerid] = 5;
		}
	}
	return 1;
}