Wanted Level Bugged
#1

Hello!

I have a problem with Wanted Level increasing.
When I am a player on my server (without admin level) and I kill other player I dont get wanted,it says that I get wanted but in right corner up I dont have any numbers which would say how many wanteds i have,so if my wanted dont change then my color of name (When you press TAB) dont change from White (Innocent) to Red (Most Wanted),so I stay white.

NOTE* at that picture I mean "No 12 wanted level" not 12 stars

And If I have admin level (for example lvl 1) and I kill other player it says that I got wanted level but then in right corner up I have 72 wanted level instead of 12 as you can see on the picture.Also then my color of name (When you press TAB) change from white to red.



So,you can see that the diffrence is when I am admin or I am not admin.I really dont know how to fix that increasing of wanted level.If someone could say me what to do to fix it.

OnPlayerDeath:

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
	SendDeathMessage(killerid, playerid, reason);
	SetPlayerWantedLevel(playerid,0);
 	GivePlayerMonez(playerid, -1000);

    if(killerid == INVALID_PLAYER_ID)
	{
	    SetPlayerWantedLevel(killerid, 0);
	    SetPlayerWantedLevel(playerid, 0);
	}

 	if(GetPlayerTeam(killerid) == TEAM_CIVILIAN)
	{
		IncreaseWantedLevel(killerid,12);
		SetPlayerScore(killerid, GetPlayerScore(killerid)+2);
		pInfo[killerid][Kills]++;
		
	}
Reply
#2

What kind of function is IncreaseWantedLevel ?

Post it please
Reply
#3

Quote:
Originally Posted by [SWE]Alexzz
Посмотреть сообщение
What kind of function is IncreaseWantedLevel ?

Post it please
IncreaseWantedLevel :

-it increase your level ,if you kill someone it increase your level by 12 wanted level,so if I had 6 wanted level before I killed player now I have 18 wanted level beacuse i got +12 wanted level because i killed a player :

IncreaseWantedLevel(playerid,12); --> increase wanted by 12
IncreaseWantedLevel(playerid,6); --> increase wanted by 6

And when I get killed it Setwantedlevel to 0

Hope you understand
Reply
#4

But IncreaseWantedLevel is a custom function.

Please post public IncreaseWantedLevel
Reply
#5

Here it is:

Код:
stock IncreaseWantedLevel(playerid,Value)
{
	new string[128];
	new pwlvl = GetPlayerWantedLevel(playerid);
	pwlvl +=Value;
	SetPlayerWantedLevel(playerid,pwlvl);
	format(string,sizeof(string),"{FFDC2E}[CRIME] {FFFFFF}Your wanted level has been modified by %d! Wanted level: %d",Value,pwlvl);
	SendClientMessage(playerid,COLOR_WHITE,string);
	return 1;
}
Reply
#6

Guys, here is all OnPlayerDeath public:

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
 SendDeathMessage(killerid, playerid, reason);
 SetPlayerWantedLevel(playerid,0);
  GivePlayerMoney(playerid, -1000);

    if(killerid == INVALID_PLAYER_ID)
 {
     SetPlayerWantedLevel(killerid, 0);
     SetPlayerWantedLevel(playerid, 0);
 }

  if(GetPlayerTeam(killerid) == TEAM_CIVILIAN)
 {
  IncreaseWantedLevel(killerid,12);
  SetPlayerScore(killerid, GetPlayerScore(killerid)+2);
  SetPlayerWantedLevel(playerid, 0);
  pInfo[killerid][Kills]++;
  
 }
  pInfo[playerid][Deaths]++;
 PlayerUnCuffed(playerid);

 
 if(GetPlayerWantedLevel(playerid) >= 4)
 {
   if(GetPlayerTeam(killerid) == TEAM_POLICE || GetPlayerTeam(killerid) == TEAM_CIA || GetPlayerTeam(killerid) == TEAM_SWAT || GetPlayerTeam(killerid) == TEAM_FBI || GetPlayerTeam(killerid) == TEAM_ARMY )
    {
       new string[128];
       new money = pInfo[playerid][Wanted];
    money = pInfo[playerid][Wanted];
    GivePlayerMonez(killerid, pInfo[playerid][Wanted]*200);
    SetPlayerScore(killerid, GetPlayerScore(killerid)+2);
    GiveExperience(killerid);

    pInfo[killerid][Kills]++;
    pInfo[playerid][Deaths]++;
     format(string, sizeof(string), "[POLICE]{FFFFFF} You killed a criminal and earned $%d", money*200);
    SendClientMessage(killerid, COLOR_BLUE, string);
    SetPlayerWantedLevel(playerid, 0);
   }
 }
 else
 {
     if(GetPlayerTeam(killerid) == TEAM_POLICE || GetPlayerTeam(killerid) == TEAM_CIA || GetPlayerTeam(killerid) == TEAM_SWAT || GetPlayerTeam(killerid) == TEAM_FBI || GetPlayerTeam(killerid) == TEAM_ARMY )
     {
     
       SetPlayerWantedLevel(playerid,0);
              //TextDraw
              new string[128];
              format(string,sizeof(string),"{FFDC2E}[JAIL] {FFFFFF}%s(%d) has been sent to jail for 200 seconds by the server {00FF00}[REASON: Killing Innocent(s)]",PlayerName(killerid),killerid);
              SendClientMessageToAll(COLOR_WHITE,string);
              SendClientMessage(killerid,COLOR_WHITE,"{00C0FF}[INNOCENT KILL] {FFFFFF}You have lost {FFDC2E}$2,000 {FFFFFF}and 2 score for killing an innocent.");
        GivePlayerMoney(killerid,-2000);
        SetPlayerScore(killerid,GetPlayerScore(killerid)-2);
          //Others
             ResetPlayerWeapons(killerid);
             pInfo[killerid][JailTime] = 200;
             pInfo[killerid][Jailed] = 1;
             Cuffed[killerid] =0;
    JailSpawn(killerid);
    PlayerJailed(killerid, 200);
             TogglePlayerControllable(killerid,1);
             SetPlayerWantedLevel(killerid,0);
             SetPlayerHealth(killerid,Math.Infinite());
             return 1;

     }
 }
    if(pInfo[playerid][Placehit] >= 1000)
   {
  if(pInfo[killerid][Job] == 1)
  {

     new string[128], pName[MAX_PLAYERS], pName2[MAX_PLAYERS];
    GetPlayerName(killerid, pName, sizeof(pName));
    GetPlayerName(playerid, pName2, sizeof(pName2));
    GivePlayerMonez(killerid, pInfo[playerid][Placehit]);
    SetPlayerScore(killerid, GetPlayerScore(killerid)+2);

    pInfo[killerid][Kills]++;
    pInfo[playerid][Deaths]++;
     format(string, sizeof(string), "[CONTRACT]{FFFFFF} %s(%d) has completed the contract of %s(%d), his bounty is {FFFF00}$%s", pName, killerid, pName2, playerid, Comma(pInfo[playerid][Placehit]));
    SendClientMessageToAll(COLOR_ANTICHEAT, string);
    SetPlayerWantedLevel(playerid, 0);
    pInfo[playerid][Placehit] = 0;

  }
 }
  if(pRobbingJizzy[playerid] || pRobbingAmmu[playerid] || pRobbingDriv[playerid] || pRobbingMis[playerid] ||
 pRobbingDon[playerid] || pRobbingBurg[playerid] || pRobbingBurg2[playerid] || pRobbingBurg3[playerid] ||
 pRobbingTat[playerid] || pRobbingSub[playerid] || pRobbingGay[playerid] || pRobbingBar[playerid] ||
 pRobbingGym[playerid] || pRobbingClu[playerid] || pRobbingClu2[playerid] || pRobbingBin[playerid] ||
 pRobbingGas[playerid] || pRobbingGas2[playerid] || pRobbingZip[playerid] || pRobbingVict[playerid] ||
 pRobbingPizz[playerid] || pRobbingPizz2[playerid] || pRobbingZr[playerid] || pRobbingWan[playerid] ||
 pRobbingOtto[playerid] || pRobbingTrain[playerid] || pRobbingSup[playerid] || pRobbingBank[playerid] ||
 pRobbingAir[playerid] || pRobbingPizz3[playerid] )
 {
  RobStores(playerid);
 }

 TextDrawHideForPlayer(playerid,LocationTD[playerid]);
 
 return 1;
}
So I'll explain situation, I'm intending to do this: when law enforcement officer kill innocent player (not wanted) go to jail but it's bugged, when player kills innocent player and wanted player in same time, he got sent to jail and there is bug with wanted increase, as you can see when player (Civilian) kills anyone, wanted increase 12, but it doesn't, I couldn't fix it so pls help me, tnx
Reply
#7

Anyone help please?
Reply
#8

Quote:
Originally Posted by SplinteX
Посмотреть сообщение
Anyone help please?
Sure, show us the Textdraw code and how does it update when you kill someone?
Reply
#9

Quote:
Originally Posted by pds2k12
Посмотреть сообщение
Sure, show us the Textdraw code and how does it update when you kill someone?
Код:
new Text:WantedLvlTxd[MAX_PLAYERS];
Код:
WantedLvlTxd[playerid] = TextDrawCreate(555.000000, 123.000000, "] 0 ]");
	TextDrawBackgroundColor(WantedLvlTxd[playerid], 0x000000AA);
	TextDrawAlignment(WantedLvlTxd[playerid], 2);
	TextDrawFont(WantedLvlTxd[playerid], 2);
	TextDrawLetterSize(WantedLvlTxd[playerid], 0.290000, 1.300000);
	TextDrawColor(WantedLvlTxd[playerid], 0x906210FF);
	TextDrawSetOutline(WantedLvlTxd[playerid], 1);
	TextDrawSetProportional(WantedLvlTxd[playerid], 1);
	TextDrawSetShadow(WantedLvlTxd[playerid], 0);
When i kill someone my wanted should increase by 12 ,if i rob someone or rape it should increase by 4 ,and i i rob store it should increase for 6.But it doesnt as you can see above on the pictures.

Код:
	if(GetPlayerTeam(playerid) == TEAM_CIVILIAN && aDuty[playerid] == 0)
	{
	    if(GetPlayerWantedLevel(playerid) == 0 )
	    {
	        SetPlayerColor(playerid, COLOR_WHITE);
	        TextDrawHideForPlayer(playerid, WantedLvlTxd[playerid]);
	    }
	    if(GetPlayerWantedLevel(playerid) == 1 || GetPlayerWantedLevel(playerid) == 2 || GetPlayerWantedLevel(playerid) == 3 )
	    {
	        SetPlayerColor(playerid, COLOR_YELLOW);
	        TextDrawShowForPlayer(playerid, WantedLvlTxd[playerid]);
	    }
	    if(GetPlayerWantedLevel(playerid) == 4 || GetPlayerWantedLevel(playerid) == 5 )
	    {
	        SetPlayerColor(playerid, COLOR_ORANGE);
	        TextDrawShowForPlayer(playerid, WantedLvlTxd[playerid]);
	    }
	    if(GetPlayerWantedLevel(playerid) >= 6 )
	    {
	        SetPlayerColor(playerid, COLOR_RED);
	        TextDrawShowForPlayer(playerid, WantedLvlTxd[playerid]);
	    }
	}
	return 1;
}
Код:
forward CheckWanted(playerid);
public CheckWanted(playerid)
{
    new string[128];
	format(string,sizeof(string),"] %d ]",pInfo[playerid][Wanted]);
	TextDrawSetString(WantedLvlTxd[playerid], string);
    return 1;
}
Reply
#10

pawn Код:
forward CheckWanted(playerid);
public CheckWanted(playerid)
{
    new string[128];
    format(string,sizeof(string),"] %d ]",GetPlayerWantedLevel(playerid));
    TextDrawSetString(WantedLvlTxd[playerid], string);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)