Most wanted Player
#1

I am making a MDC system and i want to use a button which will say who is the most wanted player at the moment inside game
How i could make it?
using loop? and then?
Reply
#2

You would call a Timer for the private player If he clicked it SetTimerEx but you will loop it in a circle every 5 minutes, this will reduce the lag you will receive, Upon it looping every 5 minutes, you will do this

For Example:

Quote:

Your Set Timer Here

forward TimerHere(playerid);
public TimerHere(playerid)
{
You will here check if all players are connected
{
You will now check what players are wanted
{
You will now check what player has the most wanted points
{
if a player has the most points you get his ID here
{
You format a textdraw setting here etc,
}
}
}
}
}

I didnt really understand what you meant, but I thought I would somewhat help you out
Reply
#3

so for example
pawn Код:
forward MaxWanted(playerid);

public MaxWanted(playerid)
{
    If(IsPlayerConnected(playerid)
     {
        if(GetPlayerWantedLevel(playerid) >= 4)
        {
             if(howtocheck who has the most??))  //<==========
             {
             //
               }
etc...
Reply
#4

pawn Код:
// List
new count = 0, msg [ 70 ];
for(new i=0; i<MAX_PLAYERS; i++){
    if(IsPlayerConnected(i) && GetPlayerWantedLevel(playerid) > 5){
        format(msg,sizeof(msg),"%d: %s : [Wanted Level: %i]", i,PlayerName(i),GetPlayerWantedLevel(i));
        SendClientMessage(playerid, -1, msg);
        count++;
    }
}
if(count == 0){
    SendClientMessage(playerid, -1, "No wanted players at this moment.");
}

//MostWanted
GetMostWantedPlayer()
{
    new highPlayerWantedLevel, player = INVALID_PLAYER_ID, wl;
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            wl = GetPlayerWantedLevel(i);
            if(wl > highPlayerWantedLevel)
            {
                highPlayerWantedLevel = wl, player = i;
            }
        }
    }
    return player;
}
Continue yourself.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)