SA-MP Forums Archive
little question - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: little question (/showthread.php?tid=278183)



little question - Tanush123 - 21.08.2011

Well how can i fix this because if somebody is otesting(killerid) and when he kills someone he still gets stars . i want if player has otest[killerid] == 0 they get stars and if they have otest[killerid] = 1; they wont
pawn Code:
public OnPlayerDeath(playerid, killerid, reason)
{
    SendDeathMessage(killerid,playerid,reason);
    died[playerid] = 1;
    if(PlayerData[killerid][IsLaw] == 0)
    {
        SetPlayerWantedLevel(killerid,GetPlayerWantedLevel(killerid)+1);
    }
    if(otest[killerid] == 0)
    {
        SetPlayerWantedLevel(killerid,GetPlayerWantedLevel(killerid)+1);
    }
    return 1;
}



Re: little question - DJDhan - 21.08.2011

Try this:
Code:
public OnPlayerDeath(playerid, killerid, reason)
{
	SendDeathMessage(killerid,playerid,reason);

	died[playerid] = 1;

	if(PlayerData[killerid][IsLaw] == 0 && otest[killerid] == 0)
	{
		SetPlayerWantedLevel(killerid,GetPlayerWantedLevel(killerid)+1);
	}
	
	return 1;
}