Wanted level system?
#1

Hello All! I want searching a wanted level system.

Example:I kill 1 player and get 1 star wanted , 2 Player get 2 star wanted . kill 3 player , get 3 star wanted.
et cetera...........
Reply
#2

******.com is a great website to ****** things that should be ******d, just try and ******:
http://igify.net?search=gta%20samp%2...20filterscript
Reply
#3

I want when in imprisonment will lose stars, No must die.?
Reply
#4

easy bro, its a example :3

pawn Код:
new pWanted[MAX_PLAYERS];

stock SetPlayerWanted(playerid, level) //MAX WANTED CHANGE TO 2500 STARS :V
{
    if (level > 2500) level = 2500;
    if (level < 0) level = 0;
    pWanted[playerid] = level;
    SetPlayerWantedLevel(playerid, pWanted[playerid]);
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
       //------------[PLAYER SUICIDE]----------------
    if(killerid == INVALID_PLAYER_ID)
    {
        return SetPlayerWanted(playerid, 0);
    }
    //----------[PLAYER KILL PLAYER]------------

    SetPlayerWanted(playerid, 0);
    SetPlayerWanted(killerid, pWanted[playerid] + 1);
        ResetPlayerWeapons(playerid);

    return 1;
}
Reply
#5


how ?
when the death will appear in wanted??
Reply
#6

new string[128];
format(string, sizeof(string), "Current Wanted suspect: %d", pWanted[playerid]);
SendClientMessage(playerid, color, string);
Reply
#7

I Add to Gamemode.
Код HTML:
CMD:wanted(playerid, params[])
{
	if(IsACop(playerid) || PlayerInfo[playerid][pJob] == 2 || PlayerInfo[playerid][pJob2] == 2)
	{
		new string[128], x;

		SendClientMessageEx(playerid, COLOR_GREEN, "Current Wanted Suspects:");
		foreach(new i: Player)
		{
			if(PlayerInfo[i][pWantedLevel] >= 1)
			{
				format(string, sizeof(string), "%s%s: %d", string,GetPlayerNameEx(i),PlayerInfo[i][pWantedLevel]);
				x++;
				if(x > 3) {
					SendClientMessageEx(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] = '.';
			SendClientMessageEx(playerid, COLOR_YELLOW, string);
		}
	}
	else
	{
		SendClientMessageEx(playerid, COLOR_GREY, "   You're not a lawyer or a law enforcement officer!");
	}
	return 1;
}


Code LSPD
Reply
#8

change pWanted[playerid] ; to you variable PlayerInfo[playerid][pWantedLevel]
Reply
#9

Код HTML:
./includes/variables.pwn(7) : error 010: invalid function or declaration
./includes/callbacks.pwn(4238) : error 028: invalid subscript (not an array or too many subscripts): "pWantedLevel"
./includes/callbacks.pwn(4238) : warning 215: expression has no effect
./includes/callbacks.pwn(4238) : error 001: expected token: ";", but found "]"
./includes/callbacks.pwn(4238) : error 029: invalid expression, assumed zero
./includes/callbacks.pwn(4238) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
Код HTML:
//------------[PLAYER SUICIDE]----------------
	if(killerid == INVALID_PLAYER_ID)
	{
	    return SetPlayerWanted(playerid, 0);
	}
	//----------[PLAYER KILL PLAYER]------------

	SetPlayerWanted(playerid, 0);
	SetPlayerWanted(killerid, pWantedLevel[playerid] + 1);
    ResetPlayerWeapons(playerid);
Reply
#10

Quote:
Originally Posted by ongnung147
Посмотреть сообщение
Код HTML:
./includes/variables.pwn(7) : error 010: invalid function or declaration
./includes/callbacks.pwn(4238) : error 028: invalid subscript (not an array or too many subscripts): "pWantedLevel"
./includes/callbacks.pwn(4238) : warning 215: expression has no effect
./includes/callbacks.pwn(4238) : error 001: expected token: ";", but found "]"
./includes/callbacks.pwn(4238) : error 029: invalid expression, assumed zero
./includes/callbacks.pwn(4238) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
Код HTML:
//------------[PLAYER SUICIDE]----------------
	if(killerid == INVALID_PLAYER_ID)
	{
	    return SetPlayerWanted(playerid, 0);
	}
	//----------[PLAYER KILL PLAYER]------------

	SetPlayerWanted(playerid, 0);
	SetPlayerWanted(killerid, pWantedLevel[playerid] + 1);
    ResetPlayerWeapons(playerid);
Bro its PlayerInfo[playerid][pWantedLevel] you variable not pWantedLevel[playerid]

With you variable! use this!

pawn Код:
stock SetPlayerWanted(playerid, level) //MAX WANTED CHANGE TO 2500 STARS :V
{
    if (level > 2500) level = 2500;
    if (level < 0) level = 0;
    PlayerInfo[playerid][pWantedLevel] = level;
    SetPlayerWantedLevel(playerid, PlayerInfo[playerid][pWantedLevel]);
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
       //------------[PLAYER SUICIDE]----------------
    if(killerid == INVALID_PLAYER_ID)
    {
        return SetPlayerWanted(playerid, 0);
    }
    //----------[PLAYER KILL PLAYER]------------

    SetPlayerWanted(playerid, 0);
    SetPlayerWanted(killerid, PlayerInfo[playerid][pWantedLevel] + 1);
        ResetPlayerWeapons(playerid);

    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)