Raised This Month: $ Target: $400
 0% 

Ta giving error. Why?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
NovinhoFDR
New Member
Join Date: Dec 2014
Old 06-09-2015 , 22:16   Ta giving error. Why?
Reply With Quote #1

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!
__________________
[N]oviinhoo[O] @ThunderGames
NovinhoFDR is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 06-10-2015 , 01:37   Re: Ta giving error. Why?
Reply With Quote #2

Replace server_cmd with client_cmd.
__________________
Kia is offline
belouga
AlliedModders Donor
Join Date: Jun 2015
Location: Paris 16, Ile-de-France,
Old 06-10-2015 , 09:22   Re: Ta giving error. Why?
Reply With Quote #3

Quote:
Originally Posted by Kia View Post
Replace server_cmd with client_cmd.
Yes that's right .
belouga is offline
Mordekay
Squirrel of Fortune
Join Date: Apr 2006
Location: Germany
Old 06-10-2015 , 09:15   Re: Ta giving error. Why?
Reply With Quote #4

Does that even work?
And if it works: isn't this slowhacking?
__________________

Mordekay is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 06-10-2015 , 11:35   Re: Ta giving error. Why?
Reply With Quote #5

Quote:
Originally Posted by Mordekay View Post
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).
__________________
Kia is offline
NovinhoFDR
New Member
Join Date: Dec 2014
Old 06-10-2015 , 12:06   Re: Ta giving error. Why?
Reply With Quote #6

image: http://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
__________________
[N]oviinhoo[O] @ThunderGames

Last edited by NovinhoFDR; 06-10-2015 at 12:09.
NovinhoFDR is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 06-10-2015 , 12:21   Re: Ta giving error. Why?
Reply With Quote #7

client_cmd(index, "command")
__________________
HamletEagle is offline
NovinhoFDR
New Member
Join Date: Dec 2014
Old 06-10-2015 , 13:31   Re: Ta giving error. Why?
Reply With Quote #8

Quote:
Originally Posted by HamletEagle View Post
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?
__________________
[N]oviinhoo[O] @ThunderGames
NovinhoFDR is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 06-10-2015 , 14:39   Re: Ta giving error. Why?
Reply With Quote #9

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.
__________________

Last edited by HamletEagle; 06-10-2015 at 14:40.
HamletEagle is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 06-11-2015 , 01:30   Re: Ta giving error. Why?
Reply With Quote #10

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.
__________________
Kia is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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