Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. Gameplay
      2. Missions
      3. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. DLC
      2. Find Lobbies & Players
      3. Guides & Strategies
      4. Vehicles
      5. Content Creator
      6. Help & Support
    2. Grand Theft Auto Series

    3. GTA 6

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. News

    2. Forum Support

    3. Site Suggestions

Remca

Help me. Cleo

Recommended Posts

Remca

Hello. smile Cleo I have been studying recently. Decided to write a script in which the player will be served by the bartender.
The idea is when CJ walks into a bar then the 2nd bartender (left) should already be in the bar,waiting for CJ. If you go to the bartender standing on a red marker, the player will remove $ 15 and the bartender will begin to serve CJ, and placing an order in front of him (wine bottle ID 1509), CJ will drink it and the bottle will disappear. After that, CJ can move, and the screen will stagger, then darkening then enlightened, taking into account the slowdown of the game in 2 times - the effect of intoxication for a duration of 1 minute.  When the effect is over everything will return to normal - CJ sober.
Yes, I still have a lot of mistakes, but I do not know how to fix them all. rolleyes 
1st bug - though the script is cyclical, the model is loaded many times.
2nd bug - red marker in front of the bartender is not visible, although active.
3rd bug - associated with animations CJ, he just got up, you can not move it and immediately went effects of intoxication. But the bartender's animations are reproduced.

Please help me and show examples of fixed options 
 

{$CLEO}
0000:
while true //пока условие верное, скрипт будет работать
:1
wait 0
Model.Load(1509) //объявляем модель бутылки по id 1509
Model.Load(#VWFYCRP) //объявляем модель бармена
038B: load_requested_models //загружаем объявленные модели
:2
wait 0
if and//проверяем на загруженность 
Model.Available(1509) //бутылка загружена?
Model.Available(#VWFYCRP) //бармен загружен?  
jf @2 //если нет то возвращаемся к метке 2 и проверка будет происходить до тех пор пока объявленные модели не загрузятся
wait 100 //задержка в 100мс
Actor.Create([email protected],CIVFEMALE, #VWFYCRP, 500.3259, -77.7879, 998.7578) //создаём актора в данных координатах (бар грув-стрит). 
Object.Create([email protected],1509,0.0,0.0,0.0) //создаём бутылку
wait 100
Model.Destroy(1509)  //уничтожаем каждую модель 
Model.Destroy(#VWFYCRP) 
Actor.RemoveReferences([email protected]) //стираем сведения 
Object.RemoveReferences([email protected]) //чтобы не грузить память
wait 500
jump @2
 
 
wait 1000 //задержка в 0мс
if and //проверяем несколько условий
player.Defined(0) //игрок (cj) жив ?
not actor.Driving($PLAYER_ACTOR) //игрок не в машине ?
player.Money(0) > 14 //число игрока целое и больше 14 ?
0102:   actor $PLAYER_ACTOR in_sphere 500.3043 -75.8083 998.7578 radius 1.0 1.0 1.0 sphere 1 stopped_on_foot //когда игрок встанет на маркер 
then //тогда
player.Money(0) += -15  //с игрока снимут 15$ 
     
if
00FE:   actor $PLAYER_ACTOR in_sphere 500.3043 -75.8083 998.7578 radius 1.0 1.0 1.0 sphere 1//если игрок ещё стоит на маркере 
Player.CanMove([email protected]) = False //бармен никуда не уйдёт
//и обслужит игрока
0605: actor [email protected] perform_animation "BARSERVE_LOOP" IFP "BAR" framedelta 4.0 loop 1 lockX 0 lockY 0 lockF 0 time -1 //бармен смотрит по сторонам и ожидает клиентов
0605: actor [email protected] perform_animation "BARSERVE_ORDER" IFP "BAR" framedelta 4.0 loop 0 lockX 0 lockY 0 lockF 0 time 2000 //бармен на месте прислушался
wait 2000 
0605: actor [email protected] perform_animation "BARSERVE_BOTTLE" IFP "BAR" framedelta 4.0 loop 0 lockX 0 lockY 0 lockF 0 time 3000 //наклонился и достал бутылку
wait 3000 
0605: actor [email protected] perform_animation "BARSERVE_GIVE" IFP "BAR" framedelta 4.0 loop 0 lockX 0 lockY 0 lockF 0 time 3000 //бармен поставил перед игроком выпивку
070A: AS_actor $PLAYER_ACTOR attach_to_object [email protected] offset 0.05 0.06 0.05 on_bone 6 16 perform_animation "DRNKBR_PRTL" IFP "GANGS" time 15000
 
 
 
     
wait 1500
    [email protected] = 0
     
        repeat
        wait 0
            if
            not player.Defined(0)
            then
            [email protected] = 1 //Dead/arrested/not found flag
            end
        until not actor.Animation($PLAYER_ACTOR) == "DRNKBR_PRTL"
     
    04EF: release_animation "GANGS"
     
        if
        [email protected] == 0
        then
        015D: set_gamespeed 0.5 
        player.SetDrunkVisuals(0,50)
        object.Destroy([email protected])
        actor.DestroyInstantly([email protected]) - уничтожаем бармена
         
            while player.Defined(0)
            wait 0
            [email protected] = 0
                 
                repeat
                wait 0
                    if
                    not player.Defined(0)
                    then
                    break
                    end
                until [email protected] > 999
                 
            fade 0 1500
             
                repeat
                wait 0
                    if
                    not player.Defined(0)
                    then
                    break
                    end
                until not fading
                 
            fade 1 1500
             
                repeat
                wait 0
                    if
                    not player.Defined(0)
                    then
                    break
                    end
                until not fading                        
            end //while
         
        015D: set_gamespeed 1.0 
        player.SetDrunkVisuals(0,0)
        end
    end
end

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.