Beispiel #1
0
 public static function Init()
 {
     echo ">>>> Setting SAMP globals, PHP settings and timers ...\n";
     SetGameModeText('ItalyMafia RPG v3.0');
     AllowInteriorWeapons(1);
     DisableInteriorEnterExits();
     EnableStuntBonusForAll(false);
     AllowAdminTeleport(true);
     AddTimer(array('Core', 'SaveData'), 10000, 1);
     ini_set('max_execution_time', 300);
     echo ">>>> Starting logs ...\n";
     Log::Init();
     echo ">>>> Starting the keybinds manager ...\n";
     Keybinds::Init();
     echo ">>>> Starting the menus manager ...\n";
     Menu::Init();
     echo ">>>> Starting the skins manager ...\n";
     Skins::Init();
     echo ">>>> Starting the animations manager ...\n";
     Animations::Init();
     echo ">>>> Starting locations ...\n";
     Locations::Init();
     echo ">>>> Starting DB engine ...\n";
     DB::Init();
     echo ">>>> Starting houses ...\n";
     Houses::Init();
     echo ">>>> Starting factions ...\n";
     Factions::Init();
     echo ">>>> Starting players manager ...\n";
     Players::Init();
     echo ">>>> Starting vehicles manager ...\n";
     Vehicles::Init();
     echo ">>>> Starting accounts manager ...\n";
     Accounts::Init();
     echo ">>>> Starting messages manager ...\n";
     Messages::Init();
     echo ">>>> Creating the clock ...\n";
     Core::StartClock();
     echo ">>>> Starting gyms ...\n";
     Gym::Init();
     echo ">>>> Starting admins ...\n";
     Admin::Init();
 }
Beispiel #2
0
 public static function Init()
 {
     /* Register callbacks */
     Callbacks::Instance()->Register(cOnPlayerKeyStateChange, null, array('Animations', 'OnPlayerKeyStateChange'));
     Callbacks::Instance()->Register(cOnPlayerText, null, array('Animations', 'OnPlayerText'), -10);
     /* Register commands */
     CommandHandler::Register('stopanim', 0, null, array('Animations', 'cmdStopanim'), '', 1);
     /*                         lib    anim              loop    movex   movey   continue  time  forced */
     $seat_up = new Animation('PED', 'seat_up', false, false, false, false, -1, false);
     $seat_idle = new Animation('PED', 'seat_idle', true, false, false, false, -1, false, -1, $seat_up);
     $seat_down = new Animation('PED', 'seat_down', false, false, false, false, 1350, false, 1200, $seat_up, $seat_idle);
     Animations::Register('seat', $seat_down);
     Animations::$seat_animation = $seat_idle;
     Animations::$stalk_animation = new Animation('MISC', 'seat_talk_01', false, false, false, false, 1800, false, 1600, $seat_up, $seat_idle);
     $drunkstop = new Animation('PED', 'walk_drunk', true, true, true, false, 100, false);
     $drunk = new Animation('PED', 'walk_drunk', true, true, true, true, 1, false, -1, $drunkstop);
     Animations::Register('drunk', $drunk);
     $fdrunkstop = new Animation('FOOD', 'eat_vomit_p', true, true, true, false, -1, true, 7200);
     $fdrunk = new Animation('PED', 'walk_drunk', true, true, true, true, 1, true, 5000, null, $fdrunkstop);
     Animations::Register('fdrunk', $fdrunk);
     $lay_up = new Animation('SUNBATHE', 'lay_bac_out', false, false, false, false, -1, false);
     $lay_idle = new Animation('BEACH', 'bather', true, false, false, false, -1, false, -1, $lay_up);
     $lay_down = new Animation('SUNBATHE', 'lay_bac_in', false, false, false, false, 2100, false, 2000, $lay_up, $lay_idle);
     Animations::Register('lay', $lay_down);
     /* Create the textdraw for stopping animations */
     Animations::$stopping_draw = TextDrawCreate(214.0, 421.0, 'Use ~r~~k~~PED_SPRINT~~w~ to stop the animation');
     TextDrawUseBox(Animations::$stopping_draw, 1);
     TextDrawBoxColor(Animations::$stopping_draw, 0x66);
     TextDrawTextSize(Animations::$stopping_draw, 460.0, 0.0);
     TextDrawAlignment(Animations::$stopping_draw, 0);
     TextDrawBackgroundColor(Animations::$stopping_draw, 0xff);
     TextDrawFont(Animations::$stopping_draw, 1);
     TextDrawLetterSize(Animations::$stopping_draw, 0.399999, 1.3);
     TextDrawColor(Animations::$stopping_draw, 0xffffffff);
     TextDrawSetOutline(Animations::$stopping_draw, 1);
     TextDrawSetProportional(Animations::$stopping_draw, 1);
     /* Create global animations */
     Animations::$death_animation = new Animation('WUZI', 'CS_Dead_Guy', true, false, false, false, -1, true);
 }
Beispiel #3
0
 public function ClearAnimations($stop_current = true)
 {
     if ($this->animation) {
         if ($stop_current) {
             if ($this->animation->stop) {
                 $this->animation = $this->animation->stop;
                 $this->ApplyAnimation();
             } else {
                 ClearAnimations($this->id);
             }
         }
         if ($this->animation->stop_cbk) {
             call_user_func($this->animation->stop_cbk, $this, $this->animation->stop_data);
         }
         if ($this->animation->forced == false) {
             $draw = Animations::GetStoppingDraw();
             TextDrawHideForPlayer($this->id, $draw);
         }
         $this->animation = null;
         if ($this->animtimer) {
             KillTimer($this->animtimer);
             $this->animtimer = null;
         }
     }
 }