Jump to content

zunnu

New Members
  • Posts

    4
  • Joined

  • Last visited

zunnu's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. zunnu

    php voting

    And with the vote i mean is • Team B removes one of the 7 maps; • Team A removes one of the 6 remaining maps; • Team B removes one of the 5 remaining maps; • Team A removes one of the 4 remaining maps; • Team B removes one of the 3 remaining maps; • Team A picks the map to be played on; The last map remaining will be discarded. or Ban A - Ban B - Ban A - Ban B - Randomized map out of the three remaining Would that be possible?
  2. zunnu

    php voting

    Thanks alot for help! There isn't session in the ebot daemon because its not web page But i can store it in the ebot memory I replaced $_SESSION by $this but it didn't work or maybi i missed something. //define it if doesn't exist if (!$this['already_played']) { $this['already_played'] = array(); } $new_maps = array(); if ($message->getUserTeam() == "CT") { $team = ($this->side['team_a'] == "ct") ? $this->teamAName : $this->teamBName; $maps = \eBot\Config\Config::getInstance()->getMaps(); if (in_array($preg['mapname'], $maps) && !in_array($preg['mapname'], $this['already_played'])) { $this->playMap['ct'] = $preg['mapname']; $this->say($team . " (CT) \003Removed \004" . $preg['mapname']); //adding map into session $this['already_played'][] = $preg['mapname']; } else { $this->say($preg['mapname'] . " was not found! Available maps are:"); $new_maps = array_diff($maps, $this['already_played']); //maps in session removed from maps array //reset already played session when list is 1 or less if (count($new_maps) <= 1) { $this['already_played'] = array(); } foreach ($new_maps as $map) { $mapmessage .= "$map, "; } } $this->say(substr($mapmessage, 0, -2)); }
  3. zunnu

    php voting

    There is this kind of code that im changing. if ($message->getUserTeam() == "CT") { $team = ($this->side['team_a'] == "ct") ? $this->teamAName : $this->teamBName; $maps = \eBot\Config\Config::getInstance()->getMaps(); if (in_array($preg['mapname'], $maps)) { $this->playMap['ct'] = $preg['mapname']; $this->say($team . " (CT) \003Removed \004" . $preg['mapname']); } else { $this->say($preg['mapname'] . " was not found! Available maps are:"); foreach ($maps as $map) { $mapmessage .= "$map, "; } $this->say(substr($mapmessage, 0, -2)); if i change $this->playMap['ct'] = $preg['mapname']; to $this->unset['ct'] = $preg['mapname']; will that remove map and how can i set that it would be removed from listning too?
  4. Hello, I was wondering is it possible to create vote with php when people vote the voted thing will go away like for exsample if there is ingame map vote and players vote !map de_dust2 the de_dust2 will be removed from map list and the last map that stays will be used? Sorry for bad english.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.