- 0
обработка уже существующих диалогов
Вопросы
Лучший ответ
@_bogdan_ Строчки,которые я внес в мод:
Этот код отвечает за дм зоны, тобишь телепорт на определенную дм зону и после смерти игрок снова возрождается в дм зоне, кнопка alt(игровое меню) в дм зоне не работает и в чате отображается "введите /exit для выхода с дм зоны"
#if !defined WEAPON_FIST
#define WEAPON_FIST (0)
#endif
#define MAX_DM_ZONES (5)
#define MAX_DM_ZONE_NAME_LEN (17 + 1)
#define GetDmZoneData(%0,%1) g_dm_zone[%0][%1]
#define GetDmZoneName(%0) GetDmZoneData(%0, DZ_NAME)
#define GetDmZoneGun(%0) GetDmZoneData(%0, DZ_GUN)
#define GetDmZoneGunAmmo(%0) GetDmZoneData(%0, DZ_GUN_AMMO)
#define GetDmZonePosX(%0) GetDmZoneData(%0, DZ_POS_X)
#define GetDmZonePosY(%0) GetDmZoneData(%0, DZ_POS_Y)
#define GetDmZonePosZ(%0) GetDmZoneData(%0, DZ_POS_Z)
#define GetDmZoneAngle(%0) GetDmZoneData(%0, DZ_ANGLE)
#define GetDmZoneEnterMsgColor(%0) GetDmZoneData(%0, DZ_ENTER_MSG_COLOR)
#define GivePlayerDmZoneWeapon(%0,%1) \
GivePlayerWeapon(%0, GetDmZoneGun(%1), GetDmZoneGunAmmo(%1))
#define SetPlayerDmZonePos(%0,%1) \
SetPlayerPos(%0, GetDmZonePosX(%1), GetDmZonePosY(%1), GetDmZonePosZ(%1))
#define SetPlayerDmZoneAngle(%0,%1) SetPlayerFacingAngle(%0, GetDmZoneAngle(%1))
#define SendExitDmZoneMessage(%0) SendClientMessage(%0, -1, "Bведите /exit, чтобы выйти с дм зоны")
#define GetPlayerDmZone(%0) g_player_dm_zone[%0]
#define IsPlayerInDmZone(%0) (GetPlayerDmZone(%0) != DM_ZONE_TYPE_NONE)
enum
{
DIALOG_ENTERTAINMENT = 6,
DIALOG_DM_ZONES = 632
}
enum E_DM_ZONE_STRUCT
{
DZ_NAME[MAX_DM_ZONE_NAME_LEN],
DZ_GUN,
DZ_GUN_AMMO,
Float: DZ_POS_X,
Float: DZ_POS_Y,
Float: DZ_POS_Z,
Float: DZ_ANGLE,
DZ_ENTER_MSG_COLOR
}
new g_dm_zone[MAX_DM_ZONES][E_DM_ZONE_STRUCT] =
{
{
"Город",
0, 0,
2379.10, -1716.12, 524.26,
239.0523,
0xE2A80EAA
},
{
"Крушение самолёта",
0, 0,
-423.89, 498.11, 14.48,
343.1032,
0x367A94AA
},
{
"Берлин 1945",
WEAPON_RIFLE, 300,
1362.36, 1672.41, 4.06,
343.1032,
0x367A94AA
},
{
"Ghetto",
WEAPON_RIFLE, 300,
340.92, 1892.04, 13.12,
343.1032,
0x9C8DF3AA
},
{
"Вулкан",
WEAPON_DEAGLE, 300,
36.38, 2854.61, 315.46,
88.9641,
0xF60000AA
}
};
enum
{
DM_ZONE_TYPE_NONE = -1,
DM_ZONE_TYPE_VOLCANO = 4
}
new g_player_dm_zone[MAX_PLAYERS] = {DM_ZONE_TYPE_NONE, ...};
stock ShowPlayerEntertainmentDialog(playerid)
{
return ShowPlayerDialog
(
playerid, DIALOG_ENTERTAINMENT, DIALOG_STYLE_LIST,
"{1E90FF}Развлечения",
"{30d5c8}Паркур зоны\n"\
"{08e8de}Deathmatch зоны\n"\
"{00ffff}Мини-игры\n"\
"{afeeee}Различные места",
"OK", "Назад"
);
}
stock ShowPlayerDmZonesDialog(playerid)
{
new colors[5][2][9] =
{
{"{9240FF}", "{DCC1FF}"},
{"{A73DFE}", "{E6C6FF}"},
{"{C134FE}", "{EFCAFF}"},
{"{D222FF}", "{F2C1FF}"},
{"{EA30FE}", "{F9BBFF}"}
},
fmt_str[] = "%sДМ %d || %s'%s'\n",
result_str[((sizeof fmt_str) +
((- 4 + (sizeof colors[][] * 2)) +
(- 2 + 1) +
(- 2 + MAX_DM_ZONE_NAME_LEN)))],
dest[((sizeof result_str) * MAX_DM_ZONES)];
for(new idx; idx < sizeof g_dm_zone; idx ++)
{
format
(
result_str, sizeof result_str,
fmt_str,
colors[idx][0],
idx + 1,
colors[idx][1],
GetDmZoneName(idx)
);
strcat(dest, result_str);
}
return ShowPlayerDialog
(
playerid, DIALOG_DM_ZONES, DIALOG_STYLE_LIST,
"{1E90FF}Deathmatch зоны",
dest,
"OK", "Назад"
);
}
stock SendEnterDmZoneMessage(playerid, zone_id)
{
new fmt_str[] = "{1E90FF}[DM] {ffffff}Игрок {1E90FF}%s {FFFFFF}зашел на дм зону"\
"{1E90FF}'%s'! {FFFFFF}[/dm]",
result_str[((sizeof fmt_str) +
((- 2 + MAX_PLAYER_NAME) +
(- 2 + MAX_DM_ZONE_NAME_LEN)))];
format(result_str, sizeof result_str, fmt_str, GetPlayerNameEx(playerid), GetDmZoneName(zone_id));
return SendClientMessage(playerid, GetDmZoneEnterMsgColor(zone_id), result_str);
}
stock SetPlayerMainDmZoneData(playerid, zone_id)
{
new result = (zone == DM_ZONE_TYPE_VOLCANO ? 1 : 0);
if(result)
ResetPlayerWeapons(playerid);
SetPlayerArmour(playerid, 100.00);
SetPlayerHealth(playerid, 100.00);
SetPlayerInterior(playerid, result);
result = (!result ? result : result + 1);
SetPlayerVirtualWorld(playerid, result);
if(GetDmZoneGun(zone_id) != WEAPON_FIST)
GivePlayerDmZoneWeapon(playerid, zone_id);
SetPlayerDmZonePos(playerid, zone_id);
SetPlayerDmZoneAngle(playerid, zone_id);
SendEnterDmZoneMessage(playerid, zone_id);
return PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
}
@__OnPlayerSelectDmZone(playerid, zone_id);
@__OnPlayerSelectDmZone(playerid, zone_id)
return SetPlayerMainDmZoneData(playerid, zone_id);
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if((newkeys & KEY_WALK) && (IsPlayerInDmZone(playerid)))
return SendExitDmZoneMessage(playerid);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
if(IsPlayerInDmZone(playerid))
return SetPlayerMainDmZoneData(playerid, GetPlayerDmZone(playerid));
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, const inputtext[])
{
switch(dialogid)
{
case DIALOG_ENTERTAINMENT:
{
switch(listitem)
{
case 1:
return ShowPlayerDmZonesDialog(playerid);
}
}
case DIALOG_DM_ZONES:
{
if(response)
return @__OnPlayerSelectDmZone(playerid, listitem);
else ShowPlayerEntertainmentDialog(playerid);
}
}
return 1;
}
Ошибки:
Как я вставил код:
Эта тема закрыта для публикации ответов.
-
Последние посетители 0 пользователей онлайн
Ни одного зарегистрированного пользователя не просматривает данную страницу
-
Похожий контент
-
От patrickk
Всем привет, решил написать dm сервер и довольно хорошим получился, даже на голову выше Goat dm. Оставил не решенную проблему тем что у меня есть 4 локации с rp run и cj run ну а как добавить cj бег на те локации не знаю и как эта система работает. Надеюсь мне помогут знающие люди
-
От Samolet
Здраствуйте, cоздаю копию Arizona на ОМП, опен мультиплеер, загрузил и подключил бд, но сервер не хочет вот лог :[2026-10-20T21:03:32+0300] [Info] Log file reloaded. Starting open.mp server (1.5.8.3079) from commit c6759bd8d265171ae3d86598895a23d5a8d92a3b Loading component $CAPI.so Successfully loaded component C-API (1.5.8.3079) with UID 10467dd8d4c56fc6 Loading component LegacyConfig.so Successfully loaded component LegacyConfig (1.5.8.3079) with UID 24ef6216838f9ffc Loading component NPCs.so Successfully loaded component NPCs (1.5.8.3079) with UID 3d0e59e87f4e90bc Loading component Recordings.so Successfully loaded component Recordings (1.5.8.3079) with UID 871144d399f5f613 Loading component Checkpoints.so Successfully loaded component Checkpoints (1.5.8.3079) with UID 44a937350d611dde Loading component TextDraws.so Successfully loaded component TextDraws (1.5.8.3079) with UID 9b5dc2b1d15c992a Loading component Pawn.so Successfully loaded component Pawn (1.5.8.3079) with UID 78906cd9f19c36a6 Loading component GangZones.so Successfully loaded component GangZones (1.5.8.3079) with UID b3351d11ee8d8056 Loading component Actors.so Successfully loaded component Actors (1.5.8.3079) with UID c81ca021eae2ad5c Loading component Pickups.so Successfully loaded component Pickups (1.5.8.3079) with UID cf304faa363dd971 Loading component Dialogs.so Successfully loaded component Dialogs (1.5.8.3079) with UID 44a111350d611dde Loading component Objects.so Successfully loaded component Objects (1.5.8.3079) with UID 59f8415f72da6160 Loading component Console.so Successfully loaded component Console (1.5.8.3079) with UID bfa24e49d0c95ee4 Loading component TextLabels.so Successfully loaded component TextLabels (1.5.8.3079) with UID a0c57ea80a009742 Loading component Variables.so Successfully loaded component Variables (1.5.8.3079) with UID 75e121848bc01fa2 Loading component Databases.so Successfully loaded component Databases (1.5.8.3079) with UID 80092e7eb5821a96 Loading component LegacyNetwork.so Successfully loaded component RakNetLegacyNetwork (1.5.8.3079) with UID ea9799fd79cf8442 Loading component CustomModels.so Successfully loaded component CustomModels (1.5.8.3079) with UID 15e3cb1e7c77ffff Loading component Menus.so Successfully loaded component Menus (1.5.8.3079) with UID 621e219eb97ee0b2 Loading component Vehicles.so Successfully loaded component Vehicles (1.5.8.3079) with UID 3f1f62ee9e22ab19 Loading component Classes.so Successfully loaded component Classes (1.5.8.3079) with UID 8cfb3183976da208 Loading component Timers.so Successfully loaded component Timers (1.5.8.3079) with UID 2ad8124c5ea257a3 Loaded 22 component(s) from /home/gs113492/components Executing Server Config... [2026-10-20T21:03:33+0300] [Info] Loading plugin: crashdetect.so [2026-10-20T21:03:33+0300] [Info] CrashDetect plugin 4.19 [2026-10-20T21:03:33+0300] [Info] Loading plugin: mapandreas.so [2026-10-20T21:03:33+0300] [Info] Loading plugin: streamer.so [2026-10-20T21:03:33+0300] [Info] *** Streamer Plugin v2.9.4 by Incognito loaded *** [2026-10-20T21:03:33+0300] [Info] Loading plugin: sscanf.so [2026-10-20T21:03:33+0300] [Info] [2026-10-20T21:03:33+0300] [Info] =============================== [2026-10-20T21:03:33+0300] [Info] sscanf plugin loaded. [2026-10-20T21:03:33+0300] [Info] Version: 2.8.3 [2026-10-20T21:03:33+0300] [Info] (c) 2018 Alex "Y_Less" Cole [2026-10-20T21:03:33+0300] [Info] =============================== [2026-10-20T21:03:33+0300] [Info] Loading plugin: TOTP.so [2026-10-20T21:03:33+0300] [Info] TOTP plugin v1.0.1 by Games loaded. [2026-10-20T21:03:33+0300] [Info] Loading plugin: mysql_static.so [2026-10-20T21:03:33+0300] [Info] >> plugin.mysql: R39-6 successfully loaded. [2026-10-20T21:03:33+0300] [Info] Loading plugin: libpawn_json.so [2026-10-20T21:03:34+0300] [Error] Function not registered: YSF_SetTickRate [2026-10-20T21:03:34+0300] [Error] Function not registered: PC_Init [2026-10-20T21:03:34+0300] [Info] [debug] Run time error 19: "File or function is not found" [2026-10-20T21:03:34+0300] [Info] [debug] PC_Init [2026-10-20T21:03:34+0300] [Info] [debug] YSF_SetTickRate [2026-10-20T21:03:34+0300] [Error] File or function is not found [2026-10-20T21:03:34+0300] [Error] Function not registered: PC_RegAlias [2026-10-20T21:03:34+0300] [Error] Function not registered: BS_GetWriteOffset [2026-10-20T21:03:34+0300] [Error] Function not registered: BS_Reset [2026-10-20T21:03:34+0300] [Error] Function not registered: PR_RegHandler [2026-10-20T21:03:34+0300] [Error] Function not registered: BS_Delete [2026-10-20T21:03:34+0300] [Error] Function not registered: BS_New [2026-10-20T21:03:34+0300] [Error] Function not registered: BS_ResetReadPointer [2026-10-20T21:03:34+0300] [Error] Function not registered: BS_SetWriteOffset [2026-10-20T21:03:34+0300] [Error] Function not registered: BS_IgnoreBits [2026-10-20T21:03:34+0300] [Error] Function not registered: PR_Init [2026-10-20T21:03:34+0300] [Error] Function not registered: PR_SendRPC [2026-10-20T21:03:34+0300] [Error] Function not registered: PR_SendPacket [2026-10-20T21:03:34+0300] [Error] Function not registered: BS_WriteValue [2026-10-20T21:03:34+0300] [Error] Function not registered: BS_GetNumberOfBytesUsed [2026-10-20T21:03:34+0300] [Error] Function not registered: BS_ReadValue [2026-10-20T21:03:34+0300] [Error] Function not registered: PC_Init [2026-10-20T21:03:34+0300] [Info] [debug] Run time error 19: "File or function is not found" [2026-10-20T21:03:34+0300] [Info] [debug] PC_Init [2026-10-20T21:03:34+0300] [Info] [debug] BS_ReadValue [2026-10-20T21:03:34+0300] [Info] [debug] BS_GetNumberOfBytesUsed [2026-10-20T21:03:34+0300] [Info] [debug] BS_WriteValue [2026-10-20T21:03:34+0300] [Info] [debug] PR_SendPacket [2026-10-20T21:03:34+0300] [Info] [debug] PR_SendRPC [2026-10-20T21:03:34+0300] [Info] [debug] PR_Init [2026-10-20T21:03:34+0300] [Info] [debug] BS_IgnoreBits [2026-10-20T21:03:34+0300] [Info] [debug] BS_SetWriteOffset [2026-10-20T21:03:34+0300] [Info] [debug] BS_ResetReadPointer [2026-10-20T21:03:34+0300] [Info] [debug] BS_New [2026-10-20T21:03:34+0300] [Info] [debug] BS_Delete [2026-10-20T21:03:34+0300] [Info] [debug] PR_RegHandler [2026-10-20T21:03:34+0300] [Info] [debug] BS_Reset [2026-10-20T21:03:34+0300] [Info] [debug] BS_GetWriteOffset [2026-10-20T21:03:34+0300] [Info] [debug] PC_RegAlias [2026-10-20T21:03:34+0300] [Error] File or function is not found [2026-10-20T21:03:34+0300] [Info] [debug] Run time error 19: "File or function is not found" [2026-10-20T21:03:34+0300] [Info] [debug] PC_Init [2026-10-20T21:03:34+0300] [Info] [debug] YSF_SetTickRate [2026-10-20T21:03:34+0300] [Error] File or function is not found [2026-10-20T21:03:34+0300] [Info] [debug] Run time error 19: "File or function is not found" [2026-10-20T21:03:34+0300] [Info] [debug] PC_Init [2026-10-20T21:03:34+0300] [Info] [debug] BS_ReadValue [2026-10-20T21:03:34+0300] [Info] [debug] BS_GetNumberOfBytesUsed [2026-10-20T21:03:34+0300] [Info] [debug] BS_WriteValue [2026-10-20T21:03:34+0300] [Info] [debug] PR_SendPacket [2026-10-20T21:03:34+0300] [Info] [debug] PR_SendRPC [2026-10-20T21:03:34+0300] [Info] [debug] PR_Init [2026-10-20T21:03:34+0300] [Info] [debug] BS_IgnoreBits [2026-10-20T21:03:34+0300] [Info] [debug] BS_SetWriteOffset [2026-10-20T21:03:34+0300] [Info] [debug] BS_ResetReadPointer [2026-10-20T21:03:34+0300] [Info] [debug] BS_New [2026-10-20T21:03:34+0300] [Info] [debug] BS_Delete [2026-10-20T21:03:34+0300] [Info] [debug] PR_RegHandler [2026-10-20T21:03:34+0300] [Info] [debug] BS_Reset [2026-10-20T21:03:34+0300] [Info] [debug] BS_GetWriteOffset [2026-10-20T21:03:34+0300] [Info] [debug] PC_RegAlias [2026-10-20T21:03:34+0300] [Info] Legacy Network started on ***.**.**.***:2717. Помогите пожалуйста
-
denis_191105 Новичок 0
Как убрать обработку уже существующих диалогов? При компиляции, много ошибок. Нужна срочно помощь!
Отредактировано пользователем denis_191105
Заметка от _bogdan_ , создано
прикрепите код, или скриншот ошибки.
Поделиться сообщением
Ссылка на сообщение