#include "mapvoting.qh"
+#include <server/defs.qh>
+#include <server/miscfunctions.qh>
#include "g_world.qh"
#include "command/cmd.qh"
#include "command/getreplies.qh"
void MapVote_ClearAllVotes()
{
- FOREACH_CLIENT(true, LAMBDA(it.mapvote = 0));
+ FOREACH_CLIENT(true, { it.mapvote = 0; });
}
void MapVote_UnzoneStrings()
{
for(int j = 0; j < mapvote_count; ++j)
{
- if ( mapvote_maps[j] )
- {
- strunzone(mapvote_maps[j]);
- mapvote_maps[j] = string_null;
- }
- if ( mapvote_maps_pakfile[j] )
- {
- strunzone(mapvote_maps_pakfile[j]);
- mapvote_maps_pakfile[j] = string_null;
- }
+ strfree(mapvote_maps[j]);
+ strfree(mapvote_maps_pakfile[j]);
}
}
GameLogEcho(strcat(":vote:suggestion_accepted:", mapvote_maps[mappos]));
}
- FOREACH_CLIENT(IS_REAL_CLIENT(it), LAMBDA(FixClientCvars(it)));
+ FOREACH_CLIENT(IS_REAL_CLIENT(it), { FixClientCvars(it); });
if(gametypevote)
{
return;
int totalvotes = 0;
- FOREACH_CLIENT(IS_REAL_CLIENT(it), LAMBDA(
+ FOREACH_CLIENT(IS_REAL_CLIENT(it), {
// hide scoreboard again
- if(it.health != 2342)
+ if(GetResourceAmount(it, RESOURCE_HEALTH) != 2342)
{
- it.health = 2342;
+ SetResourceAmountExplicit(it, RESOURCE_HEALTH, 2342);
CS(it).impulse = 0;
msg_entity = it;
if(it.mapvote)
++totalvotes;
- ));
+ });
MapVote_CheckRules_1(); // just count
}