Ejemplo n.º 1
0
void main(void)
{
	while ( ++num_items < MAX_PAGES ) selection_mem[num_items] = 0;
	while ( !IS_PLAYER_SCRIPT_CONTROL_ON(GetPlayerIndex()) ) WAIT(1000);
	//TERMINATE_ALL_SCRIPTS_WITH_THIS_NAME("modmanager");
		
	while ( TRUE )
	{
		WAIT(0);
		SET_SLEEP_MODE_ACTIVE(TRUE);
		PRINT_MAIN_LOGO("GTA IV Mission Mod Pack v2.0", 0.30, 0.05);
		PRINT_DESC(0.28, 0.11, "Created by rodd1981 (c) www.facebook.com/gtamodz");
		MenuSetup();
		
		if (page != page_check ) 
		{
			SetupPage();
		}
		
		DrawPage();
		Nav();
		
		/*
		if (IS_GAME_KEYBOARD_KEY_JUST_PRESSED(KEY_F11))
		{
			TERMINATE_THIS_SCRIPT();
		}
		*/
	}
}
int main( int i_argc, char **ppsz_argv )
{
    char *client_socket_tmpl = "dvblastctl.clientsock.XXXXXX";
    char *psz_srv_socket = NULL;
    int i;
    char *p_cmd, *p_arg1 = NULL, *p_arg2 = NULL;
    ssize_t i_size;
    struct sockaddr_un sun_client, sun_server;
    uint8_t p_buffer[COMM_BUFFER_SIZE];
    uint8_t *p_data = p_buffer + COMM_HEADER_SIZE;
    uint16_t i_pid = 0;
    struct dvblastctl_option opt = { 0, 0, 0 };

    for ( ; ; )
    {
        int c;

        static const struct option long_options[] =
        {
            {"remote-socket", required_argument, NULL, 'r'},
            {"print", required_argument, NULL, 'x'},
            {"help", no_argument, NULL, 'h'},
            {0, 0, 0, 0}
        };

        if ( (c = getopt_long(i_argc, ppsz_argv, "r:x:h", long_options, NULL)) == -1 )
            break;

        switch ( c )
        {
        case 'r':
            psz_srv_socket = optarg;
            break;

        case 'x':
            if ( !strcmp(optarg, "text") )
                i_print_type = PRINT_TEXT;
            else if ( !strcmp(optarg, "xml") )
                i_print_type = PRINT_XML;
            else
                msg_Warn( NULL, "unrecognized print type %s", optarg );
            /* Make stdout line-buffered */
            setvbuf(stdout, NULL, _IOLBF, 0);
            break;

        case 'h':
        default:
            usage();
        }
    }

    /* Validate commands */
#define usage_error(msg, ...) \
        do { \
            msg_Err( NULL, msg, ##__VA_ARGS__ ); \
            usage(); \
        } while(0)
    p_cmd  = ppsz_argv[optind];
    p_arg1 = ppsz_argv[optind + 1];
    p_arg2 = ppsz_argv[optind + 2];

    if ( !psz_srv_socket )
        usage_error( "Remote socket is not set.\n" );

    if ( !p_cmd )
       usage_error( "Command is not set.\n" );

    i = 0;
    do {
        if ( streq(ppsz_argv[optind], options[i].opt) )
        {
            opt = options[i];
            break;
        }
    } while ( options[++i].opt );

    if ( !opt.opt )
        usage_error( "Unknown command: %s\n", p_cmd );

    if ( opt.nparams == 1 && !p_arg1 )
        usage_error( "%s option needs parameter.\n", opt.opt );

    if ( opt.nparams == 2 && (!p_arg1 || !p_arg2) )
        usage_error( "%s option needs two parameters.\n", opt.opt );
#undef usage_error

    /* Create client socket name */
    char *tmpdir = getenv("TMPDIR");
    snprintf( psz_client_socket, PATH_MAX - 1, "%s/%s",
       tmpdir ? tmpdir : "/tmp", client_socket_tmpl );
    psz_client_socket[PATH_MAX - 1] = '\0';

    int tmp_fd = mkstemp(psz_client_socket);
    if ( tmp_fd > -1 ) {
        close(tmp_fd);
        unlink(psz_client_socket);
    } else {
        return_error( "Cannot build UNIX socket %s (%s)", psz_client_socket, strerror(errno) );
    }

    if ( (i_fd = socket( AF_UNIX, SOCK_DGRAM, 0 )) < 0 )
        return_error( "Cannot create UNIX socket (%s)", strerror(errno) );

    i = COMM_MAX_MSG_CHUNK;
    setsockopt( i_fd, SOL_SOCKET, SO_RCVBUF, &i, sizeof(i) );

    memset( &sun_client, 0, sizeof(sun_client) );
    sun_client.sun_family = AF_UNIX;
    strncpy( sun_client.sun_path, psz_client_socket,
             sizeof(sun_client.sun_path) );
    sun_client.sun_path[sizeof(sun_client.sun_path) - 1] = '\0';

    if ( bind( i_fd, (struct sockaddr *)&sun_client,
               SUN_LEN(&sun_client) ) < 0 )
        return_error( "Cannot bind (%s)", strerror(errno) );

    memset( &sun_server, 0, sizeof(sun_server) );
    sun_server.sun_family = AF_UNIX;
    strncpy( sun_server.sun_path, psz_srv_socket, sizeof(sun_server.sun_path) );
    sun_server.sun_path[sizeof(sun_server.sun_path) - 1] = '\0';

    p_buffer[0] = COMM_HEADER_MAGIC;
    p_buffer[1] = opt.cmd;
    memset( p_buffer + 2, 0, COMM_HEADER_SIZE - 2 );
    i_size = COMM_HEADER_SIZE;

    /* Handle commands that send parameters */
    switch ( opt.cmd )
    {
    case CMD_INVALID:
    case CMD_RELOAD:
    case CMD_SHUTDOWN:
    case CMD_FRONTEND_STATUS:
    case CMD_MMI_STATUS:
    case CMD_GET_PAT:
    case CMD_GET_CAT:
    case CMD_GET_NIT:
    case CMD_GET_SDT:
    case CMD_GET_PIDS:
        /* These commands need no special handling because they have no parameters */
        break;
    case CMD_GET_PMT:
    {
        uint16_t i_sid = atoi(p_arg1);
        i_size = COMM_HEADER_SIZE + 2;
        p_data[0] = (uint8_t)((i_sid >> 8) & 0xff);
        p_data[1] = (uint8_t)(i_sid & 0xff);
        break;
    }
    case CMD_GET_PID:
    {
        i_pid = (uint16_t)atoi(p_arg1);
        i_size = COMM_HEADER_SIZE + 2;
        p_data[0] = (uint8_t)((i_pid >> 8) & 0xff);
        p_data[1] = (uint8_t)(i_pid & 0xff);
        break;
    }
    case CMD_MMI_SEND_TEXT:
    {
        struct cmd_mmi_send *p_cmd = (struct cmd_mmi_send *)p_data;
        p_cmd->i_slot = atoi(p_arg1);

        en50221_mmi_object_t object;
        object.i_object_type = EN50221_MMI_ANSW;
        if ( !p_arg2 || p_arg2[0] == '\0' )
        {
             object.u.answ.b_ok = 0;
             object.u.answ.psz_answ = "";
        }
        else
        {
             object.u.answ.b_ok = 1;
             object.u.answ.psz_answ = p_arg2;
        }
        i_size = COMM_BUFFER_SIZE - COMM_HEADER_SIZE
                  - ((void *)&p_cmd->object - (void *)p_cmd);
        if ( en50221_SerializeMMIObject( (uint8_t *)&p_cmd->object,
                                         &i_size, &object ) == -1 )
            return_error( "Comm buffer is too small" );

        i_size += COMM_HEADER_SIZE
                   + ((void *)&p_cmd->object - (void *)p_cmd);
        break;
    }
    case CMD_MMI_SEND_CHOICE:
    {
        struct cmd_mmi_send *p_cmd = (struct cmd_mmi_send *)p_data;
        p_cmd->i_slot = atoi(p_arg1);

        i_size = COMM_HEADER_SIZE + sizeof(struct cmd_mmi_send);
        p_cmd->object.i_object_type = EN50221_MMI_MENU_ANSW;
        p_cmd->object.u.menu_answ.i_choice = atoi(p_arg2);
        break;
    }
    case CMD_MMI_SLOT_STATUS:
    case CMD_MMI_OPEN:
    case CMD_MMI_CLOSE:
    case CMD_MMI_RECV:
    {
        p_data[0] = atoi(p_arg1);
        i_size = COMM_HEADER_SIZE + 1;
        break;
    }
    default:
        /* This should not happen */
        return_error( "Unhandled option (%d)", opt.cmd );
    }

    /* Send command and receive answer */
    if ( sendto( i_fd, p_buffer, i_size, 0, (struct sockaddr *)&sun_server,
                 SUN_LEN(&sun_server) ) < 0 )
        return_error( "Cannot send comm socket (%s)", strerror(errno) );

    uint32_t i_packet_size = 0, i_received = 0;
    do {
        i_size = recv( i_fd, p_buffer + i_received, COMM_MAX_MSG_CHUNK, 0 );
        if ( i_size == -1 )
            break;
        if ( !i_packet_size ) {
            uint32_t *p_packet_size = (uint32_t *)&p_buffer[4];
            i_packet_size = *p_packet_size;
            if ( i_packet_size > COMM_BUFFER_SIZE ) {
                i_size = -1;
                break;
            }
        }
        i_received += i_size;
    } while ( i_received < i_packet_size );

    clean_client_socket();
    if ( i_size < COMM_HEADER_SIZE )
        return_error( "Cannot recv from comm socket, size:%zd (%s)", i_size, strerror(errno) );

    /* Process answer */
    if ( p_buffer[0] != COMM_HEADER_MAGIC )
        return_error( "Wrong protocol version 0x%x", p_buffer[0] );

    now = mdate();

    ctl_cmd_answer_t c_answer = p_buffer[1];
    switch ( c_answer )
    {
    case RET_OK:
        break;

    case RET_MMI_WAIT:
        exit(252);
        break;

    case RET_ERR:
        return_error( "Request failed" );
        break;

    case RET_HUH:
        return_error( "Internal error" );
        break;

    case RET_NODATA:
        return_error( "No data" );
        break;

    case RET_PAT:
    case RET_CAT:
    case RET_NIT:
    case RET_SDT:
    {
        uint8_t *p_flat_data = p_buffer + COMM_HEADER_SIZE;
        unsigned int i_flat_data_size = i_size - COMM_HEADER_SIZE;
        uint8_t **pp_sections = psi_unpack_sections( p_flat_data, i_flat_data_size );

        switch( c_answer )
        {
            case RET_PAT: pat_table_print( pp_sections, psi_print, NULL, i_print_type ); break;
            case RET_CAT: cat_table_print( pp_sections, psi_print, NULL, i_print_type ); break;
            case RET_NIT: nit_table_print( pp_sections, psi_print, NULL, psi_iconv, NULL, i_print_type ); break;
            case RET_SDT: sdt_table_print( pp_sections, psi_print, NULL, psi_iconv, NULL, i_print_type ); break;
            default: break; /* Can't happen */
        }

        psi_table_free( pp_sections );
        free( pp_sections );
        break;
    }

    case RET_PMT:
    {
        pmt_print( p_data, psi_print, NULL, psi_iconv, NULL, i_print_type );
        break;
    }

    case RET_PID:
    {
        print_pids_header();
        print_pid( i_pid, (ts_pid_info_t *)p_data );
        print_pids_footer();
        break;
    }

    case RET_PIDS:
    {
        print_pids( p_data );
        break;
    }

    case RET_FRONTEND_STATUS:
    {
        int ret = 1;
        struct ret_frontend_status *p_ret =
            (struct ret_frontend_status *)&p_buffer[COMM_HEADER_SIZE];
        if ( i_size != COMM_HEADER_SIZE + sizeof(struct ret_frontend_status) )
            return_error( "Bad frontend status" );

        if ( i_print_type == PRINT_XML )
            printf("<FRONTEND>\n");

#define PRINT_TYPE( x ) \
    do { \
        if ( i_print_type == PRINT_XML ) \
            printf( " <TYPE type=\"%s\"/>\n", STRINGIFY(x) ); \
        else \
            printf( "type: %s\n", STRINGIFY(x) ); \
    } while(0)
        switch ( p_ret->info.type )
        {
        case FE_QPSK: PRINT_TYPE(QPSK); break;
        case FE_QAM : PRINT_TYPE(QAM); break;
        case FE_OFDM: PRINT_TYPE(OFDM); break;
        case FE_ATSC: PRINT_TYPE(ATSC); break;
        default     : PRINT_TYPE(UNKNOWN); break;
        }
#undef PRINT_TYPE

#define PRINT_INFO( x ) \
    do { \
        if ( i_print_type == PRINT_XML ) \
            printf( " <SETTING %s=\"%u\"/>\n", STRINGIFY(x), p_ret->info.x ); \
        else \
            printf( "%s: %u\n", STRINGIFY(x), p_ret->info.x ); \
    } while(0)
        PRINT_INFO( frequency_min );
        PRINT_INFO( frequency_max );
        PRINT_INFO( frequency_stepsize );
        PRINT_INFO( frequency_tolerance );
        PRINT_INFO( symbol_rate_min );
        PRINT_INFO( symbol_rate_max );
        PRINT_INFO( symbol_rate_tolerance );
        PRINT_INFO( notifier_delay );
#undef PRINT_INFO

        if ( i_print_type == PRINT_TEXT )
            printf("\ncapability list:\n");

#define PRINT_CAPS( x ) \
    do { \
        if ( p_ret->info.caps & (FE_##x) ) { \
            if ( i_print_type == PRINT_XML ) { \
                printf( " <CAPABILITY %s=\"1\"/>\n", STRINGIFY(x) ); \
            } else { \
                printf( "%s\n", STRINGIFY(x) ); \
            } \
        } \
    } while(0)
        PRINT_CAPS( IS_STUPID );
        PRINT_CAPS( CAN_INVERSION_AUTO );
        PRINT_CAPS( CAN_FEC_1_2 );
        PRINT_CAPS( CAN_FEC_2_3 );
        PRINT_CAPS( CAN_FEC_3_4 );
        PRINT_CAPS( CAN_FEC_4_5 );
        PRINT_CAPS( CAN_FEC_5_6 );
        PRINT_CAPS( CAN_FEC_6_7 );
        PRINT_CAPS( CAN_FEC_7_8 );
        PRINT_CAPS( CAN_FEC_8_9 );
        PRINT_CAPS( CAN_FEC_AUTO );
        PRINT_CAPS( CAN_QPSK );
        PRINT_CAPS( CAN_QAM_16 );
        PRINT_CAPS( CAN_QAM_32 );
        PRINT_CAPS( CAN_QAM_64 );
        PRINT_CAPS( CAN_QAM_128 );
        PRINT_CAPS( CAN_QAM_256 );
        PRINT_CAPS( CAN_QAM_AUTO );
        PRINT_CAPS( CAN_TRANSMISSION_MODE_AUTO );
        PRINT_CAPS( CAN_BANDWIDTH_AUTO );
        PRINT_CAPS( CAN_GUARD_INTERVAL_AUTO );
        PRINT_CAPS( CAN_HIERARCHY_AUTO );
        PRINT_CAPS( CAN_MUTE_TS );

#define DVBAPI_VERSION ((DVB_API_VERSION)*100+(DVB_API_VERSION_MINOR))

#if DVBAPI_VERSION >= 301
        PRINT_CAPS( CAN_8VSB );
        PRINT_CAPS( CAN_16VSB );
        PRINT_CAPS( NEEDS_BENDING );
        PRINT_CAPS( CAN_RECOVER );
#endif
#if DVBAPI_VERSION >= 500
        PRINT_CAPS( HAS_EXTENDED_CAPS );
#endif
#if DVBAPI_VERSION >= 501
        PRINT_CAPS( CAN_2G_MODULATION );
#endif
#undef PRINT_CAPS

        if ( i_print_type == PRINT_TEXT )
            printf("\nstatus:\n");

#define PRINT_STATUS( x ) \
    do { \
        if ( p_ret->i_status & (FE_##x) ) { \
            if ( i_print_type == PRINT_XML ) { \
                printf( " <STATUS status=\"%s\"/>\n", STRINGIFY(x) ); \
            } else { \
                printf( "%s\n", STRINGIFY(x) ); \
            } \
        } \
    } while(0)
        PRINT_STATUS( HAS_SIGNAL );
        PRINT_STATUS( HAS_CARRIER );
        PRINT_STATUS( HAS_VITERBI );
        PRINT_STATUS( HAS_SYNC );
        PRINT_STATUS( HAS_LOCK );
        PRINT_STATUS( REINIT );
#undef PRINT_STATUS

        if ( p_ret->i_status & FE_HAS_LOCK )
        {
            if ( i_print_type == PRINT_XML )
            {
                printf(" <VALUE bit_error_rate=\"%d\"/>\n", p_ret->i_ber);
                printf(" <VALUE signal_strength=\"%d\"/>\n", p_ret->i_strength);
                printf(" <VALUE SNR=\"%d\"/>\n", p_ret->i_snr);
            } else {
                printf("\nBit error rate: %d\n", p_ret->i_ber);
                printf("Signal strength: %d\n", p_ret->i_strength);
                printf("SNR: %d\n", p_ret->i_snr);
            }
            ret = 0;
        }

        if ( i_print_type == PRINT_XML )
            printf("</FRONTEND>\n" );

        exit(ret);
        break;
    }

    case RET_MMI_STATUS:
    {
        struct ret_mmi_status *p_ret =
            (struct ret_mmi_status *)&p_buffer[COMM_HEADER_SIZE];
        if ( i_size != COMM_HEADER_SIZE + sizeof(struct ret_mmi_status) )
            return_error( "Bad MMI status" );

        printf("CA interface with %d %s, type:\n", p_ret->caps.slot_num,
               p_ret->caps.slot_num == 1 ? "slot" : "slots");
#define PRINT_CAPS( x, s )                                              \
        if ( p_ret->caps.slot_type & (CA_##x) )                         \
            printf(s "\n");
        PRINT_CAPS( CI, "CI high level interface" );
        PRINT_CAPS( CI_LINK, "CI link layer level interface" );
        PRINT_CAPS( CI_PHYS, "CI physical layer level interface (not supported)" );
        PRINT_CAPS( DESCR, "built-in descrambler" );
        PRINT_CAPS( SC, "simple smartcard interface" );
#undef PRINT_CAPS

        printf("\n%d available %s\n", p_ret->caps.descr_num,
            p_ret->caps.descr_num == 1 ? "descrambler (key)" :
                                         "descramblers (keys)");
#define PRINT_DESC( x )                                                 \
        if ( p_ret->caps.descr_type & (CA_##x) )                        \
            printf( STRINGIFY(x) "\n" );
        PRINT_DESC( ECD );
        PRINT_DESC( NDS );
        PRINT_DESC( DSS );
#undef PRINT_DESC

        exit( p_ret->caps.slot_num );
        break;
    }

    case RET_MMI_SLOT_STATUS:
    {
        struct ret_mmi_slot_status *p_ret =
            (struct ret_mmi_slot_status *)&p_buffer[COMM_HEADER_SIZE];
        if ( i_size < COMM_HEADER_SIZE + sizeof(struct ret_mmi_slot_status) )
            return_error( "Bad MMI slot status" );

        printf("CA slot #%u: ", p_ret->sinfo.num);

#define PRINT_TYPE( x, s )                                                  \
        if ( p_ret->sinfo.type & (CA_##x) )                                 \
            printf(s);

        PRINT_TYPE( CI, "high level, " );
        PRINT_TYPE( CI_LINK, "link layer level, " );
        PRINT_TYPE( CI_PHYS, "physical layer level, " );
#undef PRINT_TYPE

        if ( p_ret->sinfo.flags & CA_CI_MODULE_READY )
        {
            printf("module present and ready\n");
            exit(0);
        }

        if ( p_ret->sinfo.flags & CA_CI_MODULE_PRESENT )
            printf("module present, not ready\n");
        else
            printf("module not present\n");

        exit(1);
        break;
    }

    case RET_MMI_RECV:
    {
        struct ret_mmi_recv *p_ret =
            (struct ret_mmi_recv *)&p_buffer[COMM_HEADER_SIZE];
        if ( i_size < COMM_HEADER_SIZE + sizeof(struct ret_mmi_recv) )
            return_error( "Bad MMI recv" );

        en50221_UnserializeMMIObject( &p_ret->object, i_size
          - COMM_HEADER_SIZE - ((void *)&p_ret->object - (void *)p_ret) );

        switch ( p_ret->object.i_object_type )
        {
        case EN50221_MMI_ENQ:
            printf("%s\n", p_ret->object.u.enq.psz_text);
            printf("(empty to cancel)\n");
            exit(p_ret->object.u.enq.b_blind ? 253 : 254);
            break;

        case EN50221_MMI_MENU:
            printf("%s\n", p_ret->object.u.menu.psz_title);
            printf("%s\n", p_ret->object.u.menu.psz_subtitle);
            printf("0 - Cancel\n");
            for ( i = 0; i < p_ret->object.u.menu.i_choices; i++ )
                printf("%d - %s\n", i + 1,
                       p_ret->object.u.menu.ppsz_choices[i]);
            printf("%s\n", p_ret->object.u.menu.psz_bottom);
            exit(p_ret->object.u.menu.i_choices);
            break;

        case EN50221_MMI_LIST:
            printf("%s\n", p_ret->object.u.menu.psz_title);
            printf("%s\n", p_ret->object.u.menu.psz_subtitle);
            for ( i = 0; i < p_ret->object.u.menu.i_choices; i++ )
                printf("%s\n", p_ret->object.u.menu.ppsz_choices[i]);
            printf("%s\n", p_ret->object.u.menu.psz_bottom);
            printf("(0 to cancel)\n");
            exit(0);
            break;

        default:
            return_error( "Unknown MMI object" );
            break;
        }

        exit(255);
        break;
    }

    default:
        return_error( "Unknown command answer: %u", c_answer );
    }

    return 0;
}
Ejemplo n.º 3
0
void main(void)
{
	TERMINATE_ALL_SCRIPTS_WITH_THIS_NAME("scriptmgr");
	ADD_ARMOUR_TO_CHAR(GetPlayerPed(), 100);
	CLEAR_ZONE(414.907, 28.0238, 8.79453, 200.0);
	SET_THIS_SCRIPT_CAN_REMOVE_BLIPS_CREATED_BY_ANY_SCRIPT(1);
	INIT_SETTINGS(420.828, 28.8978, 8.78683, 100.0);
	while ( ++num_items < MAX_PAGES ) selection_mem[num_items] = 0;
	while ( !IS_PLAYER_SCRIPT_CONTROL_ON(GetPlayerIndex()) ) WAIT(1000);
	
    while (TRUE)
    {
		WAIT(0);
		GET_CHAR_COORDINATES(GetPlayerPed(), &px, &py, &pz);
		GET_CHAR_HEADING(GetPlayerPed(), &ph);
		
		if(objrc == 0)
		{
			DRAW_MENU();
			PRINT_MAIN_LOGO(0.43, 0.05, "Lost MC RIP");
			PRINT_DESC(0.35, 0.11, "Recreation of GTA V Online mission \"Lost MC RIP\"");
			//PRINT_DESC(0.20, 0.13, "Test1");
			//PRINT_DESC(0.20, 0.15, "Test2");
		}
		
		if(objrc > objstart && objrc != objend)
		{
			PRINT_LIVES();
			POLICE(0, 0);
			MANAGE_PLAYER();
			MANAGE_ACTORS(14);
			ALTER_WANTED_LEVEL(GetPlayerIndex(), 0);	
		}
	
		if(objrc == 1)
		{
			UNLOCK_FRONTEND_DISPLAYS();
			APPLY_SELECTED_OPTIONS(level, weather, time);
			CLEAR_ZONE(480.671, 330.929, 8.57156, 50.0);
			SPAWN_VEHICLE(0, vehmodel,  BLIP_COLOR_WHITE, 414.907, 28.0238, 8.79453, 10.0, 25000, 0);
			SPAWN_VEHICLE(1, MODEL_HELLFURY, NOBLIP,  480.671, 330.929, 8.57156, 287.0, vhealth, 1);
			SPAWN_VEHICLE(2, MODEL_HELLFURY, NOBLIP,  500.989, 331.218, 8.57157, 287.0, vhealth, 1);
			SPAWN_VEHICLE(3, MODEL_HELLFURY, NOBLIP,  462.637, 342.84,  8.57144, 287.0, vhealth, 1);
			SPAWN_VEHICLE(4, MODEL_HELLFURY, NOBLIP,  456.194, 328.523, 8.57156, 287.0, vhealth, 1);
			SPAWN_VEHICLE(5, MODEL_ROMERO,   NOBLIP,  469.083, 341.918, 8.57143,   0.0, vhealth, 1);
			SPAWN_ACTOR(0,   MODEL_M_M_GBIK_LO_03, WEAPON_M4,  BLIP_COLOR_RED, accuracy, ehealth, armour, 0, 477.765, 330.598, 8.57155, 0.0, 0);
			SPAWN_ACTOR(1,   MODEL_M_Y_GBIK_HI_01, WEAPON_M4,  BLIP_COLOR_RED, accuracy, ehealth, armour, 0, 487.11,  332.822, 8.58402, 0.0, 0);
			SPAWN_ACTOR(2,   MODEL_M_Y_GBIK_HI_02, WEAPON_M4,  BLIP_COLOR_RED, accuracy, ehealth, armour, 0, 462.72,  329.053, 8.57155, 0.0, 0);
			SPAWN_ACTOR(3,   MODEL_M_Y_GBIK_LO_01, WEAPON_M4,  BLIP_COLOR_RED, accuracy, ehealth, armour, 0, 455.702, 331.683, 8.57326, 0.0, 0);
			SPAWN_ACTOR(4,   MODEL_M_Y_GBIK_LO_02, WEAPON_M4,  BLIP_COLOR_RED, accuracy, ehealth, armour, 0, 453.886, 342.619, 8.57142, 0.0, 0);
			SPAWN_ACTOR(5,   MODEL_M_M_GBIK_LO_03, WEAPON_M4,  BLIP_COLOR_RED, accuracy, ehealth, armour, 0, 455.879, 353.054, 8.57143, 0.0, 0);
			SPAWN_ACTOR(6,   MODEL_M_Y_GBIK_HI_01, WEAPON_M4,  BLIP_COLOR_RED, accuracy, ehealth, armour, 0, 461.334, 354.282, 8.55088, 0.0, 0);
			SPAWN_ACTOR(7,   MODEL_M_Y_GBIK_HI_02, WEAPON_M4,  BLIP_COLOR_RED, accuracy, ehealth, armour, 0, 452.701, 350.135, 8.57144, 0.0, 0);
			SPAWN_ACTOR(8,   MODEL_M_Y_GBIK_LO_01, WEAPON_M4,  BLIP_COLOR_RED, accuracy, ehealth, armour, 0, 475.867, 352.833, 8.57144, 0.0, 0);
			SPAWN_ACTOR(9,   MODEL_M_Y_GBIK_LO_02, WEAPON_M4,  BLIP_COLOR_RED, accuracy, ehealth, armour, 0, 485.464, 355.757, 8.57232, 0.0, 0);
			SPAWN_ACTOR(10,  MODEL_M_M_GBIK_LO_03, WEAPON_M4,  BLIP_COLOR_RED, accuracy, ehealth, armour, 0, 494.51,  355.139, 8.57158, 0.0, 0);
			SPAWN_ACTOR(11,  MODEL_M_Y_GBIK_HI_01, WEAPON_M4,  BLIP_COLOR_RED, accuracy, ehealth, armour, 0, 501.969, 343.139, 8.57158, 0.0, 0);
			SPAWN_ACTOR(12,  MODEL_M_Y_GBIK_HI_02, WEAPON_M4,  BLIP_COLOR_RED, accuracy, ehealth, armour, 0, 510.718, 339.741, 8.57158, 0.0, 0);
			SPAWN_ACTOR(13,  MODEL_M_Y_GBIK_LO_01, WEAPON_M4,  BLIP_COLOR_RED, accuracy, ehealth, armour, 0, 513.053, 328.065, 8.57157, 0.0, 0);
			SPAWN_ACTOR(14,  MODEL_M_Y_GBIK_LO_02, WEAPON_M4,  BLIP_COLOR_RED, accuracy, ehealth, armour, 0, 505.737, 314.082, 8.57796, 0.0, 0);
			PLAY_CHECKPOINT_SOUND();
			objrc++;
		}
		
		if(objrc == 2)
		{
			PRINT_TXT("Take out the ~R~Lost~S~");
			
			if(peds[0].retc == 2 && peds[1].retc == 2 && peds[2].retc == 2 && peds[3].retc == 2 && peds[4].retc == 2 && peds[5].retc == 2 && peds[6].retc == 2 && peds[7].retc == 2 && peds[8].retc == 2 && peds[9].retc == 2 && peds[10].retc == 2 && peds[11].retc == 2 && peds[12].retc == 2 && peds[13].retc == 2 && peds[14].retc == 2)
			{
				objrc++;
			}	
		}
		
		if(objrc == 3)
		{
			MISSION_COMPLETE("", 13000);
		}
	}
}
Ejemplo n.º 4
0
void main(void)
{
	int i;
	TERMINATE_ALL_SCRIPTS_WITH_THIS_NAME("scriptmgr");
	CLEAR_ZONE(2237.89, 184.489, 5.85721, 200.0);
	INIT_SETTINGS(2237.89, 184.489, 5.85721, 0.0);
	ADD_ARMOUR_TO_CHAR(GetPlayerPed(), 100);
	CLEAR_ZONE(2225.7,  345.369, 17.2112, 200.0);
	SET_THIS_SCRIPT_CAN_REMOVE_BLIPS_CREATED_BY_ANY_SCRIPT(1);

	while (TRUE)
    {
		WAIT(0);
		GET_CHAR_COORDINATES(GetPlayerPed(), &px, &py, &pz);
		GET_CHAR_HEADING(GetPlayerPed(), &ph);
		
		if(objrc == 0)
		{
			DRAW_MENU();
			PRINT_MAIN_LOGO(0.39, 0.05, "The Parking Garage");
			PRINT_DESC(0.34, 0.11, "Recreation of GTA V Online mission \"The Parking Garage\"");
			//PRINT_DESC(0.20, 0.13, "Test1");
			//PRINT_DESC(0.20, 0.15, "Test2");
		}
		
		if(objrc > objstart && objrc != objend)
		{
			PRINT_LIVES();
			POLICE(0, 0);
			MANAGE_PLAYER();
			MANAGE_ACTORS(21);
			MANAGE_VEHICLES(8);
		}
		
		if(objrc == 1)
		{
			UNLOCK_FRONTEND_DISPLAYS();
			APPLY_SELECTED_OPTIONS(level, weather, time);
			SPAWN_VEHICLE(0, vehmodel, BLIP_COLOR_WHITE, 2236.36, 191.781, 5.96358, 270.0, 25000, 0);
			SPAWN_VEHICLE(1, MODEL_PMP600, NOBLIP,  2225.7,  345.369, 17.2112, 0.0,   vhealth, 1);
			SPAWN_VEHICLE(2, MODEL_PMP600, NOBLIP,  2235.81, 344.851, 17.2112, 0.0,   vhealth, 1);
			SPAWN_VEHICLE(3, MODEL_PMP600, NOBLIP,  2237.24, 362.006, 17.2112, 180.0, vhealth, 1);
			SPAWN_VEHICLE(4, MODEL_PMP600, NOBLIP,  2226.02, 361.978, 17.2112, 180.0, vhealth, 1);
			
			for(i=1;i<=4;i++)
			{
				OPEN_CAR_DOOR(vehs[i].car, 0);
				OPEN_CAR_DOOR(vehs[i].car, 1);
				OPEN_CAR_DOOR(vehs[i].car, 2);
				OPEN_CAR_DOOR(vehs[i].car, 3);
			}
			
			SPAWN_ACTOR(0,  MODEL_M_Y_GLAT_LO_01, WEAPON_MP5, NOBLIP, accuracy, ehealth, armour, 10, 2241.71, 349.074, 17.2112, 180.0, 0);
			SPAWN_ACTOR(1,  MODEL_M_Y_GLAT_LO_02, WEAPON_M4,  NOBLIP, accuracy, ehealth, armour, 10, 2236.66, 352.623, 17.2112, 180.0, 0);
			SPAWN_ACTOR(2,  MODEL_M_Y_GLAT_HI_01, WEAPON_MP5, NOBLIP, accuracy, ehealth, armour, 10, 2234.38, 351.852, 17.2112, 180.0, 0);
			SPAWN_ACTOR(3,  MODEL_M_Y_GLAT_HI_02, WEAPON_M4,  NOBLIP, accuracy, ehealth, armour, 10, 2220.1,  355.928, 17.2112, 180.0, 0);
			SPAWN_ACTOR(4,  MODEL_M_Y_GLAT_LO_01, WEAPON_MP5, NOBLIP, accuracy, ehealth, armour, 10, 2218.18, 350.432, 17.2112, 180.0, 0);
			SPAWN_ACTOR(5,  MODEL_M_Y_GLAT_LO_02, WEAPON_M4,  NOBLIP, accuracy, ehealth, armour, 10, 2224.79, 349.411, 17.2112, 180.0, 0);
			SPAWN_ACTOR(6,  MODEL_M_Y_GLAT_HI_01, WEAPON_MP5, NOBLIP, accuracy, ehealth, armour, 10, 2221.69, 367.831, 17.2112, 180.0, 0);
			SPAWN_ACTOR(7,  MODEL_M_Y_GLAT_HI_02, WEAPON_M4,  NOBLIP, accuracy, ehealth, armour, 10, 2228.39, 374.876, 17.2111, 180.0, 0);
			SPAWN_ACTOR(8,  MODEL_M_Y_GLAT_LO_01, WEAPON_MP5, NOBLIP, accuracy, ehealth, armour, 10, 2246.78, 372.589, 17.3392, 180.0, 0);
			SPAWN_ACTOR(9,  MODEL_M_Y_GLAT_LO_02, WEAPON_M4,  NOBLIP, accuracy, ehealth, armour, 10, 2247.09, 360.237, 17.3619, 180.0, 0);
			SPAWN_ACTOR(10, MODEL_M_Y_GLAT_HI_01, WEAPON_MP5, NOBLIP, accuracy, ehealth, armour, 10, 2234.74, 335.179, 17.2112,   0.0, 0);
			SPAWN_ACTOR(11, MODEL_M_Y_GLAT_HI_02, WEAPON_M4,  NOBLIP, accuracy, ehealth, armour, 10, 2230.77, 335.418, 17.2112,   0.0, 0);
			SPAWN_ACTOR(12, MODEL_M_Y_GLAT_LO_02, WEAPON_MP5, NOBLIP, accuracy, ehealth, armour, 10, 2228.00, 344.176, 17.2112, 180.0, 0);
			SPAWN_ACTOR(13, MODEL_M_Y_GLAT_HI_01, WEAPON_MP5, NOBLIP, accuracy, ehealth, armour, 10, 2240.39, 344.829, 17.2112, 180.0, 0);
			TASK_CHAT_WITH_CHAR(peds[10].actor, peds[13].actor, 1, 1);
			TASK_CHAT_WITH_CHAR(peds[11].actor, peds[12].actor, 0, 1);
			PLAY_CHECKPOINT_SOUND();
			objrc++;
		}
		
		if(objrc == 2)
		{
			SET_MISSION_CHECKPOINT(0, 2265.86, 310.3, 3.93312, 4.0, "Go to the ~Y~parking lot~S~");
		}
		
		if(objrc == 3)
		{
			GET_GROUND_Z_FOR_3D_COORD(2247.02, 364.361, 17.3601, &zg);
			CREATE_PICKUP(drugbag, 22, 2247.02, 364.361, zg, &document2, 1);
			objrc++;
		}
		
		if(objrc == 4)
		{
			PRINT_TXT("Get the ~b~document~s~");
			
			if(HAS_PICKUP_BEEN_COLLECTED(document2))
			{
				PLAY_CHECKPOINT_SOUND();
				objrc++;
			}
		}
		
		if(objrc == 5)
		{
			SET_MISSION_CHECKPOINT(0, 747.599, -119.14, 3.67973, 4.0, "Deliver the ~b~document~s~ to ~Y~Lester's warehourse~S~");
			SPAWN_ENEMY_CAR_IN_AREA(MODEL_HUNTLEY, 1847.66, 259.651, 5.34315, 5, 14, 15, MODEL_M_Y_GAFR_HI_01);
			SPAWN_ENEMY_CAR_IN_AREA(MODEL_HUNTLEY, 1854.45, 276.598, 5.134,   6, 16, 17, MODEL_M_Y_GAFR_HI_01);
			SPAWN_ENEMY_CAR_IN_AREA(MODEL_HUNTLEY, 1370.08, 295.171, 24.829,  7, 18, 19, MODEL_M_Y_GAFR_HI_01);
			SPAWN_ENEMY_CAR_IN_AREA(MODEL_HUNTLEY, 1357.89, 281.534, 25.8018, 8, 20, 21, MODEL_M_Y_GAFR_HI_01);			
		}
		
		if(objrc == 6)
		{
			MISSION_COMPLETE("", 20000);
		}
	}
}