PDA

Просмотр полной версии : [Вопрос] Как переделать вход в бизнесы с пикапов на чекпоинты?



Геннадий Литвинов
15.09.2019, 12:24
Здравствуйте! Ув.Формучане .
У меня такой вопрос в ход в бизнес у меня реализован на Pickup я хочу переделать на Checkpoint


CreateDynamicPickup ( 1318, 23, b_info [ b_count ] [ b_position ] [ 0 ], b_info [ b_count ] [ b_position ] [ 1 ], b_info [ b_count ] [ b_position ] [ 2 ], 0, 0 ) ;

DeimoS
15.09.2019, 13:03
Так и в чём заключается вопрос?

Геннадий Литвинов
15.09.2019, 13:45
как мне переделать чтоб у меня был не pickup а чекпоинт
Побывал сделать так :


CreateDynamicCP ( b_info [ b_count ] [ b_position ] [ 0 ], b_info [ b_count ] [ b_position ] [ 1 ], b_info [ b_count ] [ b_position ] [ 2 ], 3, 0 ) ; не работает !

- - - Добавлено - - -


CreateDynamicCP ( b_info [ t ] [ b_position ] [ 0 ], b_info [ t ] [ b_position ] [ 1 ], b_info [ t ] [ b_position ] [ 2 ], -1, -1, -1, -1, 100 ) ;

Если я делаю так то Cekpoint появляется ну когда в него заходишь не чего не происходит ..

- - - Добавлено - - -


callback: businesses_loading ()
{
new fields ;
cache_get_data ( b_count, fields ) ;
if ( b_count )
{
for ( new t = 0 ; t < b_count ; t ++ )
{
b_info [ t ] [ b_id ] = cache_get_field_content_int ( t, "b_id", sql_connection ) ;
b_info [ t ] [ b_owner_inc ] = cache_get_field_content_int ( t, "b_owner_inc", sql_connection ) ;

cache_get_field_content ( t, "b_owner_name", b_info [ t ] [ b_owner_name ] , sql_connection, 32 ) ;
cache_get_field_content ( t, "b_name", b_info [ t ] [ b_name ] , sql_connection, 32 ) ;

b_info [ t ] [ b_position ] [ 0 ] = cache_get_field_content_float ( t, "b_pos_x", sql_connection ) ;
b_info [ t ] [ b_position ] [ 1 ] = cache_get_field_content_float ( t, "b_pos_y", sql_connection ) ;
b_info [ t ] [ b_position ] [ 2 ] = cache_get_field_content_float ( t, "b_pos_z", sql_connection ) ;
b_info [ t ] [ b_position ] [ 3 ] = cache_get_field_content_float ( t, "b_pos_c", sql_connection ) ;

b_info [ t ] [ b_int ] = cache_get_field_content_int ( t, "b_int", sql_connection ) ;

b_info [ t ] [ b_money ] = cache_get_field_content_int ( t, "b_money", sql_connection ) ;

b_info [ t ] [ b_close ] = cache_get_field_content_int ( t, "b_close", sql_connection ) ;
b_info [ t ] [ b_price ] = cache_get_field_content_int ( t, "b_price", sql_connection ) ;
b_info [ t ] [ b_product ] = cache_get_field_content_int ( t, "b_product", sql_connection ) ;
b_info [ t ] [ b_type ] = cache_get_field_content_int ( t, "b_type", sql_connection ) ;

b_info [ t ] [ b_fee ] = cache_get_field_content_int ( t, "b_fee", sql_connection ) ;
b_info [ t ] [ b_maxproduct ] = cache_get_field_content_int ( t, "b_maxproduct", sql_connection ) ;

b_info [ t ] [ b_cost ] = cache_get_field_content_int ( t, "b_cost", sql_connection ) ;

b_info [ t ] [ b_mafia ] = cache_get_field_content_int ( t, "b_mafia", sql_connection ) ;

new sscanf_delimit [ 36 ] ;
cache_get_field_content ( t, "b_improve", sscanf_delimit, sql_connection, 36 ) ;
sscanf ( sscanf_delimit, "p<|>ddd", b_info [ t ] [ b_improve ] [ 0 ], b_info [ t ] [ b_improve ] [ 1 ], b_info [ t ] [ b_improve ] [ 2 ] ) ;

if ( b_info [ t ] [ b_type ] == bizz_type_zavod )
{
if ( b_info [ t ] [ b_owner_inc ] == -1 )
{
new label_string [ 250 ] ;
format ( label_string, sizeof ( label_string ), "{"#cGR"}Контроль: {"#cWH"}%s", mafia_owner_name [ b_info [ t ] [ b_mafia ] - 1 ] ) ;
b_info [ t ] [ b_label ] = CreateDynamic3DTextLabel ( label_string, -1, b_info [ t ] [ b_position ] [ 0 ], b_info [ t ] [ b_position ] [ 1 ], b_info [ t ] [ b_position ] [ 2 ] + 0.7, 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, 0, 0 ) ;
}
else
{
new label_string [ 250 ] ;
format ( label_string, sizeof ( label_string ), "{"#cGR"}Контроль: {"#cWH"}%s",
mafia_owner_name [ b_info [ t ] [ b_mafia ] - 1 ] ) ;

b_info [ t ] [ b_label ] = CreateDynamic3DTextLabel ( label_string, -1, b_info [ t ] [ b_position ] [ 0 ], b_info [ t ] [ b_position ] [ 1 ], b_info [ t ] [ b_position ] [ 2 ] + 0.7, 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, 0, 0 ) ;

}

b_info [ t ] [ b_int ] --;
b_info [ t ] [ b_pickup ] = CreateDynamicCP ( b_info [ t ] [ b_position ] [ 0 ], b_info [ t ] [ b_position ] [ 1 ], b_info [ t ] [ b_position ] [ 2 ], -1, -1, -1, -1, 100 ) ;

}

if ( b_info [ t ] [ b_type ] == bizz_type_shop || b_info [ t ] [ b_type ] == bizz_type_pharm || b_info [ t ] [ b_type ] == bizz_type_clothes || b_info [ t ] [ b_type ] == bizz_type_carshop || b_info [ t ] [ b_type ] == bizz_type_cafe || b_info [ t ] [ b_type ] == bizz_type_club || b_info [ t ] [ b_type ] == bizz_type_bar || b_info [ t ] [ b_type ] == bizz_type_casino || b_info [ t ] [ b_type ] == bizz_type_gum )
{
if ( b_info [ t ] [ b_owner_inc ] == -1 )
{
new label_string [ 250 ] ;
format ( label_string, sizeof ( label_string ), "{"#cBL"}%s\n{"#cGR"}Стоимость: {"#cWH"}%d$\n{"#cGR"}Контроль: {"#cWH"}%s\n{"#cGR"}Бизнес продаётся",
b_types [ b_info [ t ] [ b_type ] ], b_info [ t ] [ b_price ] * for_tax [ 1 ], mafia_owner_name [ b_info [ t ] [ b_mafia ] - 1 ] ) ;
b_info [ t ] [ b_label ] = CreateDynamic3DTextLabel ( label_string, -1, b_info [ t ] [ b_position ] [ 0 ], b_info [ t ] [ b_position ] [ 1 ], b_info [ t ] [ b_position ] [ 2 ] + 0.7, 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, 0, 0 ) ;
}
else
{
new label_string [ 250 ] ;
format ( label_string, sizeof ( label_string ), "{"#cBL"}%s\n{"#cGR"}Владелец: {"#cWH"}%s\n{"#cGR"}Стоимость: {"#cWH"}%d$\n{"#cGR"}Контроль: {"#cWH"}%s\n{"#cGR"}Состояние: {"#cWH"}%s",
b_types [ b_info [ t ] [ b_type ] ], b_info [ t ] [ b_owner_name ], b_info [ t ] [ b_price ] * for_tax [ 1 ], mafia_owner_name [ b_info [ t ] [ b_mafia ] - 1 ], ( ! b_info [ t ] [ b_close ]) ? ("{1a9616}Открыт") : ("{e11010}Закрыт") ) ;

b_info [ t ] [ b_label ] = CreateDynamic3DTextLabel ( label_string, -1, b_info [ t ] [ b_position ] [ 0 ], b_info [ t ] [ b_position ] [ 1 ], b_info [ t ] [ b_position ] [ 2 ] + 0.7, 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, 0, 0 ) ;

}

if ( b_info [ t ] [ b_type ] == bizz_type_gum )
{
new actorid = CreateActor( 81, 756.9302, 7.1851, 1000.7009, 219.1384 ) ;
SetActorVirtualWorld ( actorid, b_info [ t ] [ b_id ] + 1000 ) ;
ApplyActorAnimation ( actorid, "DEALER", "DEALER_IDLE", 4.1, 0, 1, 1, 1, 1 ) ;
}

b_info [ t ] [ b_pickup ] = CreateDynamicCP ( b_info [ t ] [ b_position ] [ 0 ], b_info [ t ] [ b_position ] [ 1 ], b_info [ t ] [ b_position ] [ 2 ], -1, -1, -1, -1, 100 ) ;
pick_info [ b_info [ t ] [ b_pickup ] ] [ pick_type ] = pick_type_bentrance ;

b_info [ t ] [ b_int ] --;
new bis_int = b_info [ t ][ b_int ] ;

new pickup_biz = CreateDynamicPickup ( 1318, 23, b_interior [ bis_int ] [ i_position ] [ 0 ], b_interior [ bis_int ] [ i_position ] [ 1 ], b_interior [ bis_int ] [ i_position ] [ 2 ], b_info [ t ] [ b_id ] + 1000, b_interior [ bis_int ] [ i_interior ] ) ;
pick_info [ pickup_biz ] [ pick_type ] = pick_type_bexit ;

}
if ( b_info [ t ] [ b_type ] == bizz_type_ammo )
{
if ( b_info [ t ] [ b_owner_inc ] == -1 )
{
new label_string [ 228 ] ;
format ( label_string, sizeof ( label_string ), "{"#cBL"}%s\n{"#cGR"}Стоимость: {"#cWH"}%d$\n{"#cGR"}Контроль: {"#cWH"}%s\n{"#cGR"}Бизнес продаётся",
b_types [ b_info [ t ] [ b_type ] ], b_info [ t ] [ b_price ] * for_tax [ 1 ], mafia_owner_name [ b_info [ t ] [ b_mafia ] - 1 ] ) ;
b_info [ t ] [ b_label ] = CreateDynamic3DTextLabel ( label_string, -1, b_info [ t ] [ b_position ] [ 0 ], b_info [ t ] [ b_position ] [ 1 ], b_info [ t ] [ b_position ] [ 2 ] + 0.7, 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, 0, 0 ) ;
}
else
{
new label_string [ 228 ] ;
format ( label_string, sizeof ( label_string ), "{"#cBL"}%s\n{"#cGR"}Владелец: {"#cWH"}%s\n{"#cGR"}Стоимость: {"#cWH"}%d$\n{"#cGR"}Контроль: {"#cWH"}%s\n{"#cGR"}Состояние: {"#cWH"}%s",
b_types [ b_info [ t ] [ b_type ] ], b_info [ t ] [ b_owner_name ], b_info [ t ] [ b_price ] * for_tax [ 1 ], mafia_owner_name [ b_info [ t ] [ b_mafia ] - 1 ], ( ! b_info [ t ] [ b_close ]) ? ("{1a9616}Открыт") : ("{e11010}Закрыт") ) ;

b_info [ t ] [ b_label ] = CreateDynamic3DTextLabel ( label_string, -1, b_info [ t ] [ b_position ] [ 0 ], b_info [ t ] [ b_position ] [ 1 ], b_info [ t ] [ b_position ] [ 2 ] + 0.7, 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, 0, 0 ) ;

}
b_info [ t ] [ b_pickup ] = CreateDynamicCP ( b_info [ t ] [ b_position ] [ 0 ], b_info [ t ] [ b_position ] [ 1 ], b_info [ t ] [ b_position ] [ 2 ], -1, -1, -1, -1, 50 ) ;
pick_info [ b_info [ t ] [ b_pickup ] ] [ pick_type ] = pick_type_bentrance ;
b_info [ t ] [ b_int ] --;
new bis_int = b_info [ t ][ b_int ] ;

new pickup_biz = CreateDynamicPickup ( 1318, 23, b_interior [ bis_int ] [ i_position ] [ 0 ], b_interior [ bis_int ] [ i_position ] [ 1 ], b_interior [ bis_int ] [ i_position ] [ 2 ], b_info [ t ] [ b_id ] + 1000, b_interior [ bis_int ] [ i_interior ] ) ;
pick_info [ pickup_biz ] [ pick_type ] = pick_type_bexit ;


new actorid = CreateActor( 179, 296.4053,-40.2153,1001.5156,1.6147 ) ;
SetActorVirtualWorld ( actorid, b_info [ t ] [ b_id ] + 1000 ) ;


}
else if ( b_info [ t ] [ b_type ] == bizz_type_gas )
{
if ( b_info [ t ] [ b_owner_inc ] == -1 )
{
new label_string [ 228 ] ;
format ( label_string, sizeof ( label_string ), "{"#cBL"}%s\n{"#cGR"}Стоимость: {"#cWH"}%d$\n{"#cGR"}Контроль: {"#cWH"}%s\n{"#cGR"}Бизнес продаётся (/buygas)",
b_types [ b_info [ t ] [ b_type ] ], b_info [ t ] [ b_price ] * for_tax [ 1 ], mafia_owner_name [ b_info [ t ] [ b_mafia ] - 1 ] ) ;
b_info [ t ] [ b_label ] = CreateDynamic3DTextLabel ( label_string, -1, b_info [ t ] [ b_position ] [ 0 ], b_info [ t ] [ b_position ] [ 1 ], b_info [ t ] [ b_position ] [ 2 ] + 0.7, 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, 0, 0 ) ;
}
else
{
new label_string [ 228 ] ;
format ( label_string, sizeof ( label_string ), "{"#cBL"}%s\n{"#cGR"}Владелец: {"#cWH"}%s\n{"#cGR"}Стоимость: {"#cWH"}%d$\n{"#cGR"}Контроль:{"#cWH"} %s\n{"#cGR"}Состояние: {"#cWH"}%s",
b_types [ b_info [ t ] [ b_type ] ], b_info [ t ] [ b_owner_name ], b_info [ t ] [ b_price ] * for_tax [ 1 ], mafia_owner_name [ b_info [ t ] [ b_mafia ] - 1 ], ( ! b_info [ t ] [ b_close ]) ? ("{1a9616}Открыт") : ("{e11010}Закрыт") ) ;

b_info [ t ] [ b_label ] = CreateDynamic3DTextLabel ( label_string, -1, b_info [ t ] [ b_position ] [ 0 ], b_info [ t ] [ b_position ] [ 1 ], b_info [ t ] [ b_position ] [ 2 ] + 0.7, 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, 0, 0 ) ;
}
}
else if ( b_info [ t ] [ b_type ] == bizz_type_tune )
{
if ( b_info [ t ] [ b_owner_inc ] == -1 )
{
new label_string [ 228 ] ;
format ( label_string, sizeof ( label_string ), "{"#cBL"}%s\n{"#cGR"}Стоимость: {"#cWH"}%d$\n{"#cGR"}Контроль: {"#cWH"}%s\n{"#cGR"}Автостанция продаётся (/buytune)",
b_types [ b_info [ t ] [ b_type ] ], b_info [ t ] [ b_price ] * for_tax [ 1 ] ) ;
b_info [ t ] [ b_label ] = CreateDynamic3DTextLabel ( label_string, -1, b_info [ t ] [ b_position ] [ 0 ], b_info [ t ] [ b_position ] [ 1 ], b_info [ t ] [ b_position ] [ 2 ] + 0.7, 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, 0, 0 ) ;
}
else
{
new label_string [ 228 ] ;
format ( label_string, sizeof ( label_string ), "{"#cBL"}%s\n{"#cGR"}Владелец: {"#cWH"}%s\n{"#cGR"}Стоимость: {"#cWH"}%d$\n{"#cGR"}Контроль: {"#cWH"}%s\n{"#cGR"}Состояние: {"#cWH"}%s",
b_types [ b_info [ t ] [ b_type ] ], b_info [ t ] [ b_owner_name ], b_info [ t ] [ b_price ] * for_tax [ 1 ], mafia_owner_name [ b_info [ t ] [ b_mafia ] - 1 ], ( ! b_info [ t ] [ b_close ]) ? ("{1a9616}Открыт") : ("{e11010}Закрыт") ) ;

b_info [ t ] [ b_label ] = CreateDynamic3DTextLabel ( label_string, -1, b_info [ t ] [ b_position ] [ 0 ], b_info [ t ] [ b_position ] [ 1 ], b_info [ t ] [ b_position ] [ 2 ] + 0.7, 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, 0, 0 ) ;
}
new actorid = CreateActor( 50, 944.6522, -1747.3267, 1013.5334, 358.0577 ) ;
SetActorVirtualWorld ( actorid, b_info [ t ] [ b_id ] + 1000 ) ;
}
if ( b_info [ t ] [ b_int ] >= 0 && b_info [ t ] [ b_type ] != bizz_type_tune && b_info [ t ] [ b_type ] != bizz_type_gas )
{
new bis_int = b_info [ t ][ b_int ] ;
CreateDynamicMapIcon ( b_info [ t ] [ b_position ] [ 0 ], b_info [ t ] [ b_position ] [ 1 ], b_info [ t ] [ b_position ] [ 2 ], b_interior [ bis_int ] [ i_map_icon ], 0, 0, 0, -1, 200.0 ) ;
}
else
{
switch ( b_info [ t ] [ b_type ] )
{
case bizz_type_tune:CreateDynamicMapIcon ( b_info [ t ] [ b_position ] [ 0 ], b_info [ t ] [ b_position ] [ 1 ], b_info [ t ] [ b_position ] [ 2 ], 27, 0, 0, 0, -1, 200.0 ) ;
case bizz_type_gas:CreateDynamicMapIcon ( b_info [ t ] [ b_position ] [ 0 ], b_info [ t ] [ b_position ] [ 1 ], b_info [ t ] [ b_position ] [ 2 ], 56, 0, 0, 0, -1, 200.0 ) ;
}
}
}
}
printf ( "[SERVER] Загружено %d бизнесов.", b_count ) ;
return 1;
}

Вот полностью callback .... помогите два часа сижу думаю что не так

DeimoS
15.09.2019, 14:31
Так тебе нужно и действие для входа переносить на чекпоинты. То бишь, код из OnPlayerPickUpDynamicPuckup переносить в OnPlayerEnterDynamicCP, переписав его с новыми проверками.

Не проще модель пикапа заменить на 19605 (https://dev.prineside.com/ru/gtasa_samp_model_id/model/19605-EnExMarker4-2/)?

Геннадий Литвинов
16.09.2019, 10:38
я делаю систему бизнесев как на Grand Role Play