Wanted Level (+REP)
#1

Hi there!

Good Day

How do i make the player wanted level on 3 when they attempting to rob the bank and make the wanted level to 6 when they finished robbing the bank. And also it should be shown in /wanted list (for cops)

Код:
public robtimer(playerid)
{
		new string[128];//We are defining a new string for the formatted message that we are displaying later on.
	    new cash = random(2000000);
	    GivePlayerMoney(playerid, cash);
        /*
    With the fuction above 'new cash = random(200000);
        GivePlayerMoney(playerid, cash);' we give the player
    a random amount of money from $0 - $200,000
    */
    //Here below we use the string we defined above to format the message itself and display it to the player.
        format(string, sizeof(string), "You have successfully robbed $%d from the bank!", cash);
        SendClientMessage(playerid, COLOR_WHITE, string);
        format(string, sizeof(string), "[BREAKING NEWS] The suspect %s has successfully rob the money bank", GetPlayerNameEx(playerid));
        SendClientMessageToAll(0x008000FF, string);

}
Код:
CMD:robbank(playerid, params[])
{
        if(robpossible == 1) //If the bank can be robbed we continue below
        {
                if(IsPlayerInRangeOfPoint(playerid, 3.0, 2319.2310,-2.0349,26.7496))
                {//Next thing we do is, we check if we are at the bank interior ^^
                    robpossible = 0; //Then we set the bank so it cannot be robbed
                    SetTimer("waittimer", 900000, false); //Normal Mode 5 minutes
                    /*We run the timer(5 minutes) for the function that is going to make the
                    bank available for robbing again
                    */
                    //SetTimer("waittimer", 65000, false); //Test Mode 65 seconds
                    SetTimer("robtimer", 300000, false);
                    /* We also run another timer(1 minute) for the function that is
                    actually going to give us the money and a user friendly message.
                    */
                    /*
                    Add a function that would notify the police.
                    */

                    SendClientMessageToAll(0x00FF00FF,"[BREAKING NEWS] Bank is being robbed, do not come near the bank!");
			        SendClientMessageToAll(0x0080FFFF, "Alerting all POLICE to come at bank As Soon as possible!!!");
			        SendClientMessageToAll(0x0080FFFF, "Lahat ng police PUMUNTA sa BANK Ngayon din!!!");

                    SendClientMessage(playerid, 0xFF0000FF, "You are robbing the bank, the police has been notified!");
            		SendClientMessage(playerid, 0x008000FF, "You gotta stay 5 minutes before you get the moneys!!!");


                 } else return SendClientMessage(playerid, COLOR_WHITE, "You are not in BANK SAFE!!");
        } else {
            SendClientMessage(playerid, COLOR_WHITE, "You can't rob the bank right now! Already rob or waiting for cool down");
        }
        return 1;
}
Код:
CMD:wanted(playerid, params[])
{
	if(IsACop(playerid) || IsInLSFMD(playerid) || PlayerInfo[playerid][pJob] == 2 || PlayerInfo[playerid][pJob2] == 2 || PlayerInfo[playerid][pFaction] == 5 && PlayerInfo[playerid][pDivision] == 5 || PlayerInfo[playerid][pFaction] == 5 && PlayerInfo[playerid][pDivision] == 2)
	{
		new string[128], x;

		SendClientMessage(playerid, COLOR_GREEN, "Current Wanted Suspects:");
		foreach(Player, i)
		{
			if(PlayerInfo[i][pWantedLevel] >= 1)
			{
				format(string, sizeof(string), "%s%s: %d", string,GetPlayerNameEx(i),PlayerInfo[i][pWantedLevel]);
				x++;
				if(x > 3) {
					SendClientMessage(playerid, COLOR_YELLOW, string);
					x = 0;
					format(string, sizeof(string), " ");
				} else {
					format(string, sizeof(string), "%s, ", string);
				}
			}
		}
		if(x <= 3 && x > 0)
		{
			string[strlen(string)-2] = '.';
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}
	}
	else
	{
		SendClientMessage(playerid, COLOR_GREY, "   You're not a Lawyer / Cop / FBI!");
	}
	return 1;
}
Others CMD that make player shown in /wanted list

Код:
CMD:su(playerid, params[]) {
	if(IsACop(playerid) || PlayerInfo[playerid][pFaction] == 5 && PlayerInfo[playerid][pDivision] == 5 || PlayerInfo[playerid][pFaction] == 5 && PlayerInfo[playerid][pDivision] == 2) {
		if(PlayerInfo[playerid][pJailed] > 0) {
			return SendClientMessage(playerid, COLOR_WHITE, "You can't use this in jail/prison.");
		}

		new
			iTargetID,
			szCrime[64];

		if(sscanf(params, "us[64]", iTargetID, szCrime)) {
			SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/su)spect [playerid/partofname] [crime description]");
		}
		else if(!IsPlayerConnected(iTargetID)) {
			SendClientMessage(playerid, COLOR_GRAD1, "Invalid player specified.");
		}
		else if(IsACop(iTargetID)) {
			SendClientMessage(playerid, COLOR_GREY, "You can't use this command on a law enforcement officer.");
		}
		else if(PlayerInfo[iTargetID][pFaction] == 5) {
			SendClientMessage(playerid, COLOR_GREY, "This person has diplomatic immunity.");
		}
		else if(PlayerInfo[iTargetID][pWantedLevel] >= 6) {
			SendClientMessage(playerid, COLOR_GRAD2, "Target is already most wanted.");
		}
		else {

			new
				szMessage[128];

			++PlayerInfo[iTargetID][pCrimes];
			SetPlayerWantedLevel(iTargetID, ++PlayerInfo[iTargetID][pWantedLevel]);
			if(PlayerInfo[iTargetID][pWantedLevel] > 5)
 			{
				SetPlayerColor(iTargetID, WANTED_COLOR);
			}

			format(szMessage, sizeof(szMessage), "You've commited a crime (%s), reporter: %s.", szCrime, GetPlayerNameEx(playerid));
			SendClientMessage(iTargetID, COLOR_LIGHTRED, szMessage);

			format(szMessage, sizeof(szMessage), "Current wanted level: %d", PlayerInfo[iTargetID][pWantedLevel]);
			SendClientMessage(iTargetID, COLOR_YELLOW, szMessage);

			foreach(Player, i) if(IsACop(i) || PlayerInfo[i][pFaction] == 5 && PlayerInfo[i][pDivision] == 5 || PlayerInfo[playerid][pFaction] == 5 && PlayerInfo[playerid][pDivision] == 2) {
				format(szMessage, sizeof(szMessage), "HQ: All units APB (reporter: %s)",GetPlayerNameEx(playerid));
				SendClientMessage(i, TEAM_BLUE_COLOR, szMessage);
				format(szMessage, sizeof(szMessage), "HQ: Crime: %s, suspect: %s", szCrime, GetPlayerNameEx(iTargetID));
				SendClientMessage(i, TEAM_BLUE_COLOR, szMessage);
			}
		}
	}
	else SendClientMessage(playerid, COLOR_GRAD2, "You're not a law enforcement officer.");
	return 1;
}
THANK YOU VERY MUCH,

I REALLY PROMISE I WILL GIVE AN +REP TO A GUY WHO CAN HELP ME!!

Respectfully Yours,
Trynda
Reply
#2

PHP код:
CMD:robbank(playeridparams[])
{
        if(
robpossible == 1//If the bank can be robbed we continue below
        
{
                if(
IsPlayerInRangeOfPoint(playerid3.02319.2310,-2.0349,26.7496))
                {
//Next thing we do is, we check if we are at the bank interior ^^
                    
robpossible 0//Then we set the bank so it cannot be robbed
                    
SetTimer("waittimer"900000false); //Normal Mode 5 minutes
                    /*We run the timer(5 minutes) for the function that is going to make the
                    bank available for robbing again
                    */
                    //SetTimer("waittimer", 65000, false); //Test Mode 65 seconds
                    
SetTimer("robtimer"300000false);
                    
SetPlayerWantedLevel(playerid3);
                    
PlayerInfo[playerid][pWantedLevel] = 3;
                    
/* We also run another timer(1 minute) for the function that is
                    actually going to give us the money and a user friendly message.
                    */
                    /*
                    Add a function that would notify the police.
                    */
                    
SendClientMessageToAll(0x00FF00FF,"[BREAKING NEWS] Bank is being robbed, do not come near the bank!");
                    
SendClientMessageToAll(0x0080FFFF"Alerting all POLICE to come at bank As Soon as possible!!!");
                    
SendClientMessageToAll(0x0080FFFF"Lahat ng police PUMUNTA sa BANK Ngayon din!!!");
                    
SendClientMessage(playerid0xFF0000FF"You are robbing the bank, the police has been notified!");
                    
SendClientMessage(playerid0x008000FF"You gotta stay 5 minutes before you get the moneys!!!");
                 } else return 
SendClientMessage(playeridCOLOR_WHITE"You are not in BANK SAFE!!");
        } else {
            
SendClientMessage(playeridCOLOR_WHITE"You can't rob the bank right now! Already rob or waiting for cool down");
        }
        return 
1;

PHP код:
public robtimer(playerid)
{
        new 
string[128];//We are defining a new string for the formatted message that we are displaying later on.
        
new cash random(2000000);
        
GivePlayerMoney(playeridcash);
        
/*
    With the fuction above 'new cash = random(200000);
        GivePlayerMoney(playerid, cash);' we give the player
    a random amount of money from $0 - $200,000
    */
    //Here below we use the string we defined above to format the message itself and display it to the player.
        
format(stringsizeof(string), "You have successfully robbed $%d from the bank!"cash);
        
SendClientMessage(playeridCOLOR_WHITEstring);
        
format(stringsizeof(string), "[BREAKING NEWS] The suspect %s has successfully rob the money bank"GetPlayerNameEx(playerid));
        
SendClientMessageToAll(0x008000FFstring);
        
SetPlayerWantedLevel(playerid6);
        
PlayerInfo[playerid][pWantedLevel] = 6;

Reply
#3

Quote:
Originally Posted by Diverse
Посмотреть сообщение
PHP код:
CMD:robbank(playeridparams[])
{
        if(
robpossible == 1//If the bank can be robbed we continue below
        
{
                if(
IsPlayerInRangeOfPoint(playerid3.02319.2310,-2.0349,26.7496))
                {
//Next thing we do is, we check if we are at the bank interior ^^
                    
robpossible 0//Then we set the bank so it cannot be robbed
                    
SetTimer("waittimer"900000false); //Normal Mode 5 minutes
                    /*We run the timer(5 minutes) for the function that is going to make the
                    bank available for robbing again
                    */
                    //SetTimer("waittimer", 65000, false); //Test Mode 65 seconds
                    
SetTimer("robtimer"300000false);
                    
SetPlayerWantedLevel(playerid3);
                    
PlayerInfo[playerid][pWantedLevel] = 3;
                    
/* We also run another timer(1 minute) for the function that is
                    actually going to give us the money and a user friendly message.
                    */
                    /*
                    Add a function that would notify the police.
                    */
                    
SendClientMessageToAll(0x00FF00FF,"[BREAKING NEWS] Bank is being robbed, do not come near the bank!");
                    
SendClientMessageToAll(0x0080FFFF"Alerting all POLICE to come at bank As Soon as possible!!!");
                    
SendClientMessageToAll(0x0080FFFF"Lahat ng police PUMUNTA sa BANK Ngayon din!!!");
                    
SendClientMessage(playerid0xFF0000FF"You are robbing the bank, the police has been notified!");
                    
SendClientMessage(playerid0x008000FF"You gotta stay 5 minutes before you get the moneys!!!");
                 } else return 
SendClientMessage(playeridCOLOR_WHITE"You are not in BANK SAFE!!");
        } else {
            
SendClientMessage(playeridCOLOR_WHITE"You can't rob the bank right now! Already rob or waiting for cool down");
        }
        return 
1;

PHP код:
public robtimer(playerid)
{
        new 
string[128];//We are defining a new string for the formatted message that we are displaying later on.
        
new cash random(2000000);
        
GivePlayerMoney(playeridcash);
        
/*
    With the fuction above 'new cash = random(200000);
        GivePlayerMoney(playerid, cash);' we give the player
    a random amount of money from $0 - $200,000
    */
    //Here below we use the string we defined above to format the message itself and display it to the player.
        
format(stringsizeof(string), "You have successfully robbed $%d from the bank!"cash);
        
SendClientMessage(playeridCOLOR_WHITEstring);
        
format(stringsizeof(string), "[BREAKING NEWS] The suspect %s has successfully rob the money bank"GetPlayerNameEx(playerid));
        
SendClientMessageToAll(0x008000FFstring);
        
SetPlayerWantedLevel(playerid6);
        
PlayerInfo[playerid][pWantedLevel] = 6;

It doesnt work at all.

Thanks in advance!
Reply
#4

It should work though... Or you're doing something wrong.
EDIT : It sets your wanted level and your wanted level player variable.
Reply
#5

I dunno why, lel

and yes i think it should be work :3
Reply
#6

Do you have a PlayerInfo enum with pWantedLevel in it ?
Reply
#7

Quote:
Originally Posted by rappy93
Посмотреть сообщение
Do you have a PlayerInfo enum with pWantedLevel in it ?
Yes, i have...
Reply
#8

Then post it here so we can see it.
Reply
#9

Quote:
Originally Posted by rappy93
Посмотреть сообщение
Then post it here so we can see it.
lol you dont trust me :3

Код:
enum pInfo
{
	pKey[129],
	pLevel,
	pAdmin,
	pAdminName[32],
	pBanAppealer,
	pGangMod,
	pDonator,
	pBanned,
	pPermaBanned,
	pDisabled,
	pIP[16],
	pReg,
 	pTut,
	pSex,
	pAge,
	pSkin,
	Float:pPos_x,
	Float:pPos_y,
	Float:pPos_z,
	Float:pPos_r,
	pConnectTime,
	pRespect,
	pNumber,
	pWarns,
	pGang,
	pFaction,
	pLeader,
	pRank,
	pJob,
	pJob2,
	gPupgrade,
	Float:pSarmor,
	pCash,
	pBank,
	pInsurance,
	pCrimes,
	pArrested,
	pWantedLevel,
	Float:pHealth,
	Float:pArmor,
	pPot,
	pCrack,
	pPackages,
	pCrates,
	pRadio,
	pRadioFreq,
	pPhoneBook,
	pDice,
	pCDPlayer,
	pMats,
	pRope,
	pCigar,
	pSprunk,
	pSpraycan,
	pHouse,
	pHouse2,
	pRenting,
	pInt,
	pVW,
	pJailed,
	pJailTime,
	pGuns[12],
	pAGuns[12],
	pPayCheck,
	pPayReady,
	pHospital,
	pDetSkill,
	pLawSkill,
	pSexSkill,
	pDrugsSkill,
	pSmugSkill,
	pArmsSkill,
	pMechSkill,
	pFishSkill,
	pBoxSkill,
	pTruckSkill,
	pCarSkill,
	//pCraftSkill,
	pLawyerTime,
	pLawyerFreeTime,
	pDrugsTime,
	pMechTime,
	pSexTime,
	pCarTime,
	pFishes,
	pBiggestFish,
	pLockCar, // non-saved
	pWeedObject,
	Float: pWeedPos[3],
	pWeedVW,
	pWeedInt,
	pWeedGrowth,
	pWSeeds,
	pWins,
	pLoses,
	pFightStyle,
	pScrewdriver,
	pSmslog,
	pWristwatch,
	pTire,
	pFirstaid,
	pRccam,
	pReceiver,
	pGPS,
	pSweep,
	pSweepLeft,
	pBugged,
	pVehicleKeys,
	pVehicleKeysFrom,
	pDuty,
	pCarLic,
	pFlyLic,
	pBoatLic,
	pFishLic,
	pGunLic,
	pDivision,
	pLiveBanned,
	pTicketTime,
	pHeadValue,
	pContractBy[32],
	pContractDetail[64],
	pC4,
	pC4Get,
	pC4Used,
	pBombs,
	pCHits,
	pFHits,
	pPrisonedBy[MAX_PLAYER_NAME],
	pPrisonReason[128],
	pAcceptReport,
	pTrashReport,
	pAccent,
	pNMute,
	pNMuteTotal,
	pADMute,
	pADMuteTotal,
	pRMuted,
	pRMutedTotal,
	pRMutedTime,
	pSpeedo,
	pGCMuted,
	pGCMutedTime,
	pCallsAccepted,
	pHelper,
	pPatientsDelivered,
	pTriageTime,
	pMarried,
	pMarriedTo[MAX_PLAYER_NAME],
	pKillLog0[128],
	pKillLog1[128],
	pKillLog2[128],
	pKillLog3[128],
	pKillLog4[128],
	pKillLog5[128],
	pKillLog6[128],
	pKillLog7[128],
	pKillLog8[128],
	pKillLog9[128],
	pFlag[128],
	pReferredBy[MAX_PLAYER_NAME],
	pTokens,
	pRefTokensOffline,
};
Reply
#10

Show me what erros pop up when you use these :
pawn Код:
SetPlayerWantedLevel(playerid, 3);
PlayerInfo[playerid][pWantedLevel] = 3;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)