AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   how do i make a=b? (https://forums.alliedmods.net/showthread.php?t=83604)

Owyn 01-12-2009 07:40

how do i make a=b?
 
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

lucius 01-12-2009 08:01

Re: how do i make a=b?
 
Try
Code:

copy(minutes, 7, maxl)

xPaw 01-12-2009 08:30

Re: how do i make a=b?
 
try
PHP Code:

new maxlength;
maxlength str_to_num(maxl);

// or at least
maxlength maxl;

// and then somewhere
str_to_num(maxleghth); 


Owyn 01-12-2009 09:53

Re: how do i make a=b?
 
xPaw
uhm.. i'm tring to make minutes = maxlenghth, or just 40000

xPaw 01-12-2009 09:56

Re: how do i make a=b?
 
PHP Code:

minutes 40000.0

?

Owyn 01-12-2009 10:10

Re: how do i make a=b?
 
Quote:

Originally Posted by xPaw (Post 742772)
PHP Code:

minutes 40000.0

?

Error: Array must be indexed (variable "minutes") on line 333

nvm, i used variant of lucius and it worked.

lucius 01-12-2009 10:42

Re: how do i make a=b?
 
You +karma'd me cause it worked. (Thanks btw) Is there still a problem?

Owyn 01-12-2009 10:44

Re: how do i make a=b?
 
yup, look here http://forums.alliedmods.net/showthread.php?t=83617


All times are GMT -4. The time now is 01:41.

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