Poll

Keep it?

Yes
18 (64.3%)
No
10 (35.7%)

Total Members Voted: 28

Author Topic: Script_VIP | It's here!  (Read 4015 times)

fixed grammar issues and add /vip add and vip_add

Quote
function servercmdVIPAdd(%c,%b)
function servercmdVIP Add(%c,%b)
function servercmdVIP_Add(%c,%b)


{
That's not going to work.

That's not going to work.
god damn, I'm dumb on this stuff

This looks nice overall, needs a few edits but you got my download.

god damn, I'm dumb on this stuff
Well revert it then? The current script is just going to give syntax errors.

Well revert it then? The current script is just going to give syntax errors.
ok, fixing. did
function servercmdVIP_Add(%c,%b)

is that good?
« Last Edit: January 30, 2014, 10:53:16 AM by Hawt »

ok, fixing. did
function servercmdVIP_Add(%c,%b)

is that good?
That would be /vip_add, so no.

function servercmdVIP(%client, %option, %target)

%option would be "add" or "remove".

There. As you obviously have no real clue of how to code. I fixed up Marble Man's junky code and formatting. I also added /VIP Add, /VIP Remove, /VIP_Add, and /VIP_Remove.

Code: [Select]
registerInputEvent("fxDtsBrick", "onActivateVIP", "Self fxDtsBrick" TAB "Player Player" TAB "Client GameConnection" TAB "Minigame Minigame");

package VIP
{
function serverCmdMessageSent(%client, %msg)
{
if($canVIP[%client.BL_ID])
{
%client.clanSuffix = %client.clanSuffix @ "\c6[\c4VIP\c6]";
}

parent::serverCmdMessageSent(%client, %msg);
}

function fxDTSBrick::onActivate(%obj, %player, %client, %pos, %vec)
{  
parent::onActivate(%obj, %player, %client, %pos, %vec);

if($canVIP[%client.BL_ID])
{
$InputTarget_["Self"] = %obj;
$InputTarget_["Player"] = %player;
$InputTarget_["Client"] = %client;

if($Server::LAN)
{
$InputTarget_["MiniGame"] = getMiniGameFromObject(%client);
}

else
{
if(getMiniGameFromObject(%brick) == getMiniGameFromObject(%client))
{
$InputTarget_["MiniGame"] = getMiniGameFromObject(%brick);
}

else
{
$InputTarget_["MiniGame"] = 0;
}
}

%obj.processInputEvent("onActivateVIP", %client);
}
}
};
activatepackage(VIP);

function serverCmdVIPAdd(%client, %target)
{
if(!%client.isSuperAdmin)
{
return;
}

if(!isInt(%target))
{
if(!isObject(%targetClient = findClientByName(%target)))
{
messageClient(%client, '', "\c5Could not find \c6\"" @ %target @ "\"\c5.");

return;
}

if($canVIP[%targetClient.BL_ID])
{
messageClient(%client, '', "\c6\"" @ %targetClient.name @ "\" \c5(\c6" @ %targetClient.BL_ID @ "\c5) is already on the \c2VIP List");

return;
}

$canVIP[%targetClient.BL_ID] = true;
messageClient(%client, '', "\c5Added \c6\"" @ %targetClient.name @ "\" \c5(\c6" @ %targetClient.BL_ID @ "\c5) to the \c2VIP List");
export("$canVIP*", "config/VIP.cs");
}

else
{
if($canVIP[%target])
{
messageClient(%client, '', "\c6\"" @ %target @ "\"\c5 is already on the \c2VIP List");

return;
}

$canVIP[%target] = 1;
messageClient(%client, '', "\c5Added \c6\"" @ %target @ "\"\c5 to the \c2VIP List");
export("$canVIP*", "config/VIP.cs");
}
}

function serverCmdVIPRemove(%client, %target)
{
if(!%client.isSuperAdmin)
{
return;
}

if(!isInt(%target))
{
if(!isObject(%targetClient = findClientByName(%target)))
{
messageClient(%client, '', "\c5Could not find \c6\"" @ %target @ "\"\c5 to the \c2VIP List");

return;
}

if(!$canVIP[%targetClient.BL_ID])
{
messageClient(%client, '', "\c6\"" @ %targetClient.name @ "\" \c5(\c6" @ %targetClient.BL_ID @ "\c5) is not on the \c2VIP List");

return;
}

$canVIP[%targetClient.BL_ID] = false;
messageClient(%client, '', "\c5Removed \c6\"" @ %targetClient.name @ "\" \c5(\c6" @ %targetClient.BL_ID @ "\c5) from the \c2VIP List");
  export("$canVIP*","config/VIP.cs");
}

else
{
if(!$canVIP[%target])
{
messageClient(%client, '', "\c6\"" @ %target @ "\"\c5 is not on the \c2VIP List");

return;
}

$canVIP[%target] = 0;
messageClient(%client, '', "\c5Removed \c6\"" @ %target @ "\"\c5 to the \c2VIP List");
export("$canVIP*", "config/VIP.cs");
}
}

function serverCmdVIP(%client, %option, %target)
{
if(%option $= "Add")
{
serverCmdVIPAdd(%client, %target);
}

else if(%option $= "Remove")
{
serverCmdVIPRemove(%client, %target);
}
}

function serverCmdVIP_Add(%client, %target)
{
serverCmdVIPAdd(%client, %target);
}

function serverCmdVIP_Remove(%client, %target)
{
serverCmdVIP_Remove(%client, %target);
}

function isInt(%num)
{
        return %num $= %num * 1;
}

if(isFile("config/VIP.cs"))
{
exec("config/VIP.cs");
}
« Last Edit: January 30, 2014, 12:10:45 PM by jes00 »

fine I'll use it
I was just releasing it

A hell of a lot easier than using VCE, i needed to add a new brick for every person i wanted in there

ok, fixing. did
function servercmdVIP_Add(%c,%b)

is that good?
Just an fyi, you'll want to do something like what Zapk said,
Code: [Select]
function serverCmdVIP(%client, %option, %target)
{
    if(%option $= "Add")
    {
         hurr
    }
    else if(%option $= "Remove")
    {
         durr
    {
    else
        return;
}

Hawt, if we are using this in Elevator, it won't be custom if everyone else has it. I suggest you take off link.

Hawt, if we are using this in Elevator, it won't be custom if everyone else has it. I suggest you take off link.
I shouldn't even have released this. I never even loving said this was for Elevator.

I have a mod like this that uses tiers for levels, it finds bl_ids instead. If they are on the server, they are granted vip, if not, it will still be added to the vip list.

Just an fyi, you'll want to do something like what Zapk said,
Code: [Select]
function serverCmdVIP(%client, %option, %target)
{
    if(%option $= "Add")
    {
         hurr
    }
    else if(%option $= "Remove")
    {
         durr
    }
    else
        return;
}
ftfy