AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Ta giving error. Why? (https://forums.alliedmods.net/showthread.php?t=264140)

NovinhoFDR 06-09-2015 22:16

Ta giving error. Why?
 
Code:

#include <amxmodx>
#include <fakemeta>
#include <cstrike>
#include <amxmisc>

#define PLUGIN_NAME "Mix Menu"
#define PLUGIN_VERSION "2.00"
#define PLUGIN_AUTHOR "Noviinhoo"

public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
register_clcmd( "say /skin","Menu")
register_clcmd( "say_team /skin","Menu")
}

public Menu(id)
{
new menu = menu_create("\w[Menu Desativar Skin's By \rNoviinhoo]:", "Menu1_Funcoes")

menu_additem(menu, "\wATIVAR", "1", ADMIN_LEVEL_H)
menu_additem(menu, "\yDESATIVAR", "2", ADMIN_LEVEL_H)

menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)

menu_display(id, menu, 0)
}
public Menu1_Funcoes(id, menu, item)
{
if (item == MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_HANDLED
}

new data[6], iName[64]
new access, callback
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);

new key = str_to_num(data)

switch(key)
{
case 1:{
server_cmd ("cl_minmodels 1");
client_print(id, print_chat, "[SKIN] just activate admin skins! By: [N]oviinhoo[O]")

menu_destroy(menu)
}
case 2:{
client_print(id, print_chat, "[SKIN] just enable admin skins! By: [N]oviinhoo[O]")
server_cmd ("cl_minmodels 0");
}
return PLUGIN_HANDLED

If someone able to find the error, put the correct plugin for me here. Thank you!

Kia 06-10-2015 01:37

Re: Ta giving error. Why?
 
Replace server_cmd with client_cmd.

Mordekay 06-10-2015 09:15

Re: Ta giving error. Why?
 
Does that even work?
And if it works: isn't this slowhacking?

belouga 06-10-2015 09:22

Re: Ta giving error. Why?
 
Quote:

Originally Posted by Kia (Post 2306458)
Replace server_cmd with client_cmd.

Yes that's right :D.

Kia 06-10-2015 11:35

Re: Ta giving error. Why?
 
Quote:

Originally Posted by Mordekay (Post 2306549)
And if it works: isn't this slowhacking?

No, the user opens a menu and sets the setting himself (although you should inform that a CVar is being changed).

NovinhoFDR 06-10-2015 12:06

Re: Ta giving error. Why?
 
image: http://prntscr.com/7fdyguhttp://prntscr.com/7fdygu

Error still persists!

Quote:

#include <amxmodx>
#include <fakemeta>
#include <cstrike>
#include <amxmisc>

#define PLUGIN_NAME "Desativar Skin"
#define PLUGIN_VERSION "1.00"
#define PLUGIN_AUTHOR "Noviinhoo"

public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
register_clcmd( "say /skin","Menu")
register_clcmd( "say_team /skin","Menu")
}

public Menu(id)
{
new menu = menu_create("\w[Menu Desativar Skin's By \rNoviinhoo]:", "Menu1_Funcoes")

menu_additem(menu, "\wATIVAR", "1")
menu_additem(menu, "\yDESATIVAR", "2")

menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)

menu_display(id, menu, 0)
}
public Menu1_Funcoes(id, menu, item)
{
if (item == MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_HANDLED
}

new data[6], iName[64]
new access, callback
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);

new key = str_to_num(data)

switch(key)
{
case 1:{
client_cmd ("cl_minmodels 1"); // Desativa skins
client_print(id, print_chat, "[SKIN] Voce acaba de ativar skins de admin! By: [N]oviinhoo[O]") // Exibe uma Menssagem no say do Admin
menu_destroy(menu)
}
case 2:{
client_print(id, print_chat, "[SKIN] Voce acaba de ativar skins de admin! By: [N]oviinhoo[O]") // Uma menssagem no say do admin
// Configs MIX AMX MOD
client_cmd ("cl_minmodels 0"); // Ativa Skins
}
return PLUGIN_HANDLED
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg1252\\ deff0\\ deflang1046{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par }
*/
server_cmd edited to client_cmd, more error persists

HamletEagle 06-10-2015 12:21

Re: Ta giving error. Why?
 
client_cmd(index, "command")

NovinhoFDR 06-10-2015 13:31

Re: Ta giving error. Why?
 
Quote:

Originally Posted by HamletEagle (Post 2306592)
client_cmd(index, "command")

- INGLÊS: Error persists,faria a edit properly, and send to me?
- Português: Erro persistir, Faria uma edição corretamente, e enviar para mim?

HamletEagle 06-10-2015 14:39

Re: Ta giving error. Why?
 
Please use english.

PHP Code:


#include <amxmodx>
#include <fakemeta>
#include <cstrike>
#include <amxmisc>

#define PLUGIN_NAME "Desativar Skin"
#define PLUGIN_VERSION "1.00"
#define PLUGIN_AUTHOR "Noviinhoo"

public plugin_init()
{
    
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR)
    
register_clcmd"say /skin","Menu")
    
register_clcmd"say_team /skin","Menu")
}

public 
Menu(id)
{
    new 
menu menu_create("\w[Menu Desativar Skin's By \rNoviinhoo]:""Menu1_Funcoes")

    
menu_additem(menu"\wATIVAR""1")
    
menu_additem(menu"\yDESATIVAR""2")

    
menu_setprop(menuMPROP_EXITMEXIT_ALL)

    
menu_display(idmenu0)
}
public 
Menu1_Funcoes(idmenuitem)
{
    if (
item == MENU_EXIT)
    {
        
menu_destroy(menu)
        return 
PLUGIN_HANDLED
    
}

    new 
data[6], iName[64]
    new 
accesscallback
    menu_item_getinfo
(menuitemaccessdata,5iName63callback);

    new 
key str_to_num(data)

    switch(
key)
    {
        case 
1:{
            
client_cmd (id"cl_minmodels 1"); // Desativa skins
            
client_print(idprint_chat"[SKIN] Voce acaba de ativar skins de admin! By: [N]oviinhoo[O]"// Exibe uma Menssagem no say do Admin
            
menu_destroy(menu)
        }
        case 
2:{
            
client_print(idprint_chat"[SKIN] Voce acaba de ativar skins de admin! By: [N]oviinhoo[O]"// Uma menssagem no say do admin
            // Configs MIX AMX MOD
            
client_cmd (id"cl_minmodels 0"); // Ativa Skins
        
}
    }
    return 
PLUGIN_HANDLED
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg1252\\ deff0\\ deflang1046{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par }
*/ 

Compilation errors solved.

Kia 06-11-2015 01:30

Re: Ta giving error. Why?
 
Code:
client_print(id, print_chat, "[SKIN] Voce acaba de ativar skins de admin! By: [N]oviinhoo[O]") // Exibe uma Menssagem no say do Admin client_print(id, print_chat, "[SKIN] Voce acaba de ativar skins de admin! By: [N]oviinhoo[O]") // Uma menssagem no say do admin

I'd add a message saying that cl_minmodels got changed here.


All times are GMT -4. The time now is 20:06.

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