Simply: needing 2 things into vars and dont get it!
Hello Guys,
I'll hope someone of the AMXMODX Heros can help me. Following, i'm learning amxmodx and at the moment i'm trying to get 2 vars out of a txt file, (mymaps.txt) Following is inside: Code:
mario_air "\minplayers\5\maxplayers\32\""\minplayers\5\maxplayers\32\" The Code-Part for it: (mapchooser like) Code:
new fp=fopen(filename,"r");Code:
stock bool:ValidMap(mapname[])mapname[len] contains the whole part of the line i hope, so how i can get these two numbers out of mapname[len]? I realy hope someone can helps me out! (Sorry for my broken english, ill do my best) //// ADDED: Aye..., may i should say what i want to "if" too... The first Number (minplayers) should go with if(get_playersnum() >= minplayers && maxplayers >= get_playersnum())... Like this! Greetings |
Re: Simply: needing 2 things into vars and dont get it!
That won't work even if you get those numbers from file and use them there, because settings are loaded only one time on plugin_init and at that time amount players connected to server equals 0.
Trying to load settings before each voting won't work either, because function that is supposed to clear array is somehow screwed (or at least it didn't work for me and voting after map extending was bugged because of it). I'm right now working on exactly same thing and I have already rewritten most of the code and added more features. |
Re: Simply: needing 2 things into vars and dont get it!
Uhm...
I think u dont understand me or my english is rly bad :D I know that with round start nothing happens! And these Numbers in de Map File are "static". The checking with the if comes at the "END OF MAP" and then inside the script the actual player amount will be calculated. So i just need to know how to figure the both numbers out... i tryd this but looks bad and not finish with this bold line Code:
new sandmen, minplayers=0, maxplayers=0; |
Re: Simply: needing 2 things into vars and dont get it!
Did you add checking at the "END OF MAP" yourself? Because original version does it at the beginning of the map.
I added checking for min and max players in a lot simpler way (just need to add "#min max" in maps file and maps in following lines will only be used iif ( min <= players amount <= max )): PHP Code:
Code:
#1 15 |
Re: Simply: needing 2 things into vars and dont get it!
nice that u wanna tell me some other ways, but please i must use it with this formation like i posted!
"\minplayers\5\maxplayers\32\" (bec. on some maps there are some more vars after these both, but i only need this both at the moment) Code:
if((sandmen = contain(mapname, "\maxplayers\")) != -12)if you can help me how i can get this, you will finish my problems! (for the moment ;)) ///ADDD And if i look at your code i notice that u try to make something totaly other :D But okay, thats not the problem, i think you know the answere for my little problem if you understand what i try to find out ;) thanks a lot |
Re: Simply: needing 2 things into vars and dont get it!
try this:
Code:
new minplayers, maxplayers, szTmp[32], szUseless[32], pos |
Re: Simply: needing 2 things into vars and dont get it!
Thanks a lot.
I will try it out and give a feedback about it soon. At the moment there are to many players on the server. |
Re: Simply: needing 2 things into vars and dont get it!
I solved the Problems and your Hints works great!
Also the first one i'm using now. But i have many new things to walk trough :p Thanks a lot... Greetings |
Re: Simply: needing 2 things into vars and dont get it!
Okay, i created a new thread for it with the complete code.
now its finish but some things are strange and at all its hardcoded... http://forums.alliedmods.net/showthread.php?p=1170139 this thread could be closed... thx greetings |
| All times are GMT -4. The time now is 03:49. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.