Skocz do zawartości

  • Zaloguj korzystając z Facebooka Zaloguj korzystając z Twittera Zaloguj przez Steam Zaloguj poprzez Google      Logowanie »   
  • Rejestracja

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

problem z pokemon dollar


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

#1 P@TrOl

    Zaawansowany

  • Użytkownik

Reputacja: -1
Mniej niż zer0.

  • Postów:86
  • Imię:Patryk
  • Lokalizacja:Polska
Offline

Napisano 14.01.2013 11:51

witam chcialem przerobic pokemon dollar do własnych potrzeb ale wyskakuja błędy podczas compilacji pluginu
#include  #include  #include  #include  #define FLAGS ADMIN_IMMUNITY new g_PD[33], g_Save; new g_pKill, g_pBonus, g_pPayXp, g_pGiveXp, g_pPayLegend, g_pPayRandom, g_pRandomXpMin, g_pRandomXpMax, g_pGetXp, g_pSaveXp; public plugin_init() { register_plugin("Pokemon Dollar", "2.0", "Raku"); new sz_Dir[128]; get_configsdir(sz_Dir, charsmax(sz_Dir)); format(sz_Dir, charsmax(sz_Dir), "%s/pokemondollar.cfg", sz_Dir); server_cmd("exec %s", sz_Dir); register_dictionary("pokemondollar.txt"); g_Save = nvault_open("pdsave"); set_task(3.0, "Life", _, _, _, "b"); register_event("DeathMsg", "DeathMsg", "a"); register_concmd("pd_give", "GivePD", FLAGS," "); register_concmd("pd_take", "DeletePD", FLAGS," "); register_clcmd("say", "Send"); register_clcmd("say pdmenu", "pdmenu"); g_pSaveXp = register_cvar("pd_savexp", "2"); g_pKill = register_cvar("pd_kill", "3"); g_pBonus = register_cvar("pd_hs", "5"); g_pGetXp = register_cvar("pd_getxp", "1"); g_pPayXp = register_cvar("pd_costexp", "20");; g_pPayRandom = register_cvar("pd_costrandom", "20"); g_pGiveXp = register_cvar("pd_givexp", "1000"); g_pRandomXpMin = register_cvar("pd_minexp", "100"); g_pRandomXpMax = register_cvar("pd_maxexp", "1000"); if(file_exists( sz_Dir )){ return PLUGIN_HANDLED; } write_file(sz_Dir, "//Zapis PD (1 = STEAM_ID, 2 = Nick).", 0); write_file(sz_Dir, "pd_savexp 1", 2); write_file(sz_Dir, "//Ile gracz ma dostawać pd za zabicie przeciwnika.", 3); write_file(sz_Dir, "pd_kill 2", 3); write_file(sz_Dir, "//+Ile gracz ma dostawać pd za zabicie przeciwnika headshotem.", 6); write_file(sz_Dir, "pd_hs 2", 6); write_file(sz_Dir, "//Zdobywanie PD (1 = Normalne (Zabojstwo +HS), 2 = Gracz dostaje tyle PD ile zabity przez niego gracz ma fragów).", 9); write_file(sz_Dir, "pd_getxp 1", 10); write_file(sz_Dir, "//Ile kosztuje exp.", 12); write_file(sz_Dir, "pd_costexp 10", 13); write_file(sz_Dir, "//Ile kosztuje pralka.", 18); write_file(sz_Dir, "pd_costrandom 50", 19); write_file(sz_Dir, "//Ile ma dawac expa.", 21); write_file(sz_Dir, "pd_givexp 1000", 22); write_file(sz_Dir, "//Ile mamy dostawać minimalnie expa z pralki.", 24); write_file(sz_Dir, "pd_minexp 50", 25); write_file(sz_Dir, "//Ile mamy dostawać maksymalnie expa z pralki.", 27); write_file(sz_Dir, "pd_maxexp 200", 28); return PLUGIN_CONTINUE; } public client_connect(id) Load_PD(id); public client_disconnect(id) Save_PD(id); public plugin_end() nvault_close(g_Save); public Life() { new Players[32], Num, i, id; get_players( Players, Num, "a" ); for( i = 0; i < Num; i++ ) { id = Players[i]; set_hudmessage(255, 0, 0, 0.0, 0.88, 0, 6.0, 7.0); show_hudmessage(id, "Pokemon Dollar: %d", g_PD[id]); } } public pdmenu(id) { new menu = menu_create("\rPokemon Dollar Menu:", "pdmenu_select"); new i_Cost = get_pcvar_num(g_pPayXp); new i_Costrandom = get_pcvar_num(g_pPayRandom); new sz_String[128]; formatex(sz_String, charsmax(sz_String), "Wylosuj Expa \r(%dPD)", i_Cost); menu_additem(menu,sz_String, "1", 0); formatex(sz_String, charsmax(sz_String), "Wylosuj Pokemona \r(%dPD)", i_Costrandom); menu_additem(menu,sz_String, "2", 0); menu_setprop(menu, MPROP_EXIT, MEXIT_ALL); menu_display(id, menu, 0); return PLUGIN_HANDLED; } public pdmenu_select(id, menu, item) { if (item == MENU_EXIT) { menu_destroy(menu); return PLUGIN_HANDLED; } new data[6], iName[64]; new acces, callback; menu_item_getinfo(menu, item, acces, data, charsmax(data), iName, charsmax(iName), callback); new key = str_to_num(data); switch(key) { case 1: { new i_Cost = get_pcvar_num(g_pPayXp); new i_Minexp = get_pcvar_num(g_pRandomXpMin); new i_Maxexp = get_pcvar_num(g_pRandomXpMax); if( g_PD[id] < i_Cost) { client_print(id, print_chat,"%L",LANG_PLAYER,"MSG_NONE_PD"); } new select = random_num(i_Minexp, i_Maxexp); Poke_Give_XP(id, -1, select); g_PD[id]-=i_Cost; client_print(id, print_chat,"%L",LANG_PLAYER,"MSG_RANDOM", select); } } case 2: { new i_Cost = get_pcvar_num(g_pPayRandom); if( g_PD[id] < i_Cost) { client_print(id, print_chat,"%L",LANG_PLAYER,"MSG_NONE_PD") ; } { new poke; do { poke = random_num(1, 617); } while( poke == 151 || poke == 144 || poke == 146 || poke == 145 || poke == 243 || poke == 244 || poke == 245 || poke == 249 || poke == 250 || poke == 251 || poke == 483 || poke == 484 || poke == 485 || poke == 487 || poke == 491 || poke == 380 || poke == 381 ); Poke_Give_Poke(id, poke, 1); g_PD[id]-=i_Cost; client_print(id, print_chat,"%L",LANG_PLAYER,"MSG_RANDOM2"); } } } } } menu_destroy(menu); return PLUGIN_HANDLED; } public Send(id){ new args[256]; read_args(args, charsmax(args)); remove_quotes(args); new szCmd[15], szNick[32], szPD[12]; new parsed = parse(args, szCmd, charsmax(szCmd), szNick, charsmax(szNick), szPD, charsmax(szPD)); if(parsed && equali(szCmd, "wyslij")){ if(parsed < 3){ client_print(id, print_chat, "Uzycie: wyslij  "); return PLUGIN_HANDLED; } new Player = cmd_target( id, szNick, CMDTARGET_ONLY_ALIVE & CMDTARGET_NO_BOTS ); if(!Player){ client_print(id, print_chat,"%L",LANG_PLAYER,"MSG_NONE_PLAYER", szNick); return PLUGIN_HANDLED; } new iPD = str_to_num(szPD); if( g_PD[id] < iPD ){ client_print(id, print_chat,"%L",LANG_PLAYER,"MSG_NONE_PD"); return PLUGIN_HANDLED; } if( iPD < 1 ) { client_print(id, print_chat,"%L",LANG_PLAYER,"MSG_NONE_PD2"); return PLUGIN_HANDLED; } g_PD[id]-=iPD; g_PD[Player]+=iPD; new szNick2[32]; get_user_name(id, szNick2, charsmax(szNick2)); get_user_name(Player, szNick, charsmax(szNick2)); client_print(id, print_chat,"%L",LANG_PLAYER,"MSG_SEND", szNick, iPD); client_print(Player, print_chat,"%L",LANG_PLAYER,"MSG_SEND2", szNick2, iPD); return PLUGIN_HANDLED; } return PLUGIN_CONTINUE; } public GivePD(id, level, cid) { if(!(get_user_flags(id) & FLAGS)){ return PLUGIN_HANDLED; } new szNick[33], szPD[10], Player, iPD; read_argv(1, szNick, charsmax(szNick)); read_argv(2, szPD, charsmax(szPD)); Player = cmd_target(id, szNick, CMDTARGET_ONLY_ALIVE & CMDTARGET_NO_BOTS); iPD = str_to_num(szPD); new gName[33], pName[33]; get_user_name(id, gName, charsmax(gName)); get_user_name(Player, pName, charsmax(pName)); if(!Player) { client_print(id, print_chat,"%L",LANG_PLAYER,"MSG_NONE_PLAYER", szNick); return PLUGIN_HANDLED; } g_PD[Player]+=iPD; client_print(id, print_chat,"%L",LANG_PLAYER,"MSG_ADMIN2", pName, iPD); return PLUGIN_HANDLED; } public DeletePD(id, level, cid) { if(!(get_user_flags(id) & FLAGS)){ return PLUGIN_HANDLED; } new szNick[33], szPD[10], Player, iPD; read_argv(1, szNick, charsmax(szNick)); read_argv(2, szPD, charsmax(szPD)); Player = cmd_target(id, szNick, CMDTARGET_ONLY_ALIVE & CMDTARGET_NO_BOTS); iPD = str_to_num(szPD); new gName[33], pName[33]; get_user_name(id, gName, charsmax(gName)); get_user_name(Player, pName, charsmax(pName)); if(!Player) { client_print(id, print_chat,"%L",LANG_PLAYER,"MSG_NONE_PLAYER", szNick); return PLUGIN_HANDLED; } g_PD[Player]-=iPD; client_print(id, print_chat,"%L",LANG_PLAYER,"MSG_ADMIN", pName, iPD); return PLUGIN_HANDLED; } public DeathMsg() { switch(get_pcvar_num(g_pGetXp)) { case 1: { new kill = get_pcvar_num(g_pKill); new bonus = get_pcvar_num(g_pBonus); new kid = read_data(1); new vid = read_data(2); new hs = read_data(3); if(!is_user_connected(kid) || !is_user_connected(vid)){ return PLUGIN_HANDLED; } g_PD[kid]+=kill; remove_task(vid); if(hs == 1){ g_PD[kid]+=bonus; } } case 2: { new kid = read_data(1); new vid = read_data(2); if(!is_user_connected(kid) || !is_user_connected(vid)){ return PLUGIN_HANDLED; } g_PD[kid]+=get_user_frags(vid) < 1 ? 1 : get_user_frags(vid); } } return PLUGIN_HANDLED; } public Load_PD(id) { new authid[64], vaultkey[64], vaultdata[32], one[512]; switch(get_pcvar_num(g_pSaveXp)) { case 1: get_user_authid(id, authid, 63); case 2: get_user_name(id, authid, 63); } replace_all(authid, 63, " ", "+"); format(vaultkey,63,"%s", authid); nvault_get(g_Save, vaultkey, vaultdata,511); replace_all(vaultdata, 256,"#"," "); parse(vaultdata, one, 99); g_PD[id] = str_to_num(one); } public Save_PD(id) { new authid[64], vaultkey[64], vaultdata[512]; switch(get_pcvar_num(g_pSaveXp)) { case 1: get_user_authid(id, authid, 63); case 2: get_user_name(id, authid, 63); } format(vaultkey, 63, "%s", authid); format(vaultdata, 511,"%d", g_PD[id]); replace_all(authid, 63, " ", "+"); nvault_set(g_Save, vaultkey, vaultdata); } 
proszę o szybka pomoc
  • +
  • -
  • 0




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

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