RSSy MYGO.pl Opublikowano Czerwiec 12, 2020 o 07:30 RSSy Udostępnij Opublikowano Czerwiec 12, 2020 o 07:30 The problem with this "bet" plugin ... Everything works ok, the problem is that at the end of the round the message does not appear and you do not receive the bets. If you can add in the message: You bet 1 credit You bet 2 credits When you write 1 to write "credit" and when you write more than 1 credit to appear credits. And if you don't have enough credits to bet the message will appear: You do not have the amount of credits in the position that you bet! PHP Code: /* Plugin generated by AMXX-Studio */#include <amxmodx>#include <amxmisc>#define PLUGIN "BET FCS"#define VERSION "1.0"#define AUTHOR ""//Zorken, am modificat codul din modului luinative fcs_get_user_credits(client);native fcs_set_user_credits(client, credits);new pbet[33]new betp[33]new const TeamNames[][] = { "", "Terrorist", "Counter-Terrorist"}public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_concmd("T", "Tbet"); register_concmd("CT", "CTbet"); register_clcmd("say /bet","bet") register_clcmd("say_team /bet","bet")}public plugin_natives(){ register_native("give_bet", "native_bet", 1) register_native("bett", "native_bett", 1) register_native("betct", "native_betct", 1)}public bet(client){ if(pbet[client]) { print_cc(client,".g[ERAZER BET] .nAi pariat deja pe echipa .t%s .n!",TeamNames[pbet[client]]); return 1; } new Menu = menu_create("\y[\rCS.ERAZER.RO\y] - \gBET", "betm"); menu_additem(Menu, "\rTerrorist", "0"); menu_additem(Menu, "\yCounter-Terrorist", "1"); menu_setprop(Menu, MPROP_EXIT, MEXIT_ALL) menu_display(client, Menu, 0); return 0;}public betm(client, menu, item){ if( item == MENU_EXIT) { menu_destroy ( menu ); return PLUGIN_HANDLED; } new Data[6], Name[64]; new Access, CallBack; menu_item_getinfo(menu, item, Access, Data,5, Name, 63, CallBack); new Key = str_to_num(Data); switch(Key) { case 0: { print_cc(client,".g[ERAZER BET] .nScrie suma pe care .gpariezi!"); client_cmd(client, "messagemode T"); } case 1: { print_cc(client,".g[ERAZER BET] .nScrie suma pe care .gpariezi!"); client_cmd(client, "messagemode CT"); } } menu_destroy(menu); return PLUGIN_HANDLED;}public Tbet(client){ if( pbet[client]) return PLUGIN_HANDLED; new Data[32], Cost; read_args(Data, 31); remove_quotes(Data); Cost = str_to_num(Data); if(Cost < 0 || Cost > fcs_get_user_credits(client) || Cost == 0) { client_cmd(client, "messagemode T"); return PLUGIN_HANDLED; } else { pbet[client] = 1; betp[client] = Cost fcs_set_user_credits(client,fcs_get_user_credits(client)- Cost) print_cc(client,".g[ERAZER BET] .nAi pariat pe echipa .tTerrorist.n, .g[%d] .ncredite.n.",Cost); return PLUGIN_CONTINUE; } return PLUGIN_CONTINUE;}public CTbet(client){ if(pbet[client]) return PLUGIN_HANDLED; new Data[32], Cost; read_args(Data, 31); remove_quotes(Data); Cost = str_to_num(Data); if(Cost < 0 || Cost > fcs_get_user_credits(client) || Cost == 0) { client_cmd(client, "messagemode CT"); return PLUGIN_HANDLED; } else { pbet[client] = 2; betp[client] = Cost fcs_set_user_credits(client,fcs_get_user_credits(client) - Cost) print_cc(client,".g[ERAZER BET] .nAi pariat pe echipa .tCounter-Terrorist.n,.g[%d] .ncredite.n.",Cost); return PLUGIN_CONTINUE; } return PLUGIN_CONTINUE;}public native_bet(client){ if(is_user_connected(client)) { new a = betp[client]*2 fcs_set_user_credits(client,fcs_get_user_credits(client) + a) print_cc(client,".g[ERAZER BET] .nAi castigat .t%d .gcredite .n!", a); }}public native_bett(client){ if(is_user_connected(client) && pbet[client] == 1) return true; return false;}public native_betct(client){ if(is_user_connected(client) && pbet[client] == 2) return true; return false;}print_cc(client, fmt[], any:...){ static saytext = 0, fake_user; if (!saytext) { saytext = get_user_msgid("SayText"); fake_user = get_maxplayers() + 1; } new msg[192]; vformat(msg, charsmax(msg), fmt, 3) replace_all(msg, sizeof(msg) - 1, ".g", "^x04"); replace_all(msg, sizeof(msg) - 1, ".n", "^x01"); replace_all(msg, sizeof(msg) - 1, ".t", "^x03"); message_begin(client ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, saytext, _, client); write_byte(client ? client : fake_user); write_string(msg); message_end();} Przeczytaj cały wpis Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
Rekomendowane odpowiedzi