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

[forums.alliedmods.net] sixteenK


  • 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.04.2012 22:46

I was looking around for a while once for a mod that either allowed for a "/moneyme" or giving money at spawn. Since i couldn't find one i just went and wrote my own. This particular plugin does both, with both functions toggleable.

/moneyme gives $16000 instantly

CVARs:
amxx_16k 1 // <0|1> enables/disables the plugin entirely
amxx_16k_start 0 // <0|1> enables/disables 16000 given at spawn




PHP Code:

/* Script generated by Pawn Studio */

#include <amxmodx>
#include <amxmisc>
#include <cstrike>

#define PLUGIN "Sixteen K"
#define AUTHOR "LIverwiz"
#define VERSION "1.0"

new toggle_pcvar, spawn_pcvar

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
toggle_pcvar = register_cvar("amxx_16k", "1")
spawn_pcvar = register_cvar("amxx_16k_start", "0")

register_event("start", "start_money", "a", "1=Round_Start")
register_clcmd("say /moneyme", "give_money")
}

public
start_money()
{
new
toggle = get_pcvar_num(toggle_pcvar)
new
spawn = get_pcvar_num(spawn_pcvar)
if(
toggle == 1 && spawn == 1)
{
new
id_cnt, players[32], player_id
get_players
(players, id_cnt, "ch")

for(new
t=0; t<id_cnt; t++)
{
player_id = get_user_userid(players[t])
give_money(player_id)
}
}

return
PLUGIN_HANDLED
}

public
give_money(id)
{
new
toggle = get_pcvar_num(toggle_pcvar)
if(
toggle == 0)
return
PLUGIN_HANDLED

cs_set_user_money
(id, 16000)
client_print(id, print_chat, "[AMXX] You have been given $16000.")

return
PLUGIN_HANDLED
}


Mostly looking for some feedback. I'd love to know how it runs, and to see people using it. Enjoy!

Attached Files Dołączona grafika Get Plugin or Get Source (liver_sixteenK.sma - 1.1 KB)

Wyświetl pełny artykuł




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

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