witam pisze odnosnie pluginu cash transfer : http://amxx.pl/topic...-cash-transfer/
Mianowicie chodzi mi o dodanie wiadomosci do hud ze ktos komus przelal kase
Tutaj podaje kod sma :
#include <amxmod> #include <amxmisc> #include <cstrike> new Taker; new const g_commands[][] = { "say /kasa", "say /przelej", "say_team /kasa", "say /daj", "say_team /daj", "say /oddaj", "say_team /oddaj" }; public plugin_init() { register_plugin("Cash Transfer","1.0","oeN."); for(new i = 0; i<sizeof(g_commands); i++){ register_clcmd(g_commands[i], "CashMenu"); } register_clcmd("Ile_Kasy", "GiveCash"); } public CashMenu(id, level, cid) { new menu = menu_create("\rWybierz gracza", "CashMenuHandle"); new players[32], pnum, tempid2; new szName[32], szTempid[10]; get_players(players, pnum); for( new i; i<pnum; i++ ) { tempid2 = players[i]; if(!is_user_connected(i) || get_user_money(tempid2) == 16000 || cs_get_user_team(tempid2) == CS_TEAM_SPECTATOR) continue; get_user_name(tempid2, szName, charsmax(szName)); num_to_str(tempid2, szTempid, charsmax(szTempid)); menu_additem(menu, szName, szTempid, 0); } menu_setprop(menu, MPROP_EXITNAME, "Wyjdz"); menu_display(id, menu, 0); return PLUGIN_HANDLED; } public CashMenuHandle(id, menu, item) { if( item == MENU_EXIT ) { menu_destroy(menu); return PLUGIN_HANDLED; } new data[6], szName[64]; new access, callback; menu_item_getinfo(menu, item, access, data,charsmax(data), szName,charsmax(szName), callback); Taker = str_to_num(data); client_cmd(id, "messagemode Ile_Kasy"); menu_destroy(menu); return PLUGIN_HANDLED; } public GiveCash(id) { new szCash[64]; read_argv(1, szCash, 63) remove_quotes(szCash); new Cash = str_to_num(szCash); new giverMoney = cs_get_user_money(id); new takerMoney = cs_get_user_money(Taker); if(Cash <= 0) { client_print(id, print_center, "Liczba musi byc wieksza od 0"); return PLUGIN_HANDLED; } if(giverMoney < Cash){ client_print(id, print_center, "Nie masz tyle kasy"); return PLUGIN_HANDLED; } if(takerMoney == 16000) { client_print(id, print_center, "Gracz ma $16000"); return PLUGIN_HANDLED; } if(takerMoney + Cash > 16000) { client_print(id, print_center, "Za duzo!"); return PLUGIN_HANDLED; } if( id == Taker) { client_print(id, print_center, "Nie mozesz dac sobie!"); return PLUGIN_HANDLED; } cs_set_user_money(id, giverMoney - Cash); cs_set_user_money(Taker, takerMoney + Cash); return PLUGIN_CONTINUE; } /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par } */
Uzytkownik grankee kazał mi dopisac cos takego :
client_print(0,print_chat,"[AMX] %s transferd %i $ to %s. Give him a thanks",name,cash,name2) zamien na set_hudmessage(255, 0, 0, -1.0, -1.0, 0, 6.0, 7.0) show_hudmessage(0,"%s transferd %i $ to %s. Give him a thanks",name,cash,name2)
Ale nie za bardzo wiem gdzie to wkleic ;/