» Home » Forums
  Register | Search | FAQ | Memberlist | Usergroups | Log in  

Reply to topic PHP unreal query
PHP unreal query
BETEP`


Joined: 31 Jul 2006
Posts: 1
Reply with quote
Hello,

I have a little question: is it possible to sort players by frags, or by team for example?

In another hand, is there any way to replace 'Team' value? Atm is '1' or '0' (that info you got from unreal server by default I guess) so can you introduce a variable in order to change it into 'Terrorists' and 'Special Forces' for example?


thank you
View user's profileFind all posts by BETEP`Send private message
ricky112


Joined: 17 Jul 2007
Posts: 2
Location: The Netherlands
Reply with quote
Hi,

To chance the team to text you can use the str_replace(); function.

Find:

<td width="<?=$typewidth;?>" bgcolor="<?=$rowcolor;?>">
<?=getiteminfo("team_" . $actualid,$chunks);?>
</td>

Replace with:

<td width="<?=$typewidth;?>" bgcolor="<?=$rowcolor;?>">
<?=str_replace(Array("0","1","255"), Array("Red", Blue", "Spec."), getiteminfo("team_" . $actualid,$chunks));?>
</td>


(dint test it.)


I hope this helped you Smile
View user's profileFind all posts by ricky112Send private messageMSN Messenger
Almar Joling
Site Admin

Joined: 07 Oct 2002
Posts: 87
Location: The Netherlands
Reply with quote
It would be possible to reorder the array by team id. I haven't tried it myself, now have the intention to (unless there is still interest in it)

If you first get all the player information and store it in a temporary array, you could probably find some multisort function on the PHP manual site to sort the array properly. It might be an hour work though.
View user's profileFind all posts by Almar JolingSend private messageSend e-mailVisit poster's website
 Reply to topic  

Powered by phpBB © phpBB Group. Design by phpBBStyles.com | Styles Database.