Raised This Month: $ Target: $400
 0% 

[req][help] log to shop menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
indraraj striker
Veteran Member
Join Date: Mar 2014
Location: Under the water
Old 11-02-2014 , 01:54   [req][help] log to shop menu
Reply With Quote #1

if u know about shop menu

shop menu contain
menu_additem(health)
set_user_health(id,get_user_health(id)+20)
i want create log file who was used the shop
how to do please help me

thanks in advanced
__________________
Thanks everyone. #miss_you_all
indraraj striker is offline
ghost95v
Senior Member
Join Date: Apr 2014
Location: somewhere in universe
Old 11-02-2014 , 01:09   Re: [req][help] log to shop menu
Reply With Quote #2

Quote:
Originally Posted by indraraj striker View Post
if u know about shop menu

shop menu contain
menu_additem(health)
set_user_health(id,get_user_health(id)+20)
i want create log file who was used the shop
how to do please help me

thanks in advanced
You need to show your code to do this.
__________________

Last edited by ghost95v; 11-02-2014 at 01:29.
ghost95v is offline
Send a message via Skype™ to ghost95v
indraraj striker
Veteran Member
Join Date: Mar 2014
Location: Under the water
Old 11-02-2014 , 01:41   Re: [req][help] log to shop menu
Reply With Quote #3

Quote:
Originally Posted by ghost95v View Post
You need to show your code to do this.
take this as a example
PHP Code:
#include <amxmodx>
#include<fun>

public plugin_init()
{
    
register_plugin("My Menu""1.0""Me");
    
register_clcmd("/shop""ShowMenu"_"");
}

public 
ShowMenu(id)
{
    new 
menu menu_create("shopmenu""mh_MyMenu");

    
menu_additem(menu"HEALTH"""0); // case 0
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
menu_setprop(menuMPROP_PERPAGE2);

    
menu_display(idmenu0);

    return 
PLUGIN_HANDLED;
}

public 
mh_MyMenu(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_cancel(id);
        return 
PLUGIN_HANDLED;
    }

    new 
command[6], name[64], accesscallback;

    
menu_item_getinfo(menuitemaccesscommandsizeof command 1namesizeof name 1callback);

    switch(
item)
    {
        case 
0:{
                
set_user_health(id,get_user_health(id)+50)
                
client_print(idprint_chat"You have selected HEALTH");
                     
//create here log name | shop used 
                
        
}
         
            
    }

    
menu_destroy(menu);

    return 
PLUGIN_HANDLED;

__________________
Thanks everyone. #miss_you_all
indraraj striker is offline
ghost95v
Senior Member
Join Date: Apr 2014
Location: somewhere in universe
Old 11-02-2014 , 02:03   Re: [req][help] log to shop menu
Reply With Quote #4

here it is

PHP Code:
public mh_MyMenu(idmenuitem

    if(
item == MENU_EXIT
    { 
        
menu_cancel(id); 
        return 
PLUGIN_HANDLED
    } 

    new 
command[6], name[64], accesscallback

    
menu_item_getinfo(menuitemaccesscommandsizeof command 1namesizeof name 1callback); 
    
//changes here
    
new name[32];
    
get_user_name(idname31);
    
//to here
    
switch(item
    { 
        case 
0:{ 
                
set_user_health(id,get_user_health(id)+50
                
client_print(idprint_chat"You have selected HEALTH"); 
                     
//create here log name | shop used  
                
log_to_file("Shop.log""%s Has bought +50 HP"name);
           
server_exec();
        } 
          
             
    } 

    
menu_destroy(menu); 

    return 
PLUGIN_HANDLED

__________________
ghost95v is offline
Send a message via Skype™ to ghost95v
indraraj striker
Veteran Member
Join Date: Mar 2014
Location: Under the water
Old 11-02-2014 , 06:03   Re: [req][help] log to shop menu
Reply With Quote #5

Quote:
Originally Posted by ghost95v View Post
here it is

PHP Code:
public mh_MyMenu(idmenuitem

    if(
item == MENU_EXIT
    { 
        
menu_cancel(id); 
        return 
PLUGIN_HANDLED
    } 

    new 
command[6], name[64], accesscallback

    
menu_item_getinfo(menuitemaccesscommandsizeof command 1namesizeof name 1callback); 
    
//changes here
    
new name[32];
    
get_user_name(idname31);
    
//to here
    
switch(item
    { 
        case 
0:{ 
                
set_user_health(id,get_user_health(id)+50
                
client_print(idprint_chat"You have selected HEALTH"); 
                     
//create here log name | shop used  
                
log_to_file("Shop.log""%s Has bought +50 HP"name);
           
server_exec();
        } 
          
             
    } 

    
menu_destroy(menu); 

    return 
PLUGIN_HANDLED

ty
__________________
Thanks everyone. #miss_you_all
indraraj striker is offline
Reply


Thread Tools
Display Modes

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 21:00.


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