AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Please help me (https://forums.alliedmods.net/showthread.php?t=320551)

Ykaru 12-27-2019 11:15

Please help me
 
Hi, i have this plugin and when im trying to compile it i get this erros:
PHP Code:

binduri.sma(27) : warning 217loose indentation
binduri
.sma(87) : warning 217loose indentation
binduri
.sma(90) : error 035argument type mismatch (argument 1)
binduri.sma(92) : error 035argument type mismatch (argument 4)
binduri.sma(93) : error 035argument type mismatch (argument 1

This is the plugin :

PHP Code:

#include <amxmodx>

#define PLUGIN "Bind-uri server"
#define VERSION "1.0"
#define AUTHOR "DaNNNNN-One"

new Binds[][] = 
{
"bind f +rope",
"bind c +grab",
"bind v +hook"
}, 
Menu;

public 
plugin_init()
{
register_plugin(PLUGINVERSIONAUTHOR)
register_clcmd "say /binduri""OpenMenu", -);
register_clcmd "say_team /binduri""OpenMenu", -);
}

public 
client_putinserver id )
{
if ( !
is_user_connected id ) || is_user_bot id ) )
    return 
PLUGIN_HANDLED;
    
    
set_task 3.0"OpenMenu"id );
    return 
PLUGIN_HANDLED;
}

public 
OpenMenu id )
{    
    
Menu menu_create("\yVrei sa-ti fie setate bind-urile server-ului?\r""CMD_SetBinds")
    
    
menu_additem(Menu"\yDa""1"0)
    
menu_additem(Menu"\yNu""2"0)
    
menu_additem(Menu"\yAjutor""3");
    
    
menu_setprop(MenuMPROP_EXITMEXIT_NEVER)
    
menu_display(idMenu0);
}

public 
CMD_SetBinds(idmenuitem) {
    if(
item == MENU_EXIT || !is_user_connected(id)) 
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    new 
Data[6], Name[64], AccessCallBack;
    
menu_item_getinfo(menuitemAccessData,5Name63CallBack);
    new 
Key str_to_num(Data);
    
    switch(
Key
    {    
        case 
1
        {
            for(new 
0sizeof (Binds); i++)
                
client_cmd(id"%s"Binds)
            
            
ColorChat id"!tBind-urile standard ti-au fost aplicate cu succes !" )
            
ColorChat id"!tPentru a folosi rope, apasati pe tasta F, pentru hook, apasati tasta V, iar pentru grab, tasta C" )
        }
        case 
2
        {
            
ColorChat id"!tBind-urile standard, nu au fost aplicate cu succes" );    
        }
        case 
3:
        {
            
show_motd id"addons/amxmodx/configs/motdbind.html""Bind-uri Server" );
        }
    }
    return 
PLUGIN_HANDLED
}

stock ColorChat(const id, const input[], any:...)
{
    new 
count 1players[32]
    static 
msg[320]
    
vformat(msg190input3)
    
    
replace_all(msg190"!g""^4")
    
replace_all(msg190"!n""^1")
    
replace_all(msg190"!t""^3")
    
replace_all(msg190"!t2""^0")
    
    if (
idplayers[0] = id; else get_players(playerscount"ch")
{
    for (new 
0counti++)
    {
        if (
is_user_connected(players) )
        {
            
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players)
            
write_byte(players)
            
write_string(msg)
            
message_end()
        }
    }
}



raizo11 12-27-2019 14:21

Re: Please help me
 
Code:

#include <amxmodx>

#define PLUGIN "Bind-uri server"
#define VERSION "1.0"
#define AUTHOR "DaNNNNN-One"

new Binds[][] =
{
"bind f +rope",
"bind c +grab",
"bind v +hook"
},
Menu;

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd ( "say /binduri", "OpenMenu", -1 );
register_clcmd ( "say_team /binduri", "OpenMenu", -1 );
}

public client_putinserver ( id )
{
    if ( !is_user_connected ( id ) || is_user_bot ( id ) )
        return PLUGIN_HANDLED;
   
    set_task ( 3.0, "OpenMenu", id );
    return PLUGIN_HANDLED;
}

public OpenMenu ( id )
{   
    Menu = menu_create("\yVrei sa-ti fie setate bind-urile server-ului?\r", "CMD_SetBinds")
   
    menu_additem(Menu, "\yDa", "1", 0)
    menu_additem(Menu, "\yNu", "2", 0)
    menu_additem(Menu, "\yAjutor", "3", 0 );
   
    menu_setprop(Menu, MPROP_EXIT, MEXIT_NEVER)
    menu_display(id, Menu, 0);
}

public CMD_SetBinds(id, menu, item) {
    if(item == MENU_EXIT || !is_user_connected(id))
    {
        menu_destroy(menu);
        return PLUGIN_HANDLED;
    }
    new Data[6], Name[64], Access, CallBack;
    menu_item_getinfo(menu, item, Access, Data,5, Name, 63, CallBack);
    new Key = str_to_num(Data);
   
    switch(Key)
    {   
        case 1:
        {
            for(new i = 0; i < sizeof (Binds); i++)
                client_cmd(id, "%s", Binds)
           
            ColorChat ( id, "!tBind-urile standard ti-au fost aplicate cu succes !" )
            ColorChat ( id, "!tPentru a folosi rope, apasati pe tasta F, pentru hook, apasati tasta V, iar pentru grab, tasta C" )
        }
        case 2:
        {
            ColorChat ( id, "!tBind-urile standard, nu au fost aplicate cu succes" );   
        }
        case 3:
        {
            show_motd ( id, "addons/amxmodx/configs/motdbind.html", "Bind-uri Server" );
        }
    }
    return PLUGIN_HANDLED
}

stock ColorChat(const id, const input[], any:...)
{
    new count = 1, players[32]
    static msg[320]
    vformat(msg, 190, input, 3)
   
    replace_all(msg, 190, "!g", "^4")
    replace_all(msg, 190, "!n", "^1")
    replace_all(msg, 190, "!t", "^3")
    replace_all(msg, 190, "!t2", "^0")
   
    if (id) players[0] = id; else get_players(players, count, "ch")
    {
        for (new i = 0; i < count; i++)
        {
            if (is_user_connected(players[i]) )
            {
                message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
                write_byte(players[i])
                write_string(msg)
                message_end()
            }
        }
    }
}


fysiks 12-27-2019 14:24

Re: Please help me
 
@Raizo, this is the scripting help section so if you're not going to help the person learn something, you should at least explain what you did.

Shadows Adi 12-30-2019 08:25

Re: Please help me
 
PHP Code:

stock ColorChat(const id, const input[], any:...)
{
    new 
count 1players[32]
    static 
msg[320]
    
vformat(msg190input3)
    
    
replace_all(msg190"!g""^4")
    
replace_all(msg190"!n""^1")
    
replace_all(msg190"!t""^3")
    
replace_all(msg190"!t2""^0")
    
    if (
idplayers[0] = id; else get_players(playerscount"ch")
{
    for (new 
0counti++)
    {
        if (
is_user_connected(players[i]) )
        {
            
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players[i])
            
write_byte(players[i])
            
write_string(msg)
            
message_end()
        }
    }
}


You "players" array must be indexed, that's why you created this loop:
PHP Code:

for (new 0counti++) 

Use this for players -> players[i]


All times are GMT -4. The time now is 03:01.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.