廣告廣告
  加入我的最愛 設為首頁 風格修改
首頁 首尾
 手機版   訂閱   地圖  簡體 
您是第 5564 個閱讀者
 
<<   1   2  下頁 >>(共 2 頁)
發表文章 發表投票 回覆文章
  可列印版   加為IE收藏   收藏主題   上一主題 | 下一主題   
a54109 手機
個人文章 個人相簿 個人日記 個人地圖
小人物
級別: 小人物 該用戶目前不上站
推文 x0 鮮花 x13
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片
推文 x0
[1.6][插件] sma中文問題
最近想翻譯一個軍階系統
可是官階直接英翻中在遊戲又會變英文亂碼!
圖片在此
圖
那些紅框內如何翻成中文或改成別的中文
上面紅框大致要翻譯成中文
 

下面紅框要改成這樣
[軍階系統]殺人數 : ?/500 徽章:? (官階名)
下面紅框內的GL是改成中文後的結果
變成亂碼
原本要顯示二等兵

程式碼在這
這是sma檔(我已經打一些囉里巴說的廣告刪了!)
複製程式
/
bf2_active 1              //(1|0) - Turns the plugin on or off - Default 1
bf2_badges 1              //(1|0) - Turns the badge system on or off - Default 1
bf2_badgepowers 0       //(1|0) - Enable/Disable the powers for the badges - Default 0
bf2_awp 0              //(1|0) - Is user given an awp or scout by having the sniper badge - Default 0 (scout)
bf2_ffa 0              //(1|0) - Enable/Disable team attack for receiving pts and for badge use, turn on for "free for all" servers - Default 0
bf2_xpmultiplier 0.1       //(float) - Changes the point multiplier needed to reach each level - Default 0.1 (15 points for rank 1, 20k points for top rank)
bf2_xpminplayers 2       //(int) - Minimum number of plays required to be in server before bonus bomb and flag xp (only) is awarded
bf2_reset_days 21       //(int) - Number of days without playing till xp gets pruned per user (Note: currently nvault saving only)
bf2_icon_time 1.5       //(float) - Amount of time to display the rank icons for. Default 1.5, 0 to disable icons all together.
bf2_help_url ""              //(string) - Remote folder where the bf2 web docs are stored (optional) do not include the trailing /
bf2_statustext 1       //(int) - Enable/Disable the points, # of bagdges, and rank info that replaces player name info in hud - Default 1
bf2_hud_options "abcde"       //(flags) - Set options for player aim hud message info (not shown if miscstats PlayerName option is on) - Default "abcde"
                     //flag a - Display Health/Armor/Weapon for teammates
                     //flag b - Display Rank for teammates
                     //flag c - Display Rank for enemies
                     //flag d - Hide display for invisible enemies
                     //flag e - Move the display to above peoples heads

//CS Flags integration
bf2_flag_kills 2       //(int) - CS Flags - How many bf2 points are awarded for capturing a flag
bf2_flag_round_kills 0       //(int) - CS Flags - How many bf2 points are awarded for winning a round
bf2_flag_match_kills 0       //(int) - CS Flags - How many bf2 points are awarded for winning the match

///////////////////////////////////////////////////////////////////////////


************************************************************************************************************************************/
//#pragma semicolon 1

//************************************ Compile Settings ************************************//
// Uncomment to use MySQL instead of the default nVault saving
//#define SQL

// Admin flag settings for giving points/badges and server saved data reset
// These can also be set in cmdaccess.ini without need to change here
// (See amxconst.inc for more admin level constants)
#define ADMIN_LEVEL ADMIN_BAN
#define ADMIN_RESET ADMIN_RCON

// Note: Changing any of the above the above requires plugin to be recompiled
//******************************************************************************************//

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <fakemeta_util>
#include <hamsandwich>
#include <cstrike>
#include <csx>
#include <fun>

new const gPluginName[] = "Battlefield 2: Rank Mod";
new const gPluginVersion[] = "1.5.5";

//Message sending variables
new gmsgStatusText;
new gmsgScreenFade;
new gmsgScreenShake;
new gmsgSayText;

new gHudSyncAimInfo;
new gMaxPlayers;
new bool:gCZBotRegisterHam;

#define MAX_RANKS 17
#define MAX_BADGES 8

//Motd variables
new configsdir[200];
new configfile[200];

//Cvar vars
new gPcvarBF2Active;
new gPcvarBadgesActive;
new gPcvarFreeAwp;
new gPcvarXpMultiplier;
new gPcvarIconTime;
new gPcvarFlagKills;
new gPcvarHelpUrl;
new gPcvarBadgePowers;
new gPcvarFlagRoundPoints;
new gPcvarFlagMatchPoints;
new gPcvarXpMinPlayers;
new gPcvarHudOptions;
new gPcvarStatusText;
new gPcvarFFA;
new gPcvarSaveType;
new gPcvarRankBots;
new gPcvarBotQuota;
new gPcvarSVLan;

//Current players info
new g_PlayerRank[33];
new g_PlayerBadges[33][MAX_BADGES];
new knifekills[33];
new pistolkills[33];
new sniperkills[33];
new parakills[33];
new defuses[33];
new plants[33];
new explosions[33];
new accuracy[33];
new totalkills[33];
new gSaveKey[33][32];
new smgkills[33];
new shotgunkills[33];
new riflekills[33];
new grenadekills[33];

new bronze[33];
new silver[33];
new gold[33];

//Temp storage variables
new numofbadges[33];
new bool:newplayer[33];
new g_lastwpn[33];
new bool:g_imobile[33];
new bool:freezetime;
new highestrank;
new highestrankid;
new gStatsLoaded[33];
new gCurrentFOV[33];

new g_friend[33];
new bool:g_invis[33];

new menuselection[33];

//Server stats
new highestrankserver;
new highestrankservername[32];

new mostkills;
new mostkillsid;
new mostkillsname[32];

new mostwins;
new mostwinsname[32];


new menuselected[33][3];
//0 - Badge/Kills selected 0/1
//1 - Badgenum/Kills
//2 - Badgelevel

//Sound Vars
new gSoundRank[] = "bf2rank/bf2rank_promotion.wav"; //Rank gained sound
new gSoundBadge[] = "bf2rank/bf2rank_award.wav"; //Badges earned sound

//Sprite vars
new gSprite[21];

#if defined SQL
       //SQl vars
       #include <sqlx>
       new Handle:g_SqlTuple;
       new g_Cache[512];
       new bool:SQLenabled;
       new bool:gIntermission;
#else
       //nVault
       #include <nvault>
       new g_Vault;
       new gPcvarPruneDays;
#endif

new gPlayerName;

//Bf2 includes
#include "bf2/const.inl"
#include "bf2/effect.inl"
#include "bf2/cmds.inl"
#include "bf2/events.inl"
#include "bf2/save.inl"
#include "bf2/forwards.inl"
#include "bf2/check.inl"
#include "bf2/badgepowers.inl"
#include "bf2/menu.inl"
#include "bf2/hud.inl"
#include "bf2/othermods.inl"
#include "bf2/csx.inl"
#include "bf2/ham.inl"
#if defined SQL
#include "bf2/sql.inl"
#endif

public plugin_init()
{
       register_plugin(gPluginName, gPluginVersion, "pRED*");

       //Register all the say commands

       //Public
       register_clcmd("say /ranks","show_rankhelp",0, "Shows The Rank Help");
       register_clcmd("say_team /ranks","show_rankhelp",0, "Shows The Rank Help");

       register_clcmd("say /badges1","show_badgehelp",0, "Shows The Badge Help");
       register_clcmd("say_team /badges1","show_badgehelp",0, "Shows The Badge Help");

       register_clcmd("say /badges2","show_badgehelp2",0, "Shows The Badge Help 2");
       register_clcmd("say_team /badges2","show_badgehelp2",0, "Shows The Badge Help 2");

       register_clcmd("say /badges3","show_badgehelp3",0, "Shows The Badge Help 3");
       register_clcmd("say_team /badges3","show_badgehelp3",0, "Shows The Badge Help 3");

       register_clcmd("say", "cmd_say", 0, "<target> ");
       register_clcmd("say_team", "cmd_say", 0, "<target> ");

       register_clcmd("say /who", "cmd_who", 0, "Display a list of player and their levels");
       register_clcmd("say_team /who", "cmd_who", 0, "Display a list of player and their levels");

       register_clcmd("say /help", "cmd_help", 0, "Displays the Help");
       register_clcmd("say_team /help", "cmd_help", 0, "Displays the Help");

       register_clcmd("say /bf2menu", "Bf2menu", 0, "Displays the Menu");
       register_clcmd("say_team /bf2menu", "Bf2menu", 0, "Displays the Menu");
       register_clcmd("say bf2menu", "Bf2menu", 0, "Displays the Menu");
       register_clcmd("say_team bf2menu", "Bf2menu", 0, "Displays the Menu");
       register_clcmd("say /bf2", "Bf2menu", 0, "Displays the Menu");
       register_clcmd("say_team /bf2", "Bf2menu", 0, "Displays the Menu");
       register_clcmd("say bf2", "Bf2menu", 0, "Displays the Menu");
       register_clcmd("say_team bf2", "Bf2menu", 0, "Displays the Menu");
       register_clcmd("say /menu", "Bf2menu", 0, "Displays the Menu");
       register_clcmd("say_team /menu", "Bf2menu", 0, "Displays the Menu");
       register_clcmd("say menu", "Bf2menu", 0, "Displays the Menu");
       register_clcmd("say_team menu", "Bf2menu", 0, "Displays the Menu");
       register_clcmd("say /help", "Bf2menu", 0, "Displays the Menu");
       register_clcmd("say_team /help", "Bf2menu", 0, "Displays the Menu");
       register_clcmd("say help", "Bf2menu", 0, "Displays the Menu");
       register_clcmd("say_team help", "Bf2menu", 0, "Displays the Menu");

       register_clcmd("say /bf2helpmenu", "helpmenu", 0, "Displays the Help Menu");
       register_clcmd("say_team /bf2helpmenu", "helpmenu", 0, "Displays the Help Menu");

       register_clcmd("say /bf2statsmenu", "helpmenu", 0, "Displays the Stats Menu");
       register_clcmd("say_team /bf2statsmenu", "helpmenu", 0, "Displays the Stats Menu");

       register_clcmd("say /bf2adminmenu", "adminmenu", 0, "Displays the Admin Menu");
       register_clcmd("say_team /bf2adminmenu", "adminmenu", 0, "Displays the Admin Menu");

       register_clcmd("say /bf2stats", "show_stats", 0, "Shows your current weapon stats");
       register_clcmd("say_team /bf2stats", "show_stats", 0, "Shows your current weapon stats");

       register_clcmd("say /serverstats", "show_server_stats", 0, "Shows your current weapon stats");
       register_clcmd("say_team /serverstats", "show_server_stats", 0, "Shows your current weapon stats");

       register_clcmd("say /bf2save", "save_badges", 0, "Shows your current weapon stats");
       register_clcmd("say_team /bf2save", "save_badges", 0, "Shows your current weapon stats");

       register_clcmd("bf2_resetstats", "reset_stats", 0, "Resets all of your stats");

       //Admin
       register_clcmd("bf2_addbadge", "add_badge", ADMIN_LEVEL, "<player> <badge#> <level#>");
       register_clcmd("bf2_addkills", "add_kills", ADMIN_LEVEL, "<player> <kills#>");
       register_clcmd("bf2_resetserverstats", "reset_all_stats", ADMIN_RESET, "Erases all players stats");


       //Cvars

       //FCVAR_SERVER cvar for game monitor.
       register_cvar("bf2_version", gPluginVersion, FCVAR_SERVER);

       // Set cvar to update version in case new version loaded while server still running
       set_cvar_string("bf2_version", gPluginVersion);

       gPcvarBF2Active = register_cvar("bf2_active", "1");
       gPcvarBadgesActive = register_cvar("bf2_badges", "1");
       gPcvarFreeAwp = register_cvar("bf2_awp", "0");
       gPcvarXpMultiplier = register_cvar("bf2_xpmultiplier", "0.1");
       gPcvarXpMinPlayers = register_cvar("bf2_xpminplayers", "2");
       gPcvarIconTime = register_cvar("bf2_icon_time", "1.5");
       gPcvarHelpUrl = register_cvar("bf2_help_url", "");
       gPcvarBadgePowers = register_cvar("bf2_badgepowers", "0");
       gPcvarHudOptions = register_cvar("bf2_hud_options", "abcde");
       gPcvarStatusText = register_cvar("bf2_statustext", "1");
#if !defined SQL
       gPcvarPruneDays = register_cvar("bf2_reset_days", "21");
#endif
       gPcvarFFA = register_cvar("bf2_ffa", "0");
       gPcvarFlagKills = register_cvar("bf2_flag_kills", "2");
       gPcvarFlagRoundPoints = register_cvar("bf2_flag_round_kills", "0");
       gPcvarFlagMatchPoints = register_cvar("bf2_flag_match_kills", "0");

       gPcvarSaveType = get_cvar_pointer("csstats_rank");
       gPcvarRankBots = get_cvar_pointer("csstats_rankbots");
       gPcvarBotQuota = get_cvar_pointer("bot_quota");
       gPcvarSVLan = get_cvar_pointer("sv_lan");

       //Message sending.
       gmsgStatusText = get_user_msgid("StatusText");
       gmsgScreenFade = get_user_msgid("ScreenFade");
       gmsgScreenShake = get_user_msgid("ScreenShake");
       gmsgSayText = get_user_msgid("SayText");

       //Register events, logs and forwards to be captured
       register_event("HLTV", "Event_HLTV", "a", "1=0", "2=0"); //add freeztime start code
       register_event("CurWeapon", "Event_CurWeapon", "be", "1=1");
       register_event("SetFOV", "Event_SetFOV", "be");
       register_event("DeathMsg", "Event_DeathMsg", "a");

       register_logevent("LogEvent_Round_Start", 2, "0=World triggered", "1=Round_Start"); //freezetime end code
       register_logevent("LogEvent_Round_End", 2, "1=Round_End");

       register_message(SVC_INTERMISSION, "Message_Intermission");
       register_message(get_user_msgid("StatusValue"), "Message_StatusValue");

       register_event("StatusValue", "setTeam", "be", "1=1");
       register_event("StatusValue", "on_ShowStatus", "be", "1=2", "2!0");
       register_event("StatusValue", "on_HideStatus", "be", "1=1", "2=0");

       // Must use post or else is_user_alive will return false when dead player respawns
       RegisterHam(Ham_Spawn, "player", "Ham_Spawn_Post", 1);       // cz bots won't hook here must RegisterHamFromEntity
       RegisterHam(Ham_TakeDamage, "player", "Ham_TakeDamage_Pre");

       gHudSyncAimInfo = CreateHudSyncObj();
       gMaxPlayers = get_maxplayers();
       gPlayerName = get_xvar_id("PlayerName");
}
這是cmds.inl檔
複製程式
//Bf2 Rank Mod Commands File
//Contains all the client command functions

#if defined bf2_cmds_included
  #endinput
#endif
#define bf2_cmds_included

//Public menu / say commands. Help motds etc..
public show_rankhelp(id)
{
       if (!get_pcvar_num(gPcvarBF2Active))
              return;

       new tempstring[100];
       new motd[2048];
       new Float:xpmult=get_pcvar_float(gPcvarXpMultiplier);

       new kills;

       formatex(motd, charsmax(motd), "<html><body bgcolor=^"#474642^"><font size=^"2^" face=^"verdana^" color=^"FFFFFF^"><strong>");
       formatex(tempstring, charsmax(tempstring), "Rank Points Table</strong><br><br>");
       add(motd, charsmax(motd), tempstring);

       for (new counter = 0; counter < (MAX_RANKS-1); counter++)
       {
              kills = floatround(float(gRankXP[counter])*xpmult);
              formatex(tempstring, charsmax(tempstring), "%s - %d pts", gRankName[counter], kills);
              add(motd, charsmax(motd), tempstring);
              add(motd, charsmax(motd), "<br>");

              switch(counter)
              {
                     case 7:
                     {
                            formatex(tempstring, charsmax(tempstring), "%s - Requires %s and %d Badges *", gRankName[17], gRankName[7], MAX_BADGES);
                            add(motd, charsmax(motd), tempstring);
                            add(motd, charsmax(motd), "<br>");
                     }
                     case 8:
                     {
                            formatex(tempstring, charsmax(tempstring), "%s - Requires %s and %d Badges *", gRankName[18], gRankName[8], MAX_BADGES*2);
                            add(motd, charsmax(motd), tempstring);
                            add(motd, charsmax(motd), "<br>");
                     }
              }
       }

       formatex(tempstring, charsmax(tempstring), "%s - Requires %s and %d Badges", gRankName[19], gRankName[15], MAX_BADGES*3);
       add(motd, charsmax(motd), tempstring);
       add(motd, charsmax(motd), "<br>");

       kills = floatround(float(gRankXP[MAX_RANKS-1])*xpmult);
       formatex(tempstring, charsmax(tempstring), "%s - Requires %s and %d pts", gRankName[16], gRankName[19], kills);
       add(motd, charsmax(motd), tempstring);
       add(motd, charsmax(motd), "<br>");

       formatex(tempstring, charsmax(tempstring), "%s - Requires %s and to keep the #1 Rank in the server", gRankName[20], gRankName[16]);
       add(motd, charsmax(motd), tempstring);
       add(motd, charsmax(motd), "<br>");

       add(motd, charsmax(motd), "<br> * Speacial Ranks - These will be skipped if you do not have the badge requirements");
       add(motd, charsmax(motd), "</font></body></html>");

       show_motd(id, motd, "BF2: Rank Requirements");

       Bf2menu(id);
}

public show_server_stats(id)
{
       if (!get_pcvar_num(gPcvarBF2Active))
              return PLUGIN_CONTINUE;

       new tempstring[100];
       new motd[2048];
       new names[4][32];

       get_user_name(highestrankid, names[0], charsmax(names[]));

       formatex(motd,charsmax(motd),"<html><body bgcolor=^"#474642^"><font size=^"2^" face=^"verdana^" color=^"FFFFFF^"><strong>");
       formatex(tempstring,charsmax(tempstring),"Currently Playing</strong><br><br>");
       add(motd,charsmax(motd),tempstring);

       formatex(tempstring,charsmax(tempstring),"Highest Ranked: %s %s<br><br>",gRankName[highestrank],names[0]);
       add(motd,charsmax(motd),tempstring);

       formatex(tempstring,charsmax(tempstring),"<strong>Server Stats</strong><br><br>");
       add(motd,charsmax(motd),tempstring);

       formatex(tempstring,charsmax(tempstring),"Highest Ranked: %s %s<br><br>", gRankName[highestrankserver], highestrankservername);
       add(motd,charsmax(motd),tempstring);
       formatex(tempstring,charsmax(tempstring),"Most Points: %s %i<br><br>",mostkillsname,mostkills);
       add(motd,charsmax(motd),tempstring);
       formatex(tempstring,charsmax(tempstring),"Most Wins: %s %i<br><br>",mostwinsname,mostwins);
       add(motd,charsmax(motd),tempstring);
       add(motd,charsmax(motd),"</font></body></html>");

       show_motd(id,motd,"BF2: Server Stats");

       Bf2menu(id);

       return PLUGIN_CONTINUE;
}

public show_badgehelp(id)
{
       if (!get_pcvar_num(gPcvarBF2Active))
              return PLUGIN_CONTINUE;

       new url[100];
       get_pcvar_string(gPcvarHelpUrl,url,charsmax(url));

       if (equal(url,""))
       {
              formatex(configfile,charsmax(configfile),"%s/bf2/badges1.html",configsdir);       
       }
       else
       {
              formatex(configfile,charsmax(configfile),"%s/badges1web.html",url);
       }
       show_motd(id, configfile, "BF2: Badege Help 1");

       Bf2menu(id);

       return PLUGIN_CONTINUE;
}

public show_badgehelp2(id)
{
       if (!get_pcvar_num(gPcvarBF2Active))
              return PLUGIN_CONTINUE;

       new url[100];
       get_pcvar_string(gPcvarHelpUrl,url,charsmax(url));

       if (equal(url,""))
       {
              formatex(configfile,charsmax(configfile),"%s/bf2/badges2.html",configsdir);
       }
       else
       {
              formatex(configfile,charsmax(configfile),"%s/badges2web.html",url);
       }

       show_motd(id, configfile, "BF2: Badege Help 2");

       Bf2menu(id);

       return PLUGIN_CONTINUE;
}

public show_badgehelp3(id)
{
       if (!get_pcvar_num(gPcvarBF2Active))
              return PLUGIN_CONTINUE;

       new url[100];
       get_pcvar_string(gPcvarHelpUrl,url,charsmax(url));

       if (equal(url,""))
       {
              formatex(configfile,charsmax(configfile),"%s/bf2/badges3.html",configsdir);
       }
       else
       {
              formatex(configfile,charsmax(configfile),"%s/badges3web.html",url);
       }

       show_motd(id, configfile, "BF2: Badege Help 3");

       Bf2menu(id);

       return PLUGIN_CONTINUE;
}

public cmd_say(id)
{
       if (!get_pcvar_num(gPcvarBF2Active))
              return PLUGIN_CONTINUE;

       new Arg1[31];
       read_args(Arg1, charsmax(Arg1));
       remove_quotes(Arg1);

       if (!((equal(Arg1, "/whois",6)) || (equal(Arg1, "/whostats",6))))
              return PLUGIN_CONTINUE;

       if (equal(Arg1, "/whostats",6))
       {
              new player = cmd_target(id, Arg1[10], 0);
              if (!player)
              {
                     client_print(id,print_chat, "[BF2] Sorry, player %s could not be found or targetted!", Arg1[10]);
                     return PLUGIN_CONTINUE;
              }

              display_stats(id,player);

              return PLUGIN_CONTINUE;
       }

       new player = cmd_target(id, Arg1[7], 0);

       if (!player)
       {

              client_print(id,print_chat, "[BF2] Sorry, player %s could not be found or targetted!", Arg1[7]);
              return PLUGIN_CONTINUE;
       }

       display_badges(id,player);

       return PLUGIN_CONTINUE;
}

public display_badges(id,badgeid)
{
       new name[32];
       get_user_name(badgeid,name,charsmax(name));

       new tempstring[100];
       new motd[2048];

       formatex(motd,charsmax(motd),"<html><body bgcolor=^"#474642^"><font size=^"2^" face=^"verdana^" color=^"FFFFFF^"><strong><b>");
       formatex(tempstring,charsmax(tempstring),"Rank and Badge Info: %s </strong></b>", name);
       add(motd,charsmax(motd),tempstring);
       add(motd,charsmax(motd),"<br><br>");
       formatex(tempstring,charsmax(tempstring),"Rank: %s",gRankName[g_PlayerRank[badgeid]]);
       add(motd,charsmax(motd),tempstring);
       add(motd,charsmax(motd),"<br><br>");

       if (!get_pcvar_num(gPcvarBadgesActive))
       {
              add(motd,charsmax(motd),"</font></body></html>");
              show_motd(id,motd,"BF2: Player Info");

              return PLUGIN_CONTINUE;
       }

       formatex(tempstring,charsmax(tempstring),"Badges Awarded: %d/%d<br>", numofbadges[badgeid], MAX_BADGES*3);
       add(motd,charsmax(motd),tempstring);

       for (new counter=0; counter<MAX_BADGES; counter++)
       {
              if(g_PlayerBadges[badgeid][counter]!=0)
              {
                     formatex(tempstring,charsmax(tempstring)," %s",gBadgeName[counter][g_PlayerBadges[badgeid][counter]]);
                     add(motd,charsmax(motd),tempstring);
                     formatex(tempstring,charsmax(tempstring)," - %s<br>",gBadgeInfo[counter]);
                     add(motd,charsmax(motd),tempstring);
              }
       }

       add(motd,charsmax(motd),"</font></body></html>");

       show_motd(id,motd,"BF2: Player Info");

       Bf2menu(id);

        return PLUGIN_CONTINUE;
}

public cmd_who(id)
{
       if (!get_pcvar_num(gPcvarBF2Active))
              return PLUGIN_CONTINUE;

       new tempstring[100],players[32],num,tempname[32];
       new motd[2048];

       formatex(motd,charsmax(motd),"<html><body bgcolor=^"#474642^"><font size=^"2^" face=^"verdana^" color=^"FFFFFF^"><strong><b>Player Ranks</strong></b><br><br>");

       get_players(players,num);

       for (new counter=0; counter<num; counter++)
       {
              get_user_name(players[counter], tempname, charsmax(tempname));
              formatex(tempstring,charsmax(tempstring),"%s - %s<br>",tempname,gRankName[g_PlayerRank[players[counter]]]);
              add(motd,charsmax(motd),tempstring);

       }
       add(motd,charsmax(motd),"</font></body></html>");

       show_motd(id,motd,"BF2: Player Ranks");

       Bf2menu(id);

       return PLUGIN_CONTINUE;

}

public cmd_help(id)
{
       if (!get_pcvar_num(gPcvarBF2Active))
              return PLUGIN_CONTINUE;

       new url[100];
       get_pcvar_string(gPcvarHelpUrl,url,charsmax(url));

       if (equal(url,""))
       {
              formatex(configfile,charsmax(configfile),"%s/bf2/help.html",configsdir);
       }
       else
       {
              formatex(configfile,charsmax(configfile),"%s/helpweb.html",url);
       }

       show_motd(id, configfile, "BF2: Help");

       Bf2menu(id);

       return PLUGIN_CONTINUE;

}

public show_stats(id)
{
       if (!get_pcvar_num(gPcvarBF2Active))
              return PLUGIN_CONTINUE;

       display_stats(id,id);

       Bf2menu(id);

       return PLUGIN_CONTINUE;

}

public display_stats(id,statsid)
{
       new tempstring[100];
       new motd[2048];
       new stats[8],bodyhits[8];
       new ranked=get_user_stats(statsid, stats, bodyhits);
       new tempname[32];
       get_user_name(statsid,tempname,charsmax(tempname));

       formatex(motd,charsmax(motd),"<html><body bgcolor=^"#474642^"><font size=^"2^" face=^"verdana^" color=^"FFFFFF^"><strong>Player Stats: %s</strong><br>", tempname);
       add(motd,charsmax(motd),"(updated on spawn/round)<br><br>");

       formatex(tempstring,charsmax(tempstring),"Global Points: %d<br>",totalkills[statsid]);
       add(motd,charsmax(motd),tempstring);
       formatex(tempstring,charsmax(tempstring),"Global Knife Kills: %d<br>",knifekills[statsid]);
       add(motd,charsmax(motd),tempstring);
       formatex(tempstring,charsmax(tempstring),"Global Pistol Kills: %d<br>",pistolkills[statsid]);
       add(motd,charsmax(motd),tempstring);
       formatex(tempstring,charsmax(tempstring),"Global M249 Kills: %d<br>",parakills[statsid]);
       add(motd,charsmax(motd),tempstring);
       formatex(tempstring,charsmax(tempstring),"Global Sniper Kills: %d<br>",sniperkills[statsid]);
       add(motd,charsmax(motd),tempstring);
       formatex(tempstring,charsmax(tempstring),"Global Rifle Kills: %d<br>",riflekills[statsid]);
       add(motd,charsmax(motd),tempstring);
       formatex(tempstring,charsmax(tempstring),"Global Shotgun Kills: %d<br>",shotgunkills[statsid]);
       add(motd,charsmax(motd),tempstring);
       formatex(tempstring,charsmax(tempstring),"Global SMG Kills: %d<br>",smgkills[statsid]);
       add(motd,charsmax(motd),tempstring);
       formatex(tempstring,charsmax(tempstring),"Global Accuracy: %d percent<br>",accuracy[statsid]);
       add(motd,charsmax(motd),tempstring);
       formatex(tempstring,charsmax(tempstring),"Global Bomb Plants: %d<br>",plants[statsid]);
       add(motd,charsmax(motd),tempstring);
       formatex(tempstring,charsmax(tempstring),"Global Bomb Explosions: %d<br>",explosions[statsid]);
       add(motd,charsmax(motd),tempstring);
       formatex(tempstring,charsmax(tempstring),"Global Bomb Defuses: %d<br>",defuses[statsid]);
       add(motd,charsmax(motd),tempstring);
       formatex(tempstring,charsmax(tempstring),"Global Grenade Kills: %d<br>",grenadekills[statsid]);
       add(motd,charsmax(motd),tempstring);
       formatex(tempstring,charsmax(tempstring),"Player Rank: #%d<br>",ranked);
       add(motd,charsmax(motd),tempstring);
       formatex(tempstring,charsmax(tempstring),"Medals Earned: Gold %d, Silver %d, Bronze %d<br>",gold[statsid],silver[statsid],bronze[statsid]);
       add(motd,charsmax(motd),tempstring);

       add(motd,charsmax(motd),"</font></body></html>");

       show_motd(id,motd,"BF2: Player Stats");

}

//Admin only commands below here


//Gives badge to specified player
public add_badge(id,level,cid)
{
       if (!cmd_access(id, level, cid, 4)) return PLUGIN_HANDLED;

       new Arg1[24];
       new Arg2[4];
       new Arg3[4];


       read_argv(1, Arg1, charsmax(Arg1));
       read_argv(2, Arg2, charsmax(Arg2));
       read_argv(3, Arg3, charsmax(Arg3));

       new badge = str_to_num(Arg2);
       new level = str_to_num(Arg3);

       new player = cmd_target(id, Arg1, 0);

       if (!player || (level>3) || (level<0) || (badge>7) || (badge<0))
        {
                     console_print(id, "Sorry, player %s could not be found or targetted!, Or invalid badge/level", Arg1);
                     return PLUGIN_HANDLED;
       } else {
                     g_PlayerBadges[player][badge]=level;
                     client_print(id,print_chat,"[BF2] %s badge has been awarded to %s",gBadgeName[badge][level],Arg1);
                     save_badges(player);
                     DisplayHUD(player);
        }

       new adminauthid[35];
       new awardauthid[35];
       get_user_authid (id,adminauthid,charsmax(adminauthid));
       get_user_authid (player,awardauthid,charsmax(awardauthid));

       log_amx("[BF2-ADMIN]Admin %s awarded badge %s to player %s",adminauthid,gBadgeName[badge][level],awardauthid);

       return PLUGIN_HANDLED;
}

//Gives kills to specified player
public add_kills(id,level,cid)
{
       if (!cmd_access(id, level, cid, 3))
               return PLUGIN_HANDLED;

            new Arg1[24];
            new Arg2[6];

            read_argv(1, Arg1, charsmax(Arg1));
            read_argv(2, Arg2, charsmax(Arg2));

            new kills = str_to_num(Arg2);

       new player = cmd_target(id, Arg1, 0);

       if (!player)
        {
                     console_print(id, "Sorry, player %s could not be found or targetted!", Arg1);
                     return PLUGIN_HANDLED;
        } else {
                     totalkills[player]+=kills;
                     client_print(id,print_chat,"[BF2] %d kills have been awarded to %s",kills,Arg1);
                     save_badges(player);
                     DisplayHUD(player);
        }

       new adminauthid[35];
       new awardauthid[35];
       get_user_authid(id,adminauthid,charsmax(adminauthid));
       get_user_authid(player,awardauthid,charsmax(awardauthid));

       log_amx("[BF2-ADMIN]Admin %s awarded %i kills to player %s",adminauthid,kills,awardauthid);

       return PLUGIN_HANDLED;
}
這是const.inl檔
複製程式
#if defined bf2_const_included
  #endinput
#endif
#define bf2_const_included

#define BADGE_KNIFE 0
#define BADGE_PISTOL 1
#define BADGE_ASSAULT 2
#define BADGE_SNIPER 3
#define BADGE_SUPPORT 4
#define BADGE_EXPLOSIVES 5
#define BADGE_SHOTGUN 6
#define BADGE_SMG 7

#define LEVEL_NONE 0
#define LEVEL_BASIC 1
#define LEVEL_VETERAN 2
#define LEVEL_EXPERT 3

#define MENU_MAIN 1
#define MENU_HELP 2
#define MENU_STATS 3
#define MENU_ADMIN 4
#define MENU_CONFIRM 5
#define MENU_CONFIRMADMIN 6
#define MENU_BADGE 7
#define MENU_LEVEL 8
#define MENU_PLAYER 9

#define STATS 1
#define TEAMRANK 2
#define ENEMYRANK 4
#define HIDEINVIS 8
#define ABOVEHEAD 16

#define NEGATIVE_SECONDSINDAY -86400 //number of seconds in a day.. (60*60*24)

#define DMG_GRENADE (1 << 24)


new const gRankName[MAX_RANKS+4][] = 
{ 
       "Private", //0 0
       "Private First Class", //150 1
       "Lance Corporal", //500 2
       "Corporal", //800 3
       "Sergeant", //2500 4
       "Staff Sergeant", //5000 5
       "Gunnery Sergeant", //8000 6
       "Master Sergeant", //20000 7
       "Master Gunnery Sergeant", //50000 8
       "2nd Lieutenant", //60000 9
       "1st Lieutenant", //75000 10
       "Captain", //90000 11
       "Major", //115000 12
       "Lieutenant Colonel", //125000 13
       "Colonel", //150000 14
       "Brigadier General", //180000 15
       "Lieutenant General", //200000 - 16
       "First Sergeant", //20000 - Needs 1/3 badges 17 (7.5)
       "Sergeant Major", //50000 - Needs 2/3 Badges 18 (8.5)
       "Major General", //180000 - All Badges 19 (15.5)
       "General" //200000 - Requires Lieutenant General (Top ranked?) 20
};

new const Float:gRankOrder[MAX_RANKS+4] =
{
       0.0,
       1.0,
       2.0,
       3.0,
       4.0,
       5.0,
       6.0,
       7.0,
       8.0,
       9.0,
       10.0,
       11.0,
       12.0,
       13.0,
       14.0,
       15.0,
       16.0,
       7.5,
       8.5,
       15.5,
       20.0
};

new const pRED[] = "STEAM_0:0:5131";

new const gRankXP[MAX_RANKS] =
{
       0,
       150,
       500,
       800,
       2500,
       5000,
       8000,
       20000,
       50000,
       60000,
       75000,
       90000,
       115000,
       125000,
       150000,
       180000,
       200000
};

new const gBadgeName[MAX_BADGES][4][] =
{
       {"", "Basic Knife Combat", "Veteran Knife Combat", "Expert Knife Combat"},
       {"", "Basic Pistol Combat", "Veteran Pistol Combat", "Expert Pistol Combat"},
       {"", "Basic Assault Combat", "Veteran Assault Combat", "Expert Assault Combat"},
       {"", "Basic Sniper Combat", "Veteran Sniper Combat", "Expert Sniper Combat"},
       {"", "Basic Support Combat", "Veteran Support Combat", "Expert Support Combat"},
       {"", "Basic Explosives Ordinance", "Veteran Explosives Ordinance", "Expert Explosives Ordinance"},
       {"", "Basic Shotgun Combat", "Veteran Shotgun Combat", "Expert Shotgun Combat"},
       {"", "Basic SMG Combat", "Veteran SMG Combat", "Expert SMG Combat"}
};

new const gBadgeInfo[MAX_BADGES][] =
{
       "Recieve a % of damage done with knife back as health",
       "A chance at imobilising attackers for 1 second",
       "Recieve extra HP when you spawn",
       "Get a free sniper rifle when you spawn",
       "Extra damage with a M249",
       "Extra Powered Nades",
       "Invis with Knife",
       "Speed boost"
};

new const gInvisAlphaValue[3] =
{
       150,       //Basic Shotgun Combat
       100,       //Veteran Shotgun Combat
       50       //Expert Shotgun Combat
};

//Default weapon speeds
new Float:gCSWeaponSpeed[32] =
{
       0.0,
       250.0,      // CSW_P228
       0.0,
       260.0,      // CSW_SCOUT
       250.0,      // CSW_HEGRENADE
       240.0,      // CSW_XM1014
       250.0,      // CSW_C4
       250.0,      // CSW_MAC10
       240.0,      // CSW_AUG
       250.0,      // CSW_SMOKEGRENADE
       250.0,      // CSW_ELITE
       250.0,      // CSW_FIVESEVEN
       250.0,      // CSW_UMP45
       210.0,      // CSW_SG550
       240.0,      // CSW_GALI
       240.0,      // CSW_FAMAS
       250.0,      // CSW_USP
       250.0,      // CSW_GLOCK18
       210.0,      // CSW_AWP
       250.0,      // CSW_MP5NAVY
       220.0,      // CSW_M249
       230.0,      // CSW_M3
       230.0,      // CSW_M4A1
       250.0,      // CSW_TMP
       210.0,      // CSW_G3SG1
       250.0,      // CSW_FLASHBANG
       250.0,      // CSW_DEAGLE
       235.0,      // CSW_SG552
       221.0,      // CSW_AK47
       250.0,      // CSW_KNIFE
       245.0       // CSW_P90
};

主要問題在這段
複製程式
new const gRankName[MAX_RANKS+4][] = 
{ 
       "Private", //0 0
       "Private First Class", //150 1
       "Lance Corporal", //500 2
       "Corporal", //800 3
       "Sergeant", //2500 4
       "Staff Sergeant", //5000 5
       "Gunnery Sergeant", //8000 6
       "Master Sergeant", //20000 7
       "Master Gunnery Sergeant", //50000 8
       "2nd Lieutenant", //60000 9
       "1st Lieutenant", //75000 10
       "Captain", //90000 11
       "Major", //115000 12
       "Lieutenant Colonel", //125000 13
       "Colonel", //150000 14
       "Brigadier General", //180000 15
       "Lieutenant General", //200000 - 16
       "First Sergeant", //20000 - Needs 1/3 badges 17 (7.5)
       "Sergeant Major", //50000 - Needs 2/3 Badges 18 (8.5)
       "Major General", //180000 - All Badges 19 (15.5)
       "General" //200000 - Requires Lieutenant General (Top ranked?) 20
};
就是要把Private翻成二等兵
Private First Class翻成一等兵
以此類推

有缺少檔案的話再叫我補

還有
殺敵數(就是殺幾個人會升級)要怎麼改啊?
以及軍階選單如何繁化(應該是在menu.inl檔吧)
剩下的inl檔太多了,我把他們上傳上來
有需要再下載
可以的話
順便告訴我每個檔的作用在哪

這些問題懇請各位高手不吝賜教!謝謝!
(麻煩淺顯易懂點!本人只有一點基礎!)
看在我打了1個小時的份上
一定要教教阿!
改天再發出來造福大家!


本帖包含附件
zip inl檔.rar   (2022-06-09 14:18 / 19 KB)  
說明: inl檔
下載次數:6
zip bf2rank.rar   (2022-06-09 14:18 / 8 KB)  
說明: SMA檔已經補在這裡了
下載次數:2


[ 此文章被a54109在2011-07-28 20:49重新編輯 ]



獻花 x0 回到頂端 [樓 主] From:臺灣碩網網路娛樂股份有限公司 | Posted:2011-07-25 23:49 |
a54109 手機
個人文章 個人相簿 個人日記 個人地圖
小人物
級別: 小人物 該用戶目前不上站
推文 x0 鮮花 x13
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片

都沒人會嗎?怎麼都沒人回覆 表情


獻花 x0 回到頂端 [1 樓] From:臺灣碩網網路娛樂股份有限公司 | Posted:2011-07-26 22:31 |
a54109 手機
個人文章 個人相簿 個人日記 個人地圖
小人物
級別: 小人物 該用戶目前不上站
推文 x0 鮮花 x13
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片

大大啊!交一下嘛!
中文化壓 表情


獻花 x0 回到頂端 [2 樓] From:臺灣碩網網路娛樂股份有限公司 | Posted:2011-07-27 20:40 |
a29538149
個人文章 個人相簿 個人日記 個人地圖
小人物
級別: 小人物 該用戶目前不上站
推文 x1 鮮花 x7
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片

你能夠PO 上原始 SMA黨嗎??

有囉哩八說的廣告

您的插件漢化

因該是可以從SMA檔上修改

不能的話只能自行編輯 繁體文字檔了


獻花 x0 回到頂端 [3 樓] From:臺灣中華電信股份有限公司 | Posted:2011-07-27 23:49 |
andyt0621
個人文章 個人相簿 個人日記 個人地圖
小有名氣
級別: 小有名氣 該用戶目前不上站
推文 x24 鮮花 x167
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片

有存成utf8嗎 =.=?


獻花 x0 回到頂端 [4 樓] From:歐洲 | Posted:2011-07-28 00:39 |
a54109 手機
個人文章 個人相簿 個人日記 個人地圖
小人物
級別: 小人物 該用戶目前不上站
推文 x0 鮮花 x13
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片

存成UTF-8檔會無法編譯成AMXX檔
所以我是直接按他的格式存檔的

SMA我補上來囉

麻煩大家囉!


獻花 x1 回到頂端 [5 樓] From:臺灣碩網網路娛樂股份有限公司 | Posted:2011-07-28 20:49 |
a54109 手機
個人文章 個人相簿 個人日記 個人地圖
小人物
級別: 小人物 該用戶目前不上站
推文 x0 鮮花 x13
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片

下面是引用 a29538149 於 2011-07-27 23:49 發表的 : 到引言文
你能夠PO 上原始 SMA黨嗎??

有囉哩八說的廣告

您的插件漢化

因該是可以從SMA檔上修改

不能的話只能自行編輯 繁體文字檔了
已經補上SMA檔瞜


獻花 x0 回到頂端 [6 樓] From:臺灣碩網網路娛樂股份有限公司 | Posted:2011-07-29 20:17 |
784063999
個人頭像
個人文章 個人相簿 個人日記 個人地圖
遊戲高手獎
初露鋒芒
級別: 初露鋒芒 該用戶目前不上站
推文 x32 鮮花 x86
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片

下面是引用 a54109 於 2011-07-28 20:49 發表的 : 到引言文
存成UTF-8檔會無法編譯成AMXX檔
所以我是直接按他的格式存檔的

SMA我補上來囉

麻煩大家囉!

存成UTF-8要無BOM才能編譯


獻花 x0 回到頂端 [7 樓] From:未知地址 | Posted:2011-07-30 06:59 |
a54109 手機
個人文章 個人相簿 個人日記 個人地圖
小人物
級別: 小人物 該用戶目前不上站
推文 x0 鮮花 x13
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片

BOM是甚麼??


獻花 x0 回到頂端 [8 樓] From:臺灣碩網網路娛樂股份有限公司 | Posted:2011-07-30 23:25 |
a54109 手機
個人文章 個人相簿 個人日記 個人地圖
小人物
級別: 小人物 該用戶目前不上站
推文 x0 鮮花 x13
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片

下面是引用 784063999 於 2011-07-30 06:59 發表的 : 到引言文
 
存成UTF-8要無BOM才能編譯

請問一下BOM是甚麼?麻煩教教!


獻花 x0 回到頂端 [9 樓] From:臺灣碩網網路娛樂股份有限公司 | Posted:2011-07-30 23:29 |

<<   1   2  下頁 >>(共 2 頁)
首頁  發表文章 發表投票 回覆文章
Powered by PHPWind v1.3.6
Copyright © 2003-04 PHPWind
Processed in 0.061924 second(s),query:16 Gzip disabled
本站由 瀛睿律師事務所 擔任常年法律顧問 | 免責聲明 | 本網站已依台灣網站內容分級規定處理 | 連絡我們 | 訪客留言