Raised This Month: $ Target: $400
 0% 

how do i make a=b?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Owyn
Veteran Member
Join Date: Nov 2007
Old 01-12-2009 , 07:40   how do i make a=b?
Reply With Quote #1

Code:
  

    read_argv(2, minutes, 7)

    new length = str_to_num(minutes);
    new maxl[31] = "40000";
    new maxlength = str_to_num(maxl);

    if ( length == 0  || length > maxlength )
    {
        minutes[7] = maxl[7];
        set_task(2.0, "TaskDisconnectPlayer", player)
    }
    else
    {
        set_task(2.0, "TaskDisconnectPlayer", player)
    }
    
    return PLUGIN_HANDLED
looks like my condition works but it can't do minutes = maxl

Last edited by Owyn; 01-12-2009 at 10:14.
Owyn is offline
Send a message via ICQ to Owyn
lucius
Senior Member
Join Date: Aug 2007
Location: Netherlands
Old 01-12-2009 , 08:01   Re: how do i make a=b?
Reply With Quote #2

Try
Code:
copy(minutes, 7, maxl)
__________________
"Computer games don't affect kids, I mean if Pac Man affected us as kids, we'd all be running around in dark rooms, munching pills and listening to repetitive electronic music." Marcus Brigstock
lucius is offline
Send a message via MSN to lucius
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 01-12-2009 , 08:30   Re: how do i make a=b?
Reply With Quote #3

try
PHP Code:
new maxlength;
maxlength str_to_num(maxl);

// or at least
maxlength maxl;

// and then somewhere
str_to_num(maxleghth); 
__________________
xPaw is offline
Owyn
Veteran Member
Join Date: Nov 2007
Old 01-12-2009 , 09:53   Re: how do i make a=b?
Reply With Quote #4

xPaw
uhm.. i'm tring to make minutes = maxlenghth, or just 40000
Owyn is offline
Send a message via ICQ to Owyn
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 01-12-2009 , 09:56   Re: how do i make a=b?
Reply With Quote #5

PHP Code:
minutes 40000.0
?
__________________
xPaw is offline
Owyn
Veteran Member
Join Date: Nov 2007
Old 01-12-2009 , 10:10   Re: how do i make a=b?
Reply With Quote #6

Quote:
Originally Posted by xPaw View Post
PHP Code:
minutes 40000.0
?
Error: Array must be indexed (variable "minutes") on line 333

nvm, i used variant of lucius and it worked.

Last edited by Owyn; 01-12-2009 at 10:35.
Owyn is offline
Send a message via ICQ to Owyn
lucius
Senior Member
Join Date: Aug 2007
Location: Netherlands
Old 01-12-2009 , 10:42   Re: how do i make a=b?
Reply With Quote #7

You +karma'd me cause it worked. (Thanks btw) Is there still a problem?
__________________
"Computer games don't affect kids, I mean if Pac Man affected us as kids, we'd all be running around in dark rooms, munching pills and listening to repetitive electronic music." Marcus Brigstock
lucius is offline
Send a message via MSN to lucius
Owyn
Veteran Member
Join Date: Nov 2007
Old 01-12-2009 , 10:44   Re: how do i make a=b?
Reply With Quote #8

yup, look here http://forums.alliedmods.net/showthread.php?t=83617
Owyn is offline
Send a message via ICQ to Owyn
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 01:41.


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