Skocz do zawartości

Nowy szablon forum

mygo.pl

Stworzyliśmy dla Was nowy wygląd forum. Z pewnością znajdziesz rzeczy, które wg Ciebie mogą zostać zmienione - wspomnij o tym w specjalnym wątku.

Czytaj więcej

Jak założyć własną sieć

serwerów CS

Zastanawiasz się nad prowadzeniem własnej sieci serwerów? Przeczytaj podstawowe informacje, na które należy zwrócić uwagę, przy takim projekcie.

Czytaj więcej

Tworzymy spis sieci

dodaj swoją

Dodaj sieć do której należysz, pozwoli to na promocję i budowę ogólnopolskiej bazy sieci CS.

Czytaj więcej

Problem BET plugin


MYGO.pl
 Udostępnij

Rekomendowane odpowiedzi

  • RSSy
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 lui
native fcs_get_user_credits(client);
native fcs_set_user_credits(clientcredits);
new 
pbet[33]
new 
betp[33]
new const 
TeamNames[][] = {
    
"",
    
"Terrorist",
    
"Counter-Terrorist"
}
public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
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(MenuMPROP_EXITMEXIT_ALL)  
    
menu_display(clientMenu0);
    return 
0;
}
public 
betm(clientmenuitem)
{
    if( 
item == MENU_EXIT)
    {
        
menu_destroy menu );
        return 
PLUGIN_HANDLED;
    }
    
    new 
Data[6], Name[64];
    new 
AccessCallBack;
    
menu_item_getinfo(menuitemAccessData,5Name63CallBack);
    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(Data31);
    
remove_quotes(Data);
    
    
Cost str_to_num(Data);
    
    if(
Cost || 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(Data31);
    
remove_quotes(Data);
    
    
Cost str_to_num(Data);
    
    if(
Cost || 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 
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(clientfmt[], any:...)
{
    static 
saytext 0fake_user;
    if (!
saytext)
    {
    
saytext get_user_msgid("SayText");
    
fake_user get_maxplayers() + 1;
    }
    new 
msg[192];
    
vformat(msgcharsmax(msg), fmt3)
    
replace_all(msgsizeof(msg) - 1".g""^x04");
    
replace_all(msgsizeof(msg) - 1".n""^x01");
    
replace_all(msgsizeof(msg) - 1".t""^x03");
    
message_begin(client MSG_ONE_UNRELIABLE MSG_BROADCASTsaytext_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

Gość
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
 Udostępnij

×
×
  • Dodaj nową pozycję...