VIP Mod Syntax Problem

Author Topic: VIP Mod Syntax Problem  (Read 2570 times)

Lol.. Anthony... He told me I didnt know what coding is

Lol.. Anthony... He told me I didnt know what coding is
you're at least 10x more experienced than him judging by the syntax in this code

use hasItemOnList with the autoVIP list and %this.bl_id
If it's true then set them to VIP.

Mind giving me a full function for that?

Code: [Select]
function GameConnection::AutoAdminCheck(%client)
{
if(hasItemonList($Pref::Server::AutoVIPList,%client.bl_id))
{
//Make the client a VIP here
}
return Parent::AutoAdminCheck(%client);
}

Make sure you put it inside the package.

the hasItemOnList() isn't default with vanilla blockland is it?

the Item functions arent default, however, i took liberty of remaking them.

Code: [Select]
function hasItemOnList(%string,%item)
{
for(%i=0;%i<getWordCount(%string);%i++)
{
%word = getWord(%string,%i);
if(%word $= %item)
return true;
}
return false;
}

function addItemToList(%string,%item)
{
return trim(%string SPC %item); //wow so hard
}

function removeItemFromList(%string,%item)
{
for(%i=0;%i<getWordCount(%string);%i++)
{
%word = getWord(%string,%i);
if(%word $= %item)
continue;
%fString = %fString SPC %word;
}
return trim(%fString);
}

put in your script and they should work.
Just incase someone doesnt have a working set of item functions (like crown)

Code: [Select]
function addItemToList(%string,%item)
{
if(!hasItemOnList(%string, %item))
%string = %string SPC %item;
return %string;
}
Fixed.
You don't want the same thing to be there 2 times.