Raised This Month: $ Target: $400
 0% 

Special clcmd with rounds support


Post New Thread Reply   
 
Thread Tools Display Modes
liryck
Senior Member
Join Date: Mar 2007
Location: Venezuela
Old 03-20-2010 , 03:33   Re: Special clcmd with rounds support
Reply With Quote #11

srry if i divert the threat but what this mean the % some example or explain

PHP Code:
RoundCount get_pcvar_num(CvCmdDuration); 
liryck is offline
Send a message via MSN to liryck
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-20-2010 , 05:52   Re: Special clcmd with rounds support
Reply With Quote #12

% = modulo : http://en.wikipedia.org/wiki/Modulo_operation

Here it will return 0 each x times ( x = value from the cvar ) to know when x rounds have passed.
__________________
Arkshine is offline
Old 03-20-2010, 08:06
Bishop
This message has been deleted by Bishop. Reason: Internet is stupid and double posted
Bishop
Member
Join Date: Nov 2004
Location: Japan
Old 03-20-2010 , 08:07   Re: Special clcmd with rounds support
Reply With Quote #13

I have a feeling that arkshine is trying to confuse you . Feel free to read up on mod but it simple terms it will return the remainding value after division

For example: 9 / 4 = 2 with 1 remainder yes? ( Rememeber we are talking whole numbers not decimals) 9 % 4 will return a value of 1

Notice in the script it the function bools roundsLeft != 0 Because the ONLY time roundsLeft will return 0 is when both numbers are equal ( In other words the remainder is zero.. 9 / 9 = 1 with 0 remainders ... 9 % 9 = 0)
Bishop is offline
Send a message via MSN to Bishop Send a message via Skype™ to Bishop
KadiR
Unnecessary Member
Join Date: Aug 2008
Location: Zürich / Switzerland
Old 03-20-2010 , 12:26   Re: Special clcmd with rounds support
Reply With Quote #14

Quote:
Originally Posted by wrecked_ View Post
PHP Code:
client_print(idprint_chat"Wait %d rounds to use cmd again."get_pcvar_numCvCmdDuration ) - roundsLeft); 
It does still show it wrong.
KadiR is offline
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 03-20-2010 , 13:39   Re: Special clcmd with rounds support
Reply With Quote #15

Try this one:
PHP Code:
#include <amxmodx>

new RoundCount 1CvCmdDuration;
new 
bool:Used[33];

public 
plugin_init() {
    
register_event("HLTV""event_RoundStart""a""1=0""2=0");
    
register_clcmd("myclcmd""clcmd_handler");
    
CvCmdDuration register_cvar("amx_cmdduration""3");
}

public 
client_connect(id) {
    
Used[id] = false;
}

public 
logevent_RoundStart() {
    
RoundCount++;
}

public 
clcmd_handler(id) {
    new 
roundsLeft RoundCount get_pcvar_num(CvCmdDuration);
    
    if (
roundsLeft != || Used[id]) {
        
client_print(idprint_chat"Wait %d rounds to use cmd again."get_pcvar_num(CvCmdDuration) - roundsLeft);
        return 
PLUGIN_HANDLED;
    }
    
Used[id] = true;
    
      
// your code goes here
    
    
return PLUGIN_HANDLED;

Seta00 is offline
KadiR
Unnecessary Member
Join Date: Aug 2008
Location: Zürich / Switzerland
Old 03-21-2010 , 09:43   Re: Special clcmd with rounds support
Reply With Quote #16

That one doesn't work at all for me.

EDIT:
L 03/21/2010 - 146:42: Function "event_RoundStart" was not found

Last edited by KadiR; 03-21-2010 at 09:47.
KadiR is offline
Bishop
Member
Join Date: Nov 2004
Location: Japan
Old 03-21-2010 , 10:09   Re: Special clcmd with rounds support
Reply With Quote #17

Seta was probably tired or in a hurry lol

PHP Code:
register_event("HLTV""event_RoundStart""a""1=0""2=0"
change to

PHP Code:
register_event("HLTV""logevent_RoundStart""a""1=0""2=0"

Last edited by Bishop; 03-21-2010 at 10:18. Reason: spelling lol
Bishop is offline
Send a message via MSN to Bishop Send a message via Skype™ to Bishop
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 08:35.


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