Nono... I thought on using the pickup system, but there is one problem with how my command will work:
if I write sv_weapons 1 all weapons are available on the map suddenly (that works fine)
if I write sv_weapons 0 all weapons will be away (not shown, not "getable", they have to be deleted - the weapons)
I thought on entity cause I use the "on_entity" to insert them into the map... The admin can decide in his config if the weapons are loaded at start or not... and he can de/activate them every time in the current running round.
bool GAMECONTROLLER::on_entity(int index, vec2 pos)
{
int type = -1;
int subtype = 0;
...
else if(index == ENTITY_WEAPON_SHOTGUN)
{
type = POWERUP_WEAPON;
subtype = WEAPON_SHOTGUN;
if(round_start)
{
weapon_points[0][num_weapon_points[0]++] = pos;
}
}
else if(index == ENTITY_WEAPON_GRENADE)
{
type = POWERUP_WEAPON;
subtype = WEAPON_GRENADE;
if(round_start)
{
weapon_points[1][num_weapon_points[1]++] = pos;
}
}
else if(index == ENTITY_WEAPON_RIFLE)
{
type = POWERUP_WEAPON;
subtype = WEAPON_RIFLE;
if(round_start)
{
weapon_points[2][num_weapon_points[2]++] = pos;
}
}
....
if(type != -1)
{
if(weapon_off && subtype != 0)
{
return false;
}
PICKUP *pickup = new PICKUP(type, subtype);
pickup->pos = pos;
return true;
}
return false;
}
Cause I ask there for "ENTITY_WEAPON_SHOTGUN" etc. I thougth I have to remove them as entitys and there was "first_entity"... shame on me^^
But if I understand right it is that way meant?:
on the entity "ENTITY_WEAPON_SHOTGUN" (from the map itself, the tile in the editor is the "ENTITY") I say create a pickup which creates me this NETOBJTYPE? So the existing weapon in the game is a NETOBJTYPE and that what I set in the editor is the ENTITY on the map right?
Question: Is the pickup snap loaded every time? So if I write there a return false if a variable becomes true / false all weapons of that type could be "away"? If yes that would be great and a good solution. Anyway I try it this night and will tell you about what came out. I took a clearer look now and as I see it seems like the checks are running always.^^
Ps: Problem is not coding itself, I have to "come into" Teeworlds stuff... didn't coded a lot yet in Teeworlds, the entity / netobject stuff is one of the captures I still have to find out how they are correctly working
EDIT: Big shame on me... your solution is much much shorter and works perfect... thanks!
Avatar by Crises
Tee-Project - Website coming soon... [http://project.tee-city.net]