Raised This Month: $12 Target: $400
 3% 

need small help!


Post New Thread Reply   
 
Thread Tools Display Modes
bakir123
Senior Member
Join Date: Jan 2015
Location: Palestine, Hebron
Old 02-22-2017 , 13:43   Re: need small help!
Reply With Quote #11

Quote:
Originally Posted by Natsheh View Post
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <nvault>

#define PLUGIN "1 day cmd"
#define VERSION "1.0"
#define AUTHOR "Natsheh"

#define SECONDS_INYEAR        31104000
#define SECONDS_INMONTH        2592000
#define SECONDS_INDAY        86400

new nVault;

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
nVault nvault_open("clcmd_perday")
    if(
nVault == INVALID_HANDLE)
        
set_fail_state("Fuck this is not working....")
    
    
register_clcmd("say /onetimeuseperday""user_clcmd")
}

public 
plugin_end()
{
    
nvault_close(nVault); // we close this shitty vault
}

public 
user_clcmd(id)
{
    new 
authid[32]
    
get_user_authid(idauthid31)
    new 
currtime calculate_thetime();
    new 
time_displacement = (currtime nvault_get(nVaultauthid));
    
    if(
time_displacement >= SECONDS_INDAY)
    {
        
// your code here..
        
        
        
new string[24]
        
num_to_str(currtimestring23)
        
nvault_set(nVaultauthidstring)
    }
    else
        
client_print(idprint_chat"you still need %d seconds to use this command!"time_displacement)
}

stock calculate_thetime()
{
    new 
sDay[6], sMonth[6], sYear[6];
    
get_time("%d"sDaycharsmax(sDay))
    
get_time("%m"sMonthcharsmax(sMonth));
    
get_time("%Y"sYearcharsmax(sYear))
    
    return (
str_to_num(sYear) * SECONDS_INYEAR str_to_num(sDay) * SECONDS_INDAY str_to_num(sMonth) * SECONDS_INMONTH);


here an example!!
hmm
there are a problem

i added fm_give_item(id, "weapon_m4a1")
ok ? well?

see my code:

PHP Code:
/* Plugin generated by AMXX-Studio */ 

#include <amxmodx> 
#include <nvault> 

#include <zombie_plague_advance>
#include <fun>
#include <fakemeta_util>
#include <hamsandwich>
#include <colorchat>


#define PLUGIN "1 day cmd" 
#define VERSION "1.0" 
#define AUTHOR "Natsheh" 

#define SECONDS_INYEAR        31104000 
#define SECONDS_INMONTH        2592000 
#define SECONDS_INDAY        86400 

new nVault

public 
plugin_init() { 
    
register_plugin(PLUGINVERSIONAUTHOR
     
    
nVault nvault_open("clcmd_perday"
    if(
nVault == INVALID_HANDLE
        
set_fail_state("Fuck this is not working...."
     
    
register_clcmd("say /onetimeuseperday""user_clcmd"


public 
plugin_end() 

    
nvault_close(nVault); // we close this shitty vault 


public 
user_clcmd(id

    new 
authid[32
    
get_user_authid(idauthid31
    new 
currtime calculate_thetime(); 
    new 
time_displacement = (currtime nvault_get(nVaultauthid)); 
     
    if(
time_displacement >= SECONDS_INDAY
    { 
        
// your code here.. 
         
         
fm_give_item(id"weapon_m4a1")
        new 
string[24
        
num_to_str(currtimestring23
        
nvault_set(nVaultauthidstring
    } 
    else 
        
client_print(idprint_chat"you still need %d seconds to use this command!"time_displacement


stock calculate_thetime() 

    new 
sDay[6], sMonth[6], sYear[6]; 
    
get_time("%d"sDaycharsmax(sDay)) 
    
get_time("%m"sMonthcharsmax(sMonth)); 
    
get_time("%Y"sYearcharsmax(sYear)) 
     
    return (
str_to_num(sYear) * SECONDS_INYEAR str_to_num(sDay) * SECONDS_INDAY str_to_num(sMonth) * SECONDS_INMONTH); 

when i write /onetimeuseperday
i can't get the weapon and i see always this msg "
you still need -1680656640 seconds to use this command"

any help?
bakir123 is offline
Send a message via Skype™ to bakir123
Natsheh
Veteran Member
Join Date: Sep 2012
Old 02-22-2017 , 14:01   Re: need small help!
Reply With Quote #12

PHP Code:
if(time_displacement <= SECONDS_INDAY
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 02-22-2017 at 14:01.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
bakir123
Senior Member
Join Date: Jan 2015
Location: Palestine, Hebron
Old 02-22-2017 , 14:04   Re: need small help!
Reply With Quote #13

Quote:
Originally Posted by Natsheh View Post
PHP Code:
if(time_displacement <= SECONDS_INDAY


What I should do?
This command not give me the weapon at first time!!

I told u it's should available one time per day ...
bakir123 is offline
Send a message via Skype™ to bakir123
Natsheh
Veteran Member
Join Date: Sep 2012
Old 02-22-2017 , 14:05   Re: need small help!
Reply With Quote #14

try this....


PHP Code:
/* Plugin generated by AMXX-Studio */  

#include <amxmodx>  
#include <nvault>  

#include <zombie_plague_advance> 
#include <fun> 
#include <fakemeta_util> 
#include <hamsandwich> 
#include <colorchat> 


#define PLUGIN "1 day cmd"  
#define VERSION "1.0"  
#define AUTHOR "Natsheh"  

#define SECONDS_INYEAR        31104000  
#define SECONDS_INMONTH        2592000  
#define SECONDS_INDAY        86400  

new nVault;  

public 
plugin_init() {  
    
register_plugin(PLUGINVERSIONAUTHOR)  
      
    
nVault nvault_open("clcmd_perday")  
    if(
nVault == INVALID_HANDLE)  
        
set_fail_state("Fuck this is not working....")  
      
    
register_clcmd("say /onetimeuseperday""user_clcmd")  
}  

public 
plugin_end()  
{  
    
nvault_close(nVault); // we close this shitty vault  
}  

public 
user_clcmd(id)  
{  
    new 
authid[32]  
    
get_user_authid(idauthid31)  
    new 
currtime calculate_thetime();  
    new 
time_displacement = (currtime nvault_get(nVaultauthid));  
      
    if(
time_displacement <= SECONDS_INDAY)  
    {  
        
// your code here..  
          
         
fm_give_item(id"weapon_m4a1"
        new 
string[24]  
        
num_to_str(currtimestringcharsmax(string))  
        
nvault_set(nVaultauthidstring)  
    }  
    else  
        
client_print(idprint_chat"you still need %d seconds to use this command!"time_displacement)  
}  

stock calculate_thetime()  
{  
    new 
sDay[6], sMonth[6], sYear[6];  
    
get_time("%d"sDaycharsmax(sDay))  
    
get_time("%m"sMonthcharsmax(sMonth));  
    
get_time("%Y"sYearcharsmax(sYear))  
      
    return (
str_to_num(sYear) * SECONDS_INYEAR str_to_num(sDay) * SECONDS_INDAY str_to_num(sMonth) * SECONDS_INMONTH);  

__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 02-22-2017 at 16:16.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
bakir123
Senior Member
Join Date: Jan 2015
Location: Palestine, Hebron
Old 02-22-2017 , 14:17   Re: need small help!
Reply With Quote #15

Quote:
Originally Posted by Natsheh View Post
try this....


PHP Code:
/* Plugin generated by AMXX-Studio */  

#include <amxmodx>  
#include <nvault>  

#include <zombie_plague_advance> 
#include <fun> 
#include <fakemeta_util> 
#include <hamsandwich> 
#include <colorchat> 


#define PLUGIN "1 day cmd"  
#define VERSION "1.0"  
#define AUTHOR "Natsheh"  

#define SECONDS_INYEAR        31104000  
#define SECONDS_INMONTH        2592000  
#define SECONDS_INDAY        86400  

new nVault;  

public 
plugin_init() {  
    
register_plugin(PLUGINVERSIONAUTHOR)  
      
    
nVault nvault_open("clcmd_perday")  
    if(
nVault == INVALID_HANDLE)  
        
set_fail_state("Fuck this is not working....")  
      
    
register_clcmd("say /onetimeuseperday""user_clcmd")  
}  

public 
plugin_end()  
{  
    
nvault_close(nVault); // we close this shitty vault  
}  

public 
user_clcmd(id)  
{  
    new 
authid[32]  
    
get_user_authid(idauthid31)  
    new 
currtime calculate_thetime();  
    new 
time_displacement = (currtime nvault_get(nVaultauthid));  
      
    if(
time_displacement <= SECONDS_INDAY)  
    {  
        
// your code here..  
          
         
fm_give_item(id"weapon_m4a1"
        new 
string[24]  
        
num_to_str(currtimestring23)  
        
nvault_set(nVaultauthidstring)  
    }  
    else  
        
client_print(idprint_chat"you still need %d seconds to use this command!"time_displacement)  
}  

stock calculate_thetime()  
{  
    new 
sDay[6], sMonth[6], sYear[6];  
    
get_time("%d"sDaycharsmax(sDay))  
    
get_time("%m"sMonthcharsmax(sMonth));  
    
get_time("%Y"sYearcharsmax(sYear))  
      
    return (
str_to_num(sYear) * SECONDS_INYEAR str_to_num(sDay) * SECONDS_INDAY str_to_num(sMonth) * SECONDS_INMONTH);  

lol
i can get weapon 100 times !!
nvault not working !
bakir123 is offline
Send a message via Skype™ to bakir123
Old 02-22-2017, 16:14
Natsheh
This message has been deleted by Natsheh.
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 02-23-2017 , 13:06   Re: need small help!
Reply With Quote #16

Code:
#include <amxmodx> #include <nvault> #include <fun> new ghnVault; new ghpcvarFrequency; public plugin_init() {     register_plugin("Give M4A1 by command", "1.0", "[ --{-@ ]");     ghnVault = nvault_open("GiveM4A1");     if ( ghnVault == INVALID_HANDLE )         set_fail_state("Couldn't open vault");     register_clcmd("say /gun", "user_clcmd");     ghpcvarFrequency = register_cvar("give_m4a1_frequency", "86400"); } public plugin_end()     nvault_close(ghnVault); public user_clcmd(id) {     new AuthID[32];     get_user_authid(id, AuthID, 31);     new curTime = get_systime();     new lastUsed = nvault_get(ghnVault, AuthID);     new giveFreq = get_pcvar_num(ghpcvarFrequency);     new outString[32];     if ( lastUsed + giveFreq > curTime ) {         TimerFormat(1000 * ( giveFreq - ( curTime - lastUsed ) ), outString, charsmax(outString), 2);         client_print(id, print_chat, "You have to wait %s to use this command again!", outString);         return;     }     give_item(id, "weapon_m4a1");     num_to_str(curTime, outString, charsmax(outString));     nvault_set(ghnVault, AuthID, outString); } #define TimerDays(%0)         ( %0 / 86400000 ) #define TimerHours(%0)      ( %0 % 86400000 / 3600000 ) #define TimerMinutes(%0)        ( %0 % 3600000 / 60000 ) #define TimerSeconds(%0)        ( %0 % 60000 / 1000 ) #define TimerMilliseconds(%0)   ( %0 % 1000 ) stock TimerFormat(hTimer, output[], maxlen, mode = 1, bool:full = false) {     new len;         if ( full || TimerDays(hTimer) )         len = formatex(output, maxlen, mode == 1 ? "%02d:" : "%dd ", TimerDays(hTimer));     if ( full || ( len && mode == 1 ) || TimerHours(hTimer) )         len += formatex(output[len], maxlen - len, mode == 1 ? "%02d:" : "%dh ", TimerHours(hTimer));     if ( full || ( len && mode == 1 ) || TimerMinutes(hTimer) )         len += formatex(output[len], maxlen - len, mode == 1 ? "%02d:" : "%dm ", TimerMinutes(hTimer));     if ( full || ( len && mode == 1 ) || TimerSeconds(hTimer) )         len += formatex(output[len], maxlen - len, mode == 1 ? "%02d." : "%ds ", TimerSeconds(hTimer));     if ( full || ! len || mode == 1 || TimerMilliseconds(hTimer) )         len += formatex(output[len], maxlen - len, mode == 1 ? "%03d" : "%dms", TimerMilliseconds(hTimer)); }
__________________
Black Rose is offline
bakir123
Senior Member
Join Date: Jan 2015
Location: Palestine, Hebron
Old 02-23-2017 , 16:38   Re: need small help!
Reply With Quote #17

Quote:
Originally Posted by Black Rose View Post
Code:
#include <amxmodx> #include <nvault> #include <fun> new ghnVault; new ghpcvarFrequency; public plugin_init() {     register_plugin("Give M4A1 by command", "1.0", "[ --{-@ ]");     ghnVault = nvault_open("GiveM4A1");     if ( ghnVault == INVALID_HANDLE )         set_fail_state("Couldn't open vault");     register_clcmd("say /gun", "user_clcmd");     ghpcvarFrequency = register_cvar("give_m4a1_frequency", "86400"); } public plugin_end()     nvault_close(ghnVault); public user_clcmd(id) {     new AuthID[32];     get_user_authid(id, AuthID, 31);     new curTime = get_systime();     new lastUsed = nvault_get(ghnVault, AuthID);     new giveFreq = get_pcvar_num(ghpcvarFrequency);     new outString[32];     if ( lastUsed + giveFreq > curTime ) {         TimerFormat(1000 * ( giveFreq - ( curTime - lastUsed ) ), outString, charsmax(outString), 2);         client_print(id, print_chat, "You have to wait %s to use this command again!", outString);         return;     }     give_item(id, "weapon_m4a1");     num_to_str(curTime, outString, charsmax(outString));     nvault_set(ghnVault, AuthID, outString); } #define TimerDays(%0)         ( %0 / 86400000 ) #define TimerHours(%0)      ( %0 % 86400000 / 3600000 ) #define TimerMinutes(%0)        ( %0 % 3600000 / 60000 ) #define TimerSeconds(%0)        ( %0 % 60000 / 1000 ) #define TimerMilliseconds(%0)   ( %0 % 1000 ) stock TimerFormat(hTimer, output[], maxlen, mode = 1, bool:full = false) {     new len;         if ( full || TimerDays(hTimer) )         len = formatex(output, maxlen, mode == 1 ? "%02d:" : "%dd ", TimerDays(hTimer));     if ( full || ( len && mode == 1 ) || TimerHours(hTimer) )         len += formatex(output[len], maxlen - len, mode == 1 ? "%02d:" : "%dh ", TimerHours(hTimer));     if ( full || ( len && mode == 1 ) || TimerMinutes(hTimer) )         len += formatex(output[len], maxlen - len, mode == 1 ? "%02d:" : "%dm ", TimerMinutes(hTimer));     if ( full || ( len && mode == 1 ) || TimerSeconds(hTimer) )         len += formatex(output[len], maxlen - len, mode == 1 ? "%02d." : "%ds ", TimerSeconds(hTimer));     if ( full || ! len || mode == 1 || TimerMilliseconds(hTimer) )         len += formatex(output[len], maxlen - len, mode == 1 ? "%03d" : "%dms", TimerMilliseconds(hTimer)); }
Thanks you very much bro
Great help to me
Really Thanks!
bakir123 is offline
Send a message via Skype™ to bakir123
bakir123
Senior Member
Join Date: Jan 2015
Location: Palestine, Hebron
Old 02-23-2017 , 18:30   Re: need small help!
Reply With Quote #18

but i still need one more thing
i want to change authid to name
i want it work for name
not for authid
bakir123 is offline
Send a message via Skype™ to bakir123
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 02-24-2017 , 19:12   Re: need small help!
Reply With Quote #19

I'm not helping anyone to convert it to work with non-steam servers.
__________________
Black Rose is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 02-24-2017 , 20:06   Re: need small help!
Reply With Quote #20

Do it yourself. This is not the suggestions section.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
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 07:39.


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