even the odds mod can't compile. find my bugs please
try to rewirte my code, with a little help from sylwesters code.
try compile it but get some erros, please tell me the bugs. cs don't "load" my plugins i tryed to compile sylvesters version, but cs still won't load it, why not? PHP Code:
|
Re: even the odds mod can't compile. find my bugs please
You need to define 'get_max_players', use a var and save into 'get_maxplayers()', and gModIsOn = 1 shoud be ==.
Since you're new, this thread can be useful for you : http://forums.alliedmods.net/showthread.php?t=94381 and http://forums.alliedmods.net/showthread.php?t=91207 |
Re: even the odds mod can't compile. find my bugs please
thanks! i try it now, compile is done!
//after trying fail!!! my cs don't do my plugin!? think it don't load my plugin? why not!? |
Re: even the odds mod can't compile. find my bugs please
post your new one?
|
Re: even the odds mod can't compile. find my bugs please
okay, look at top for my new code.
|
Re: even the odds mod can't compile. find my bugs please
You don't have:
register_event("HLTV", "event_new_round","a", "1=0", "2=0") in plugin_init I think you'll need that :) |
Re: even the odds mod can't compile. find my bugs please
Even if he add this line, nothing will change since players are not spawned yet when new round is called.
I would do it like this: PHP Code:
|
Re: even the odds mod can't compile. find my bugs please
Sylwester - i think you're right... but the big problem is: if you just make the total answer, and don't tell very much i don't learn anything... so thanks for your answer, and it is really much more simple than mine. but i don't get any exp by this.
can you explain it? note: i want to change movement speed, not weapon speed. |
Re: even the odds mod can't compile. find my bugs please
Trying to write some random stuff won't work for you. You lack amxx basics, your "rewrite" does not even compile. Read tutorials and start with some more simple plugins. I recommend:
http://wiki.amxmodx.org/Introduction_to_Pawn http://wiki.amxmodx.org/Pawn_Tutorial Debugging Plugins http://wiki.amxmodx.org/Intro_to_AMX_Mod_X_Scripting Once you are done with tutorials read this (info about my code): Instead of using switch with many cases, it's better to store bonus values in arrays and create formula, so you can use it to retrieve proper bonus value for player in 1 line: Code:
bonus = some_array[formula_return_value]Code:
formula_return_value = (get_user_frags(player_id) - get_user_deaths(player_id))/5Code:
formula_return_value = 4 + (get_user_frags(player_id) - get_user_deaths(player_id))/5Now when you can properly get bonus value from array for any player, you can start thinking about setting player speed and health. You can set player health only when he is alive, so the best moment to do it is just after player has spawned. To detect that moment you need to hook player spawn (in other words tell plugin what is the name of the function that should be called when player was spawned). Trying to set player health on New Round is totally wrong because players are not spawned yet. Round Start is not the best because some players may spawn after Round Start has been called. You can find a lot info about these events and how to hook them here: http://forums.alliedmods.net/showthread.php?t=42159 About player max speed: It is reseted to weapon speed very often (example: when player switch weapon), so changing it only 1 time after player spawn will not work. To make sure that player speed will not change to default value, you must detect every max speed reset and change it back to value you want. To detect speed reset you need to hook CurWeapon event: Code:
register_event("CurWeapon", "reset_player_speed", "be", "1=1")Quote:
|
Re: even the odds mod can't compile. find my bugs please
thanks i would look at all your links!
i looked at your code, and under stand it a way better now. i tried to make the mod more simpel (look at the 2nd code at top). i have fixed some erroes. but there is still 2, cant find them. thanks sylwester. |
| All times are GMT -4. The time now is 15:36. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.