Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- forward Fish_TimerGetFish(playerid);
- public Fish_TimerGetFish(playerid) {
- if( player_fish[playerid][pFishStep][FISH_STEP_START] )
- {
- if( Fish_IsPlayerHaveCurrSonar(playerid, player_fish[playerid][pSonarItem]) )
- {
- if( --player_fish[playerid][pFishTimerCount] <= 0 )
- {
- static const
- swimmer_array[][][] = {
- { !"~l~~n~~g~!", !"~l~~w~~n~~g~!" },
- { !"~l~~n~~l~~n~~y~!", !"~l~~w~~n~~w~~l~~w~~n~~y~!" },
- { !"~l~~n~~l~~n~~l~~n~~r~!", !"~l~~w~~n~~l~~w~~n~~l~~w~~n~~r~!" }
- }
- ;
- new
- rand_text, rand_value,
- old_value, sonar, idx,
- curr_item;
- curr_item = player_fish[playerid][pSonarItem];
- old_value = player_fish[playerid][pSwimmerCheck];
- //sonar = floatround(player_fish[playerid][pSonar]);
- rand_text = random(sizeof swimmer_array);
- __skip_random:
- {
- // определяем макс.время задержки
- if( !curr_item )
- {
- idx = 4;
- }
- else
- {
- if( sonar <= 300 )
- idx = 7;
- else if( sonar > 300 && sonar <= 400 )
- idx = 5;
- else if( sonar > 400 && sonar <= 500 )
- idx = 3;
- }
- rand_value = random(idx);
- old_value = rand_text;
- }
- if( (old_value != -1 && old_value == rand_value) || rand_value == 0 ) {
- goto __skip_random;
- }
- GameTextForPlayer(playerid, swimmer_array[rand_text][curr_item ? 0 : 1], (rand_value * 1000) + 2000, 6);
- player_fish[playerid][pFishTimerCount] = rand_value;
- player_fish[playerid][pSwimmerCheck] = rand_value;
- player_fish[playerid][pSwimmerPoint] = rand_text + 1;
- }
- } else {
- // сонар < 0 -> показываем синий поплавок
- GameTextForPlayer(playerid, "~b~!", 3000, 6);
- }
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement