Wanted Level
#1

Hello samp members i need some help based on this code:
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(GetPlayerWeapon(killerid) == 35) Kick(killerid);
	if(GetPlayerWeapon(killerid) == 36) Kick(killerid);
	if(GetPlayerWeapon(killerid) == 38) Kick(killerid);
	new gunname[32], string[64], fName[MAX_PLAYER_NAME], sName[MAX_PLAYER_NAME];
    GetWeaponName(reason,gunname,sizeof(gunname));
    GetPlayerName(playerid,fName,MAX_PLAYER_NAME);
    GetPlayerName(killerid,sName,MAX_PLAYER_NAME);
    format(string, sizeof(string), "%s has killed %s using a %s.", sName, fName, gunname);
    SendClientMessageToAll(0xFFFFFFAA,string);
	SetPlayerWantedLevel(killerid, 6);
	GivePlayerMoney(killerid, 5000);
	SendClientMessage(killerid,0x2641FEAA,"You won 5.000$ for killing!!");
	SendDeathMessage(killerid, playerid, reason);
	SendClientMessage(playerid , 0x2641FEAA,"You died HAHAHAHAHAHAH");
	return 1;
}
I added the
Код:
SetPlayerWantedLevel(killerid, 6);
because i couldn't make the killer to get +1 star each time he kills someone.Might you help me?(+1 rep to be given)
Reply
#2

new wantedlevell;
wantedlevell = GetPlayerWantedLevel(playerid)
SetPlayerWantedLevel(killerid, wantedlevell + 1);
Reply
#3

you can try this sample:
Код:
if(GetPlayerWantedLevel(killerid) != 6)
{
      SetPlayerWantedLevel(killerid,GetPlayerWantedLevel(killerid)+1);
}
Reply
#4

thanks you .
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)