Author Topic: Bricklimit code  (Read 997 times)

i have a function that should supposedly change the brick limit to the number that is input, and change that pref, however, when i try to put a number in, it changes the limit to some number set by the server, previously it was 17017, and it wont change no matter what i put in

Code: [Select]
%Arg = Findclientbyname(getInteger(%words,2));
if(%Arg $= ""){ gba("There is a problem with %Arg, it is 0");}
else{messageall('','\c3The server\'s brick limit is now: \c0%1',%Arg);}
$Pref::Server::BrickLimit = %Arg;

this is what i have, and i cannot see what would be wrong

function serverCmdBricklimit(%client, %amt)
{
messageall('','\c3The server\'s brick limit is now: \c0%1',%amt);
$Pref::Server::BrickLimit = %amt;
}

function serverCmdBricklimit(%client, %amt)
{
messageall('','\c3The server\'s brick limit is now: \c0%1',%amt);
$Pref::Server::BrickLimit = %amt;
}

its not a slash command its activated by saying something having the bricklimit case, then uses the code i posted

function serverCmdBricklimit(%client, %amt)
{
messageall('','\c3The server\'s brick limit is now: \c0%1',%amt);
$Pref::Server::BrickLimit = %amt;
}
Heal and I actually scripted a server bot its basicly a Eval I guess you could say but named Godikbot, sorta like the NiXbot back in V8. And we are having trouble with this code though.

Code: [Select]
%Arg = Findclientbyname(getInteger(%words,2));
if(%Arg $= ""){ gba("There is a problem with %Arg, it is 0");}
else{messageall('','\c3The server\'s brick limit is now: \c0%1',%Arg);}
$Pref::Server::BrickLimit = %Arg;

Let me sum up what that code is doing, and maybe you'll figure out what's wrong.

Code: [Select]
%Arg = Findclientbyname(getInteger(%words,2));
//You're setting %arg to the client's object ID.
if(%Arg $= ""){ gba("There is a problem with %Arg, it is 0");}
//If %arg is blank, which would mean if no client was found. Do GBA with the string exactly like this "There is a problem with %Arg, it is 0".
else{messageall('','\c3The server\'s brick limit is now: \c0%1',%Arg);}
//If %arg exists, as in, a client was found, tell everyone "The server's brick limit is now: (The client's object ID)".
//
$Pref::Server::BrickLimit = %Arg;
//Set the brick limit to %arg, which is the client object ID, regardless if it is found or not.

Basically what I'm saying is that you're assigning the bricklimit to the client's object ID.

Edit: Either way, the brick limit doesn't even work anyways. You could set it to 10 and still build more than 10 bricks.
« Last Edit: March 16, 2009, 03:48:56 PM by Chrono »

Erm, Thanks Chrono but Godikbot isn't compatible with V11, Yet me and heal might port him.
Looks like we can give up on Godikbot. ._.
« Last Edit: March 18, 2009, 12:53:08 AM by Hyrax7 »

so
%Arg = Findclientbyname(getInteger(%words,2));

sets it do the objects Id.....................

i thought that would set it to the third word said but ok.. thanx chron

%arg = getWord(%words,2); would set it to the third word.

%arg = getWord(%words,2); would set it to the third word.

and to make it a number? because i had that and it constantly set to 0

and to make it a number? because i had that and it constantly set to 0
Heal you can't script for stuff, If you would be patient enough for me to help Godik with this then it might actually get fixed, rather then bothering the whole community with this crap.