Здравствуйте, я декомпилил плагин CSS Medic через http://headlinedev.xyz/lysis/ и изменил код на:
Скрытый текст
public PlVers:__version = { version = 5, filevers = "1.6.4-dev+4625", date = "02/14/2017", time = "03:50:22" }; new Float:NULL_VECTOR[3]; new String:NULL_STRING[4]; public Extension:__ext_core = { name = "Core", file = "core", autoload = 0, required = 0, }; new MaxClients; public Extension:__ext_sdktools = { name = "SDKTools", file = "sdktools.ext", autoload = 1, required = 1, }; new String:sSteams[65][24]; new Handle:g_hKv; new Handle:gPluginEnabled; new Handle:gHealthAmount; new Handle:gMinHealth; new Handle:gMedicCost; new Handle:gShowInChat; new Handle:gMaxTimeUse; new gPlayerMoney; new iTimeMedic[65]; new gUsedMedic[65]; public Plugin:myinfo = { name = "Medic", description = "You can call a medic.", author = "tuty & Danyas", version = "1.1", url = "no" }; public __ext_core_SetNTVOptional() { MarkNativeAsOptional("GetFeatureStatus"); MarkNativeAsOptional("RequireFeature"); MarkNativeAsOptional("AddCommandListener"); MarkNativeAsOptional("RemoveCommandListener"); MarkNativeAsOptional("BfWriteBool"); MarkNativeAsOptional("BfWriteByte"); MarkNativeAsOptional("BfWriteChar"); MarkNativeAsOptional("BfWriteShort"); MarkNativeAsOptional("BfWriteWord"); MarkNativeAsOptional("BfWriteNum"); MarkNativeAsOptional("BfWriteFloat"); MarkNativeAsOptional("BfWriteString"); MarkNativeAsOptional("BfWriteEntity"); MarkNativeAsOptional("BfWriteAngle"); MarkNativeAsOptional("BfWriteCoord"); MarkNativeAsOptional("BfWriteVecCoord"); MarkNativeAsOptional("BfWriteVecNormal"); MarkNativeAsOptional("BfWriteAngles"); MarkNativeAsOptional("BfReadBool"); MarkNativeAsOptional("BfReadByte"); MarkNativeAsOptional("BfReadChar"); MarkNativeAsOptional("BfReadShort"); MarkNativeAsOptional("BfReadWord"); MarkNativeAsOptional("BfReadNum"); MarkNativeAsOptional("BfReadFloat"); MarkNativeAsOptional("BfReadString"); MarkNativeAsOptional("BfReadEntity"); MarkNativeAsOptional("BfReadAngle"); MarkNativeAsOptional("BfReadCoord"); MarkNativeAsOptional("BfReadVecCoord"); MarkNativeAsOptional("BfReadVecNormal"); MarkNativeAsOptional("BfReadAngles"); MarkNativeAsOptional("BfGetNumBytesLeft"); MarkNativeAsOptional("PbReadInt"); MarkNativeAsOptional("PbReadFloat"); MarkNativeAsOptional("PbReadBool"); MarkNativeAsOptional("PbReadString"); MarkNativeAsOptional("PbReadColor"); MarkNativeAsOptional("PbReadAngle"); MarkNativeAsOptional("PbReadVector"); MarkNativeAsOptional("PbReadVector2D"); MarkNativeAsOptional("PbGetRepeatedFieldCount"); MarkNativeAsOptional("PbSetInt"); MarkNativeAsOptional("PbSetFloat"); MarkNativeAsOptional("PbSetBool"); MarkNativeAsOptional("PbSetString"); MarkNativeAsOptional("PbSetColor"); MarkNativeAsOptional("PbSetAngle"); MarkNativeAsOptional("PbSetVector"); MarkNativeAsOptional("PbSetVector2D"); MarkNativeAsOptional("PbAddInt"); MarkNativeAsOptional("PbAddFloat"); MarkNativeAsOptional("PbAddBool"); MarkNativeAsOptional("PbAddString"); MarkNativeAsOptional("PbAddColor"); MarkNativeAsOptional("PbAddAngle"); MarkNativeAsOptional("PbAddVector"); MarkNativeAsOptional("PbAddVector2D"); MarkNativeAsOptional("PbRemoveRepeatedFieldValue"); MarkNativeAsOptional("PbReadMessage"); MarkNativeAsOptional("PbReadRepeatedMessage"); MarkNativeAsOptional("PbAddMessage"); VerifyCoreVersion(); return 0; } bool:StrEqual(String:str1[], String:str2[], bool:caseSensitive) { return strcmp(str1, str2, caseSensitive) == 0; } PrintToChatAll(String:format[]) { decl String:buffer[192]; new i = 1; while (i <= MaxClients) { if (IsClientInGame(i)) { SetGlobalTransTarget(i); VFormat(buffer, 192, format, 2); PrintToChat(i, "%s", buffer); } i++; } return 0; } AddFileToDownloadsTable(String:filename[]) { static table = -1; if (table == -1) { table = FindStringTable("downloadables"); } new bool:save = LockStringTables(false); AddToStringTable(table, filename, "", -1); LockStringTables(save); return 0; } TE_SendToAll(Float:delay) { new total; new clients[MaxClients]; new i = 1; while (i <= MaxClients) { if (IsClientInGame(i)) { total++; clients[total] = i; } i++; } return TE_Send(clients, total, delay); } public OnPluginStart() { HookEvent("player_spawn", Event_PlayerSpawn, EventHookMode:1); RegConsoleCmd("say", Command_Medic, "", 0); RegConsoleCmd("say_team", Command_Medic, "", 0); RegAdminCmd("css_medic_set", SetMedic_CMD, 16384, "", "", 0); RegAdminCmd("css_medic_del", DelMedic_CMD, 16384, "", "", 0); CreateConVar("cssmedic_version", "1.1", "CSS Medic Version", 270656, false, 0.0, false, 0.0); gPluginEnabled = CreateConVar("css_medic", "1", "", 0, false, 0.0, false, 0.0); gMinHealth = CreateConVar("css_medic_minhealth", "50", "", 0, false, 0.0, false, 0.0); gHealthAmount = CreateConVar("css_medic_healhealth", "100", "", 0, false, 0.0, false, 0.0); gMedicCost = CreateConVar("css_medic_cost", "0", "", 0, false, 0.0, false, 0.0); gShowInChat = CreateConVar("css_medic_showcall", "1", "", 0, false, 0.0, false, 0.0); gMaxTimeUse = CreateConVar("css_medic_maxuse", "1", "", 0, false, 0.0, false, 0.0); gPlayerMoney = FindSendPropOffs("CCSPlayer", "m_iAccount"); return 0; } public OnMapStart() { if (g_hKv) { CloseHandle(g_hKv); } g_hKv = CreateKeyValues("Medic", "", ""); if (!FileToKeyValues(g_hKv, "addons/sourcemod/configs/medics.ini")) { SetFailState("Не удалось открыть файл 'addons/sourcemod/configs/medics.ini'"); } decl String:MedicSound[100]; FormatEx(MedicSound, 99, "sound/%s", "misc/medic.wav"); if (FileExists(MedicSound, false)) { AddFileToDownloadsTable(MedicSound); PrecacheSound("misc/medic.wav", true); } return 0; } public OnClientConnected(id) { gUsedMedic[id] = 0; iTimeMedic[id] = 0; return 0; } public OnClientDisconnect(id) { gUsedMedic[id] = 0; iTimeMedic[id] = 0; return 0; } public OnClientAuthorized(iClient, String:sAuth[]) { strcopy(sSteams[iClient], 21, sAuth); if (!IsFakeClient(iClient)) { KvRewind(g_hKv); iTimeMedic[iClient] = 0; if (KvJumpToKey(g_hKv, sAuth, false)) { new iExpired = KvGetNum(g_hKv, "expired", -1); new var1; if (iExpired == -1 || iExpired > GetTime({0,0})) { iTimeMedic[iClient] = iExpired; } else { iTimeMedic[iClient] = 0; KvDeleteThis(g_hKv); KvRewind(g_hKv); KeyValuesToFile(g_hKv, "addons/sourcemod/configs/medics.ini"); } } KvRewind(g_hKv); } return 0; } public Action:SetMedic_CMD(iClient, args) { if (args < 2) { ReplyToCommand(iClient, "css_medic_set <время_в_минутах> <steamid>"); return Action:3; } decl String:sBuffer[32]; GetCmdArg(2, sBuffer, 32); KvRewind(g_hKv); if (KvJumpToKey(g_hKv, sBuffer, true)) { GetCmdArg(1, sBuffer, 32); new iTime = StringToInt(sBuffer, 10); new var1; if (iTime) { var1 = iTime * 60 + GetTime({0,0}); } else { var1 = 0; } KvSetNum(g_hKv, "expired", var1); KvRewind(g_hKv); KeyValuesToFile(g_hKv, "addons/sourcemod/configs/medics.ini"); new i = 1; while (i < MaxClients) { if (IsClientInGame(i)) { OnClientAuthorized(i, sSteams[i]); } i++; } } return Action:3; } public Action:DelMedic_CMD(iClient, args) { if (args != 1) { ReplyToCommand(iClient, "css_medic_del <steamid>"); return Action:3; } new String:szSteam[64]; GetCmdArg(1, szSteam, 64); KvRewind(g_hKv); if (KvJumpToKey(g_hKv, szSteam, false)) { KvDeleteThis(g_hKv); KvRewind(g_hKv); KeyValuesToFile(g_hKv, "addons/sourcemod/configs/medics.ini"); ReplyToCommand(iClient, "У игрока (%s) убран доступ к медику.", szSteam); new i = 1; while (i < MaxClients) { if (IsClientInGame(i)) { OnClientAuthorized(i, sSteams[i]); } i++; } } else { ReplyToCommand(iClient, "STEAM_ID (%s) не найден в файле configs/medics.ini", szSteam); } return Action:3; } public Action:Event_PlayerSpawn(Handle:event, String:name[], bool:dontBroadcast) { if (GetConVarInt(gPluginEnabled) == 1) { new id = GetClientOfUserId(GetEventInt(event, "userid")); gUsedMedic[id] = 0; } return Action:0; } public Action:Command_Medic(id, args) { decl String:Said[128]; GetCmdArgString(Said, 127); StripQuotes(Said); TrimString(Said); new var1; if (StrEqual(Said, "!medic", true) || StrEqual(Said, "!med", true) || StrEqual(Said, "!m", true) || StrEqual(Said, "!медик", true) || StrEqual(Said, "!мед", true) || StrEqual(Said, "!м", true)) { if (!(iTimeMedic[id] == -1)) { new var2; if (iTimeMedic[id] && iTimeMedic[id] < GetTime({0,0})) { PrintToChat(id, "\x03[Медик] \x01 Нет доступа."); return Action:0; } new sec = iTimeMedic[id] - GetTime({0,0}); PrintToChat(id, "\x03[Медик] \x01 Доступ к медику закончиться через: %dд. %dч. %dм. %02dсек.", sec / 3600 / 24, sec / 3600 % 24, sec / 60 % 60, sec % 60); } if (GetConVarInt(gPluginEnabled)) { if (!IsPlayerAlive(id)) { PrintToChat(id, "\x03[Медик] \x01Вы не можете вызвать \x04медика \x01, т.к. вы мертвы!"); return Action:0; } new maxtime = GetConVarInt(gMaxTimeUse); if (gUsedMedic[id] >= maxtime) { PrintToChat(id, "\x03[Медик] \x01Вы можете вызвать \x04медика \x01только \x03%d \x01раз за раунд!", maxtime); return Action:0; } new money = GetClientMoney(id); new cost = GetConVarInt(gMedicCost); if (money < cost) { PrintToChat(id, "\x03[Медик] \x01У вас не хватает денег, чтобы вызвать \x04медика\x01! Вам надо %d$", cost); return Action:0; } if (GetConVarInt(gMinHealth) <= GetClientHealth(id)) { PrintToChat(id, "\x03[Медик] \x01У тебя здоровья больше \x0450 \x01! Возвращайся в бой!"); return Action:0; } gUsedMedic[id]++; SetEntProp(id, PropType:1, "m_iHealth", GetConVarInt(gHealthAmount), 4, 0); SetClientMoney(id, money - cost); PrintToChat(id, "\x03[Медик] \x01Вы были исцелены!"); if (GetConVarInt(gShowInChat)) { decl String:Name[32]; GetClientName(id, Name, 31); PrintToChatAll("\x03%s \x04Медик!", Name); } new Float:fOrigin[3] = 0.0; GetClientAbsOrigin(id, fOrigin); EmitAmbientSound("misc/medic.wav", fOrigin, id, 60, 0, 1.0, 100, 0.0); AttachClientIcon(id); } PrintToChat(id, "\x03[Медик] \x01У вас нет \x04медика\x01!"); return Action:0; } return Action:0; } SetClientMoney(index, money) { if (gPlayerMoney != -1) { SetEntData(index, gPlayerMoney, money, 4, false); } return 0; } GetClientMoney(index) { if (gPlayerMoney != -1) { return GetEntData(index, gPlayerMoney, 4); } return 0; } AttachClientIcon(index) { TE_Start("RadioIcon"); TE_WriteNum("m_iAttachToClient", index); TE_SendToAll(0.0); return 0; }
При обратном компиле на http://www.sourcemod.net/compiler.php выдаёт ошибки:
Скрытый текст
/groups/sourcemod/compiler-1.7/include/core.inc(296) : warning 209: function "__ext_core_SetNTVOptional" should return a value /groups/sourcemod/compiler-1.7/include/halflife.inc(337) : warning 209: function "PrintToChatAll" should return a value /groups/sourcemod/upload_tmp/textPTssPr.sp(8) : error 021: symbol already defined: "NULL_VECTOR" /groups/sourcemod/upload_tmp/textPTssPr.sp(9) : error 021: symbol already defined: "NULL_STRING" /groups/sourcemod/upload_tmp/textPTssPr.sp(17) : error 021: symbol already defined: "MaxClients" /groups/sourcemod/upload_tmp/textPTssPr.sp(44) : error 021: symbol already defined: "__ext_core_SetNTVOptional" /groups/sourcemod/upload_tmp/textPTssPr.sp(112) : error 181: function argument named 'str1' differs from prototype /groups/sourcemod/upload_tmp/textPTssPr.sp(112) : error 021: symbol already defined: "StrEqual" /groups/sourcemod/upload_tmp/textPTssPr.sp(117) : error 181: function argument named 'format' differs from prototype /groups/sourcemod/upload_tmp/textPTssPr.sp(117) : error 021: symbol already defined: "PrintToChatAll" /groups/sourcemod/upload_tmp/textPTssPr.sp(139) : error 017: undefined symbol "FindStringTable" /groups/sourcemod/upload_tmp/textPTssPr.sp(141) : error 017: undefined symbol "LockStringTables" /groups/sourcemod/upload_tmp/textPTssPr.sp(141) : warning 213: tag mismatch /groups/sourcemod/upload_tmp/textPTssPr.sp(142) : error 017: undefined symbol "AddToStringTable" /groups/sourcemod/upload_tmp/textPTssPr.sp(143) : error 017: undefined symbol "LockStringTables" /groups/sourcemod/upload_tmp/textPTssPr.sp(161) : error 017: undefined symbol "TE_Send" /groups/sourcemod/upload_tmp/textPTssPr.sp(179) : warning 213: tag mismatch /groups/sourcemod/upload_tmp/textPTssPr.sp(164) : error 180: function return type differs from prototype. expected 'void', but got 'int' /groups/sourcemod/upload_tmp/textPTssPr.sp(200) : warning 213: tag mismatch /groups/sourcemod/upload_tmp/textPTssPr.sp(182) : error 180: function return type differs from prototype. expected 'void', but got 'int' /groups/sourcemod/upload_tmp/textPTssPr.sp(207) : warning 213: tag mismatch /groups/sourcemod/upload_tmp/textPTssPr.sp(203) : error 180: function return type differs from prototype. expected 'void', but got 'int' /groups/sourcemod/upload_tmp/textPTssPr.sp(214) : warning 213: tag mismatch /groups/sourcemod/upload_tmp/textPTssPr.sp(210) : error 180: function return type differs from prototype. expected 'void', but got 'int' /groups/sourcemod/upload_tmp/textPTssPr.sp(217) : error 181: function argument named 'sAuth' differs from prototype /groups/sourcemod/upload_tmp/textPTssPr.sp(227) : warning 203: symbol is never used: "var1" /groups/sourcemod/upload_tmp/textPTssPr.sp(242) : warning 213: tag mismatch /groups/sourcemod/upload_tmp/textPTssPr.sp(217) : error 180: function return type differs from prototype. expected 'void', but got 'int' /groups/sourcemod/upload_tmp/textPTssPr.sp(338) : warning 203: symbol is never used: "var2" /groups/sourcemod/upload_tmp/textPTssPr.sp(384) : error 017: undefined symbol "EmitAmbientSound" /groups/sourcemod/upload_tmp/textPTssPr.sp(333) : warning 203: symbol is never used: "var1" /groups/sourcemod/upload_tmp/textPTssPr.sp(413) : error 017: undefined symbol "TE_Start" /groups/sourcemod/upload_tmp/textPTssPr.sp(414) : error 017: undefined symbol "TE_WriteNum"
Как это можно исправить?
Прикрепленные файлы
- Medic.sp 10,68К 2 Количество загрузок: