Order Players on Jailtime With Function/Stock
#1

Hello all,

I am trying to make an order function for the players in jail.
Like the function
pawn Код:
GetPlayerTopJailTime(1);//Will return the player with highest jailtime
GetPlayerTopJailTime(2);//Will return the player with the second highest jailtime
Any idea how i can manage this?

Admigo
Reply
#2

Explain more
from what i notice you want the function or the stock to contain the jail time for the player
Reply
#3

Quote:
Originally Posted by DarkLored
Посмотреть сообщение
Explain more
from what i notice you want the function or the stock to contain the jail time for the player
What he means is that he wants to create a command for the highest jail time in the server for example.

Upon writing /highjtime
You will get the following:

#1 Rocky - 4985 seconds of jail time.
#2 Eddy - 3651 seconds of jail time.
#3 Stan - 1254 seconds of jail time.
#4 Harry - 651 seconds of jail time.
#5 Lewis 241 seconds of jail time.
Reply
#4

Then i dont have any idea how to make it
Reply
#5

Search for order by desc function.
Reply
#6

I would try to make top player with jail time like this:
Код:
new amount;
new player;
player = -1;
foreach(Player, i)
{
     if(pJailTime[i] > amount)
     player = i;
}
Reply
#7

Quote:
Originally Posted by dominik523
Посмотреть сообщение
I would try to make top player with jail time like this:
Код:
new amount;
new player;
player = -1;
foreach(Player, i)
{
     if(pJailTime[i] > amount)
     player = i;
}
I need the GetPlayerTopJailTime(1) code because i am using a different way of making menu's.
I hope someone has a solution to make this function/stock.

Quote:

Re: Order Players on Jailtime With Function/Stock
Citaat:
Oorspronkelijk geplaatst door DarkLored Bekijk bericht
Explain more
from what i notice you want the function or the stock to contain the jail time for the player
What he means is that he wants to create a command for the highest jail time in the server for example.

Upon writing /highjtime
You will get the following:

#1 Rocky - 4985 seconds of jail time.
#2 Eddy - 3651 seconds of jail time.
#3 Stan - 1254 seconds of jail time.
#4 Harry - 651 seconds of jail time.
#5 Lewis 241 seconds of jail time.

Thanks for your explanation.
Reply
#8

Bump
Reply
#9

Quote:
Originally Posted by Admigo
Посмотреть сообщение
Bump
I think I got a code in my mind, mind showing me your jail system? I would recommend putting it in a stock or a callback
Reply
#10

Quote:
Originally Posted by pds2k12
Посмотреть сообщение
I think I got a code in my mind, mind showing me your jail system? I would recommend putting it in a stock or a callback
I only use the variables:
Код:
IsJailed[playerid]=1;
JailTime[playerid]=60;//60 seconds in jail
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)