a54109
|
分享:
▼
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个小时的份上 一定要教教阿! 改天再发出来造福大家!
本帖包含附件 |
|
inl档.rar
(2022-06-09 14:18 / 19 KB) 说明: inl档 |
下载次数: | 6 |
bf2rank.rar
(2022-06-09 14:18 / 8 KB) 说明: SMA档已经补在这里了 |
下载次数: | 2 |
[ 此文章被a54109在2011-07-28 20:49重新编辑 ]
|