Author Topic: Cant drop weapon script  (Read 1010 times)

I need a can't drop weapon script for a build. If anyone can make one thanks.

Code: [Select]
...
// Dynamic properties defined by the scripts
image = gunImage;
canDrop = true;
...
I am pretty sure you can change it there.

Code: [Select]
...
// Dynamic properties defined by the scripts
image = gunImage;
canDrop = true;
...
I am pretty sure you can change it there.

lold

He means globally.

Code: [Select]
package plzNoDropWeponsIBegsOfYou
{
function serverCmdDropWeapon(%client, %slot)
{
// forget you
}
};
activatePackage(plzNoDropWeponsIBegsOfYou);


Code: [Select]
package dropstop
{
function serverCmdDropWeapon( %client, %slot )
{
if( %client.minigame == 1 ) //If they're in a minigame.
{
if( %client.minigame.dropstop )  //if dropstop is on, don't do anything.
return;
}
Parent::ServerCmdDropWeapon( %client, %slot );  //if it isn't on, or they're not in a minigame, do the normal grove.
}
};
activatePackage(dropstop);

function ServerCmdDropStopTog( %client )
{
if( %client.minigame== 0 || %client.minigame== -1 || %client != %client.minigame.owner)  //If they're not the owner of a minigame, yell at them.
{
messageclient(%client, '',"\c2You must be the owner of a minigame to use this command");
return;
}
if( %client.minigame.dropstop ) //If dropstop is on, turn it of and tell them so.
{
%client.minigame.dropstop = 0;
messageclient(%client, '',"\c1Drop weapon prevention is now \c0off\c1.");
}
else  //If dropstop is off, turn it on and tell them so.
{
%client.minigame.dropstop = 1;
messageclient(%client, '',"\c1Drop weapon prevention is now \c2on\c1.");
}
}
Better code.  This is minigame specific, and the owner of the minigame can turn the drop prevention on and off by typing /DropStopTog.  Untested, but it should work.

There is a mod for this already, search.

There is a mod for this already, search.

why dont you give us a link, lol, it defeats the point of searching.

I don't have the link on-hand. I have the mod, though.

I don't have the link on-hand. I have the mod, though.
It seems that I can't find it, will you send it?

Code: [Select]
package dropstop
{
function serverCmdDropWeapon( %client, %slot )
{
if( %client.minigame == 1 ) //If they're in a minigame.
{
if( %client.minigame.dropstop )  //if dropstop is on, don't do anything.
return;
}
Parent::ServerCmdDropWeapon( %client, %slot );  //if it isn't on, or they're not in a minigame, do the normal grove.
}
};
activatePackage(dropstop);

function ServerCmdDropStopTog( %client )
{
if( %client.minigame== 0 || %client.minigame== -1 || %client != %client.minigame.owner)  //If they're not the owner of a minigame, yell at them.
{
messageclient(%client, '',"\c2You must be the owner of a minigame to use this command");
return;
}
if( %client.minigame.dropstop ) //If dropstop is on, turn it of and tell them so.
{
%client.minigame.dropstop = 0;
messageclient(%client, '',"\c1Drop weapon prevention is now \c0off\c1.");
}
else  //If dropstop is off, turn it on and tell them so.
{
%client.minigame.dropstop = 1;
messageclient(%client, '',"\c1Drop weapon prevention is now \c2on\c1.");
}
}
Better code.  This is minigame specific, and the owner of the minigame can turn the drop prevention on and off by typing /DropStopTog.  Untested, but it should work.
Doesn't work, I can still drop my items.

Did you start a minigame, and type "/dropstoptog"?

Did you start a minigame, and type "/dropstoptog"?
I tried it without a minigame, It told me that I wasnt the owner of the mini. Then I started a minigame. I typed /dropstoptog and it said that it was off. Then I tried to drop my gun and it dropped. Then I typed /dropstoptog and it said it was on, then I tried to drop my gun and it dropped.

Code: [Select]
package dropstop
{
function serverCmdDropTool( %client, %slot )
{
if( %client.minigame == 1 ) //If they're in a minigame.
{
if( %client.minigame.dropstop )  //if dropstop is on, don't do anything.
return;
}
Parent::ServerCmdDropWeapon( %client, %slot );  //if it isn't on, or they're not in a minigame, do the normal grove.
}
};
activatePackage(dropstop);

function ServerCmdDropStopTog( %client )
{
if( %client.minigame== 0 || %client.minigame== -1 || %client != %client.minigame.owner)  //If they're not the owner of a minigame, yell at them.
{
messageclient(%client, '',"\c2You must be the owner of a minigame to use this command");
return;
}
if( %client.minigame.dropstop ) //If dropstop is on, turn it of and tell them so.
{
%client.minigame.dropstop = 0;
messageclient(%client, '',"\c1Drop weapon prevention is now \c0off\c1.");
}
else  //If dropstop is off, turn it on and tell them so.
{
%client.minigame.dropstop = 1;
messageclient(%client, '',"\c1Drop weapon prevention is now \c2on\c1.");
}
}
Better code.  This is minigame specific, and the owner of the minigame can turn the drop prevention on and off by typing /DropStopTog.  Untested, but it should work.
Try it now, I was going by what the other "coder" posted above me for what the server command to drop a weapon was.  I just checked ingame what it was, and fixed it.

Make it message the entire minigame of the fact.