Skocz do zawartości

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie

[TF2] Set Cash(Mann vs Machine mode)


  • Nie możesz napisać tematu
  • Zaloguj się, aby dodać odpowiedź
Brak odpowiedzi do tego tematu

#1 Adminek AMXX.PL

    Admin :)

  • Bot

Reputacja: 156
Profesjonalista

  • Postów:7 490
  • Lokalizacja:AMXX.PL
Offline

Napisano 16.08.2012 05:42

Description: Set target(s) cash for Mann vs Machine modeCvars:sm_setcash_version "1.0.0"Command:sm_setcash "target" "amount(0-32767)"Example Usage:sm_setcash @me 1000sm_setcash @all 0sm_setcash @red 10000sm_setcash ThatGuy 1337Note: I'm having trouble uploading the plugin for some reason, here is the code: SetCash PHP Code:

#pragma semicolon 1#define PLUGIN_VERSION "1.0.0"public Plugin:myinfo = { name = "Set Cash", author = "Tylerst", description = "Set target(s) cash for Mann vs Machine mode", version = PLUGIN_VERSION, }public APLRes:AskPluginLoad2(Handle:myself, bool:late, String:error[], err_max){ new String:Game[32]; GetGameFolderName(Game, sizeof(Game)); if(!StrEqual(Game, "tf")) { Format(error, err_max, "This plugin only works for Team Fortress 2"); return APLRes_Failure; } return APLRes_Success;}public OnPluginStart(){ LoadTranslations("common.phrases"); CreateConVar("sm_setcash_version", PLUGIN_VERSION, "SetCash", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY); RegAdminCmd("sm_setcash", Command_GiveCash, ADMFLAG_GENERIC, "Set target(s) cash for Mann vs Machine mode, Usage: sm_setcash "target" "amount(0-32767)"");}public Action:Command_GiveCash(client, args){ if(args != 2) { ReplyToCommand(client, "[SM] Usage: sm_setcash "target" "amount(0-32767)""); return Plugin_Handled; } new String:strTarget[MAX_TARGET_LENGTH], String:strCash[32], iCash, String:target_name[MAX_TARGET_LENGTH],target_list[MAXPLAYERS], target_count, bool:tn_is_ml; GetCmdArg(1, strTarget, sizeof(strTarget)); if((target_count = ProcessTargetString(strTarget, client, target_list, MAXPLAYERS, COMMAND_FILTER_CONNECTED, target_name, sizeof(target_name), tn_is_ml)) <= 0) { ReplyToTargetError(client, target_count); return Plugin_Handled; } GetCmdArg(2, strCash, sizeof(strCash)); iCash = StringToInt(strCash); if(iCash < 0) iCash = 0; if(iCash > 32767) iCash = 32767; for(new i = 0; i < target_count; i++) { SetEntProp(target_list[i], Prop_Send, "m_nCurrency", iCash); } return Plugin_Handled;}

Edit: Fixed code.

Wyświetl pełny artykuł




Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych