Sziasztok! Abban kérném a segítségeteket, hogy fordítsátok le nekem kérlek az sm_bank plugint Meg egy apró módosítást is legyetek szívesek végezni rajta, mégpedig azt hogy ugye amikor kiírja a szerverre hogy PL.: [SM_BANK] Sikeresen betettél 5000$ a bankodba. Nekem ez úgy kéne, hogy 3 szín legyen beleírva a forráskódba (Ez a példa hülyeség lesz, mert nem értek annyira hozzá csak így gondolom)
Példa:
PrintToChat(client, "%t", "Deposit usage", "\x04", "\x01", "\x03");
\x04 - Zöld írás => \x03 - Alap c.sárga szín => \x01 - Csapat színek (CT - kék <=> T - piros)
TERMÉSZETESEN A KÖSZI MEGLESZ!
UI.: Gondoltam adok egy kis munkát az itt dolgozó uraknak hogy ne unatkozzanak (és persze hogy ne álljon itt üresen szegény TOPIC)
Forráskód:
#pragma semicolon 1 /* * SM Bank * by MaTTe (mateo10) */ #define VERSION "1.0" public Plugin:myinfo = { name = "SM Bank", author = "MaTTe", description = "Player is allowed to put money in his bank, and take them out when he needs them", version = VERSION, url = "http://www.sourcemod.net/" }; new g_iBank[MAXPLAYERS + 1]; new g_iAccount = -1; public OnPluginStart() { CreateConVar("smbank_version", VERSION, "SM Bank Version", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY); LoadTranslations("plugin.smbank"); RegConsoleCmd("deposit", Deposit); RegConsoleCmd("withdraw", WithDraw); RegConsoleCmd("bankstatus", BankStatus); g_iAccount = FindSendPropOffs("CCSPlayer", "m_iAccount"); HookEvent("round_start", EventRoundStart); } public OnClientPutInServer(client) { g_iBank[client] = 0; } public EventRoundStart(Handle:event, const String:name[], bool:dontBroadcast) { PrintToChatAll("%t", "Available commands", "\x04", "\x01"); } public Action:Deposit(client, args) { if(args < 1) { PrintToChat(client, "%t", "Deposit usage", "\x04", "\x01"); return Plugin_Handled; } new String:szCmd[12]; GetCmdArg(1, szCmd, sizeof(szCmd)); if(StrEqual(szCmd, "all")) { g_iBank[client] += GetMoney(client); PrintToChat(client, "%t", "Deposit successfully", GetMoney(client), "\x04", "\x01"); SetMoney(client, 0); } else { new iMoney = StringToInt(szCmd); if(GetMoney(client) < iMoney) { PrintToChat(client, "%t", "Deposit not enough money", "\x04", "\x01"); } else { g_iBank[client] += iMoney; SetMoney(client, GetMoney(client) - iMoney); PrintToChat(client, "%t", "Deposit successfully", iMoney, "\x04", "\x01"); } } return Plugin_Handled; } public Action:WithDraw(client, args) { if(args < 1) { PrintToChat(client, "%t", "Withdraw usage", "\x04", "\x01"); } new String:szCmd[12]; GetCmdArg(1, szCmd, sizeof(szCmd)); if(StrEqual(szCmd, "all")) { new iBalance = 16000 - GetMoney(client); if(g_iBank[client] < iBalance) { SetMoney(client, GetMoney(client) + g_iBank[client]); PrintToChat(client, "%t", "Withdraw successfully", g_iBank[client], "\x04", "\x01"); g_iBank[client] = 0; } else { SetMoney(client, 16000); PrintToChat(client, "%t", "Withdraw successfully", iBalance, "\x04", "\x01"); g_iBank[client] -= iBalance; } } else { new iMoney = StringToInt(szCmd); if(g_iBank[client] < iMoney) { PrintToChat(client, "%t", "Withdraw not enough money", "\x04", "\x01"); return Plugin_Handled; } if(GetMoney(client) + iMoney <= 16000) { SetMoney(client, GetMoney(client) + iMoney); PrintToChat(client, "%t", "Withdraw successfully", iMoney, "\x04", "\x01"); g_iBank[client] -= iMoney; } else { PrintToChat(client, "%t", "Withdraw max error", "\x04", "\x01"); return Plugin_Handled; } } return Plugin_Handled; } public Action:BankStatus(client, args) { PrintToChat(client, "%t", "Bankstatus", g_iBank[client], "\x04", "\x01"); return Plugin_Handled; } public SetMoney(client, amount) { if(g_iAccount != -1) { SetEntData(client, g_iAccount, amount); } } public GetMoney(client) { if(g_iAccount != -1) { return GetEntData(client, g_iAccount); } return 0; }
plugin.smbank (Sima fordítás)
"Phrases" { "Available commands" { "#format" "{1:s}{2:s}" "en" "{1}[SM Bank]{2} Available commands are:{1} !deposit{2},{1} !withdraw{2} and{1} !bankstatus" } "Deposit usage" { "#format" "{1:s}{2:s}" "en" "{1}[SM Bank]{2} Usage: \"!deposit <amount / all>\"" } "Deposit successfully" { "#format" "{1:d}{2:s}{3:s}" "en" "{2}[SM Bank]{3} Successfully deposited ${1} to your bank!" } "Deposit not enough money" { "#format" "{1:s}{2:s}" "en" "{1}[SM Bank]{2} You do not have that amount of money!" } "Withdraw usage" { "#format" "{1:s}{2:s}" "en" "{1}[SM Bank]{2} Usage: \"!withdraw <amount / all>\"" } "Withdraw successfully" { "#format" "{1:d}{2:s}{3:s}" "en" "{2}[SM Bank]{3} Successfully withdrew ${1} from your bank" } "Withdraw not enough money" { "#format" "{1:s}{2:s}" "en" "{1}[SM Bank]{2} You do not have that amount of money in your bank" } "Withdraw max error" { "#format" "{1:s}{2:s}" "en" "{1}[SM Bank]{2} You cannot withdraw more than your max amount of money (16000)" } "Bankstatus" { "#format" "{1:d}{2:s}{3:s}" "en" "{2}[SM Bank]{3} Currently, you have ${1} in your bank" } }
Még egyszer köszönöm!
|