Esempio n. 1
0
 public static function CreateDraw()
 {
     $draw = TextDrawCreate(465.0, 385.0, '...');
     TextDrawUseBox($draw, 1);
     TextDrawBoxColor($draw, 0x99);
     TextDrawTextSize($draw, 633.0, 43.0);
     TextDrawAlignment($draw, 0);
     TextDrawBackgroundColor($draw, 0xff);
     TextDrawFont($draw, 3);
     TextDrawLetterSize($draw, 0.5999989999999999, 1.2);
     TextDrawColor($draw, 0xffffffff);
     TextDrawSetOutline($draw, 1);
     TextDrawSetProportional($draw, 1);
     return $draw;
 }
Esempio n. 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);
 }
Esempio n. 3
0
 private static function MakeUpgradeDraw(Player $player)
 {
     $draw = TextDrawCreate(222.0, 125.0, '...');
     if ($draw == INVALID_TEXT_DRAW) {
         return null;
     }
     TextDrawUseBox($draw, true);
     TextDrawBoxColor($draw, 0xbb);
     TextDrawTextSize($draw, 424.0, 20.0);
     TextDrawAlignment($draw, 0);
     TextDrawBackgroundColor($draw, 0xff);
     TextDrawFont($draw, true);
     TextDrawLetterSize($draw, 0.45, 1.76);
     TextDrawColor($draw, 0x495461dd);
     TextDrawSetOutline($draw, true);
     TextDrawSetProportional($draw, true);
     $str = 'Upgrade to level~n~';
     foreach (Players::$skills as $skill) {
         if ($skill->flag == SKILL_MAXUPGRADE) {
             break;
         }
         $nextlevel = $player->GetSkill($skill->flag) + 1;
         if ($skill->maxlevel < $nextlevel) {
             $str .= '~y~ Already highest level~n~';
         } else {
             if ($player->GetLevel() < $skill->reqlevels[$nextlevel]) {
                 $str .= "~r~ Player level {$skill->reqlevels[$nextlevel]} required~n~";
             } else {
                 if ($skill->reqskill != -1 && $player->GetSkill($skill->reqskill) < $skill->reqskill_level) {
                     $reqskill = Players::GetSkillName($skill->reqskill);
                     $str .= "~r~ {$reqskill} level {$skill->reqskill_level} required~n~";
                 } else {
                     $str .= "~w~ {$nextlevel} / {$skill->maxlevel}~n~";
                 }
             }
         }
     }
     TextDrawSetString($draw, $str);
     return $draw;
 }