Pesquisa resultou em 1 ocorrência

por Such02
17 Jun 2019, 21:49
Fórum: GTA3script (CLEO)
Tópico: 17. Exercício #2
Respostas: 8
Exibições: 1169

Re: 17. Exercício #2

SpoilerAbrir

Código: Selecionar tudo

SCRIPT_START
{
LVAR_INT scplayer
LVAR_INT char ballas
LVAR_INT n

LVAR_FLOAT random_x random_y

GET_PLAYER_CHAR 0 scplayer

main_loop:
WAIT 0

IF GOSUB coords
    IF GOSUB model_chars
        GOSUB chars
    ENDIF
ENDIF

GOTO main_loop

coords:
LOCATE_CHAR_ANY_MEANS_3D scplayer (2490.0 -1670.0 13.0) (5.0 5.0 2.0) TRUE
RETURN

model_chars:
REQUEST_MODEL BALLAS1
REQUEST_MODEL BALLAS2
REQUEST_MODEL BALLAS3

WHILE NOT HAS_MODEL_LOADED BALLAS1
OR NOT HAS_MODEL_LOADED BALLAS2
OR NOT HAS_MODEL_LOADED BALLAS3
    WAIT 0
ENDWHILE
RETURN_TRUE

chars:
REPEAT 20 n
    GENERATE_RANDOM_FLOAT_IN_RANGE (2480.0, 2500.0) random_x
    GENERATE_RANDOM_FLOAT_IN_RANGE (-1680.0, -1660.0) random_y
    GENERATE_RANDOM_INT_IN_RANGE (102, 105) ballas
    CREATE_CHAR PEDTYPE_GANG1 ballas (random_x, random_y, 13.0) char
    CLEO_CALL SetupChar 0 (char)
    TASK_KILL_CHAR_ON_FOOT char scplayer
ENDREPEAT

MARK_MODEL_AS_NO_LONGER_NEEDED BALLAS1
MARK_MODEL_AS_NO_LONGER_NEEDED BALLAS2
MARK_MODEL_AS_NO_LONGER_NEEDED BALLAS3
RETURN_TRUE
}
SCRIPT_END

{
LVAR_INT char // In
LVAR_INT weapon

SetupChar:
REQUEST_MODEL MICRO_UZI
REQUEST_MODEL COLT45
REQUEST_MODEL AK47

GENERATE_RANDOM_INT_IN_RANGE 1 4 weapon

WHILE NOT HAS_MODEL_LOADED MICRO_UZI
OR NOT HAS_MODEL_LOADED AK47
OR NOT HAS_MODEL_LOADED COLT45
    WAIT 0
ENDWHILE

SWITCH weapon
    CASE 1
        GIVE_WEAPON_TO_CHAR char WEAPONTYPE_MICRO_UZI 999
        BREAK
    CASE 2
        GIVE_WEAPON_TO_CHAR char WEAPONTYPE_PISTOL 999
        BREAK
    CASE 3
        GIVE_WEAPON_TO_CHAR char WEAPONTYPE_AK47 999
        BREAK
ENDSWITCH

SET_CHAR_WEAPON_SKILL char 2
SET_CHAR_ACCURACY char 0

MARK_MODEL_AS_NO_LONGER_NEEDED AK47
MARK_MODEL_AS_NO_LONGER_NEEDED COLT45
MARK_MODEL_AS_NO_LONGER_NEEDED MICRO_UZI
CLEO_RETURN 0
}

👆  Ta ae.

Voltar para “17. Exercício #2”