PDA

View Full Version : wanted lvl


blackdragon1
21/02/2013, 12:41 PM
public OnPlayerUpdate(playerid)
{
if(GetPlayerWantedLevel(playerid)>6)SetPlayerWantedLevel(playerid,6);


if(IsPlayerInRangeOfPoint(playerid,1.0,2316.6169,-7.3947,26.7422) && GetPlayerVirtualWorld(playerid) == 1)
{
new chance = random(3);
if(chance == 0)
{
if(bankrob2 == 1){ }else return SendClientMessage(playerid, RED, "This Bank Has Been Robbed Recently. Please Wait Before Robbing It Again.");
if(GetPlayerWantedLevel(playerid) >= 4) return SendClientMessage(playerid, RED, "You Have A Wanted Level For Your Arrest. You Can Not Rob A Bank.");
format(fstr, sizeof(fstr), "%s (%d) has attempted to rob the Bank at Roco Escalante (LV).", GetName(playerid), playerid);
CopRadio(LIGHTBLUE, fstr);
SendClientMessage(playerid, RED, "You have failed to rob the Bank.");
GameTextForPlayer(playerid, "~w~Robbery ~r~Failed", 5000, 5);
SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 4);
format(fstr, sizeof(fstr), "Committed A Crime: Post Bank Robbery Failed - Wanted Level %d - Arrestable", GetPlayerWantedLevel(playerid));
SendClientMessage(playerid, RED, fstr);
PlayerInfo[playerid][pWantedlvl] += GetPlayerWantedLevel(playerid);
}
else
{
if(bankrob2 == 1){ }else return SendClientMessage(playerid, RED, "This Bank Has Been Robbed Recently. Please Wait Before Robbing It Again.");
if(GetPlayerWantedLevel(playerid) >= 4) return SendClientMessage(playerid, RED, "You Have A Wanted Level For Your Arrest. You Can Not Rob A Bank.");
if((gettime() - 5) < bank1robbed) return SendClientMessage(playerid, RED, "This place has been robbed recently, try again later.");
format(fstr, sizeof(fstr), "Crime in progress! %s (%d) is now robbing the Bank at Roco Escalante (LV).", GetName(playerid), playerid);
CopRadio(LIGHTBLUE, fstr);
SetPlayerWantedLevel(playerid,GetPlayerWantedLevel (playerid) +6);
format(fstr, sizeof(fstr), "Committed A Crime: Post Bank Robbery - Wanted Level %d - Arrestable", GetPlayerWantedLevel(playerid));
SendClientMessage(playerid, RED, fstr);
PlayerInfo[playerid][pWantedlvl] += GetPlayerWantedLevel(playerid);
PlayerInfo[playerid][pWantedlvl] += GetPlayerWantedLevel(playerid);
SendClientMessage(playerid, LIGHTGREEN, "You're Robbing the Bank, DON'T LEAVE THE CHECKPOINT!");
IsRobbingBank1{playerid} = true;
ApplyAnimation(playerid,"ped","ARRESTgun",4.1,0,1,1,1,1);
bank1robbed = gettime();
banktimer{playerid} = SetTimerEx("BankRob", 30000, false, "d", playerid);
CountDownRobbery(playerid, 30);
bankrob2 = 0;
SetTimer("togglerob", 300000, false);
}
}

this is my robbank cmd,

what i saying? i am saying i set player wanted lvl 6 but when player have 3 stars and robbing bank so they show to him

"Committed A Crime: Post Bank Robbery - Wanted Level 9 - Arrestable"

i dnt want this^^ i want this ---> "Committed A Crime: Post Bank Robbery - Wanted Level 6 - Arrestable" i want set my last lvl 6. any idea?

zxc1
21/02/2013, 12:44 PM
Replace:
SetPlayerWantedLevel(playerid,GetPlayerWantedLevel (playerid) +6);
With:
SetPlayerWantedLevel(playerid,6);

I've read looked over your cmd again, and noticed that you always add stars instead of setting them.

DaRk_RaiN
21/02/2013, 12:47 PM
if(IsPlayerInRangeOfPoint(playerid,1.0,2316.6169,-7.3947,26.7422) && GetPlayerVirtualWorld(playerid) == 1)
{
new chance = random(3);
if(chance == 0)
{
if(bankrob2 == 1){ }else return SendClientMessage(playerid, RED, "This Bank Has Been Robbed Recently. Please Wait Before Robbing It Again.");
if(GetPlayerWantedLevel(playerid) >= 4) return SendClientMessage(playerid, RED, "You Have A Wanted Level For Your Arrest. You Can Not Rob A Bank.");
format(fstr, sizeof(fstr), "%s (%d) has attempted to rob the Bank at Roco Escalante (LV).", GetName(playerid), playerid);
CopRadio(LIGHTBLUE, fstr);
SendClientMessage(playerid, RED, "You have failed to rob the Bank.");
GameTextForPlayer(playerid, "~w~Robbery ~r~Failed", 5000, 5);
SetPlayerWantedLevel(playerid,6);
format(fstr, sizeof(fstr), "Committed A Crime: Post Bank Robbery Failed - Wanted Level %d - Arrestable", GetPlayerWantedLevel(playerid));
SendClientMessage(playerid, RED, fstr);
PlayerInfo[playerid][pWantedlvl] += GetPlayerWantedLevel(playerid);
}
else
{
if(bankrob2 == 1){ }else return SendClientMessage(playerid, RED, "This Bank Has Been Robbed Recently. Please Wait Before Robbing It Again.");
if(GetPlayerWantedLevel(playerid) >= 4) return SendClientMessage(playerid, RED, "You Have A Wanted Level For Your Arrest. You Can Not Rob A Bank.");
if((gettime() - 5) < bank1robbed) return SendClientMessage(playerid, RED, "This place has been robbed recently, try again later.");
format(fstr, sizeof(fstr), "Crime in progress! %s (%d) is now robbing the Bank at Roco Escalante (LV).", GetName(playerid), playerid);
CopRadio(LIGHTBLUE, fstr);
SetPlayerWantedLevel(playerid,6);
format(fstr, sizeof(fstr), "Committed A Crime: Post Bank Robbery - Wanted Level %d - Arrestable", GetPlayerWantedLevel(playerid));
SendClientMessage(playerid, RED, fstr);
PlayerInfo[playerid][pWantedlvl] += GetPlayerWantedLevel(playerid);
PlayerInfo[playerid][pWantedlvl] += GetPlayerWantedLevel(playerid);
SendClientMessage(playerid, LIGHTGREEN, "You're Robbing the Bank, DON'T LEAVE THE CHECKPOINT!");
IsRobbingBank1{playerid} = true;
ApplyAnimation(playerid,"ped","ARRESTgun",4.1,0,1,1,1,1);
bank1robbed = gettime();
banktimer{playerid} = SetTimerEx("BankRob", 30000, false, "d", playerid);
CountDownRobbery(playerid, 30);
bankrob2 = 0;
SetTimer("togglerob", 300000, false);
}
}

JamesS
21/02/2013, 12:47 PM
You take the wanted level from the player, and do that +6, ofcourse that wont work, use SetPlayerWantedLevel(playerid, 6); as the men above me said.

blackdragon1
21/02/2013, 12:55 PM
SetPlayerWantedLevel(playerid,GetPlayerWantedLevel (playerid) +6); i want they +new wanted lvl and old wanted lvl what player had.


example:

i have 3 wanted lvl and i am going to robbank so they 3 +6 = 6 i want this.

DaRk_RaiN
21/02/2013, 12:58 PM
3 +6 = 6
You are so good at math..
Why go through all of that when you can just set it.

SetPlayerWantedLevel(playerid,6);

blackdragon1
21/02/2013, 01:05 PM
You are so good at math..
[/pawn]


what is my question? i want old wanted stars and new stars but result should be 6.

lollie123
21/02/2013, 01:10 PM
what is my question? i want old wanted stars and new stars but result should be 6.

Then use SetPlayerWantedLevel(playerid, 6);