Find lowest number..
I need to know how to find the lowest number...
Lets say I have 1,2,3,4 and 5. How do I let the plugin find that 1 is the lowest number there? In my case, I got a variable that holds your points. How do I let the plugin find who gots the lowest number on that variable? Like if I have: Points = 10 And somebody else have: Points = 20 How do I let the plugin find out who that got the lowest number on the Points variable? Thanks... |
Code:
|
If you want to check everyone, you can modify this code that I use in my frequent fragger program
Code:
|
Quote:
Is val1 and val2 just examples or...? so can i have like: main(20,50,60) So will it return 20, since its the lowest number? But I want to check a variable that holds a number, and I want to check all players in the server. In my plugin, all people got a variable called PlayerPoints, that holds a number. How do I make it check all players, and return who that got lowest number on my PlayerPoints variable? Will it be like this? (I want to kick the guy with lowest playerpoints..) Code:
|
You could try something like:
Code:
Then, you could use: Code:
(untested) |
Umm...
That kind of code is the stuff I dont know much of yet. (Looping, array and all that stuff...) Could you write me an example that will check who got the lowest number on my "PlayerPoints[id]" variable? So I dont have edit it :P From Copy and paste - fan :P |
Copy & paste the function
Code:
In your code, use: Code:
|
PM: Check your PM :P
|
It's not hard to understand at all.. :|
|
| All times are GMT -4. The time now is 09:51. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.