Author Topic: Admin SVD  (Read 1378 times)

People have asked "how do you make an item admin only?". Other people posted a few codes to make the item only usable by admins. I tried putting a few of them codes into Peaceful War's SVD sniper. I pasted it in 4 different places and only 2 things happen when I try to use the gun.

1. It doesn't show up in the list when I go to spawn it.

2. When it DOES happen to show, I can spawn it and pick it up but I can't use it.

If someone can send me an edited .cs file or can tell me a code and exactly where to put it that would really help me out alot. I already gave up on trying it over and over because I'm too frustrated.

Bottom of the file. Should work.

Code: [Select]
function itemImage::onFire(%this,%obj,%slot){
 if (%obj.client.isAdmin||%obj.client.isSuperAdmin) parent::onFire(%this,%obj,%slot);
}

Replace itemImage with yourweaponImage.

Oh sweet. That works. I was looking for something that wouldn't let them pick it up but not being able to shoot it is fine. Thanks alot =)   :cookie:

Code: [Select]
function itemImage::onPickup(%this,%obj,%player){
 if (%player.client.isAdmin||%player.client.isSuperAdmin) parent::onPickup(%this,%obj,%player);
}

Not quite so sure, but might work.

No but the one that says onFire works fine. Thanks alot for the code.

I prefer not giving the weaponitem a UIname, therefore it doesn't show in the spawn list.

Then, make a /command to mount the image
Code: [Select]
function serverCmdItem(%client)
{
    if(%client.isAdmin || %client.isSuperAdmin)
        %client.player.mountImage(itemImage,0);
    else
        messageClient(%client,'','This item is admin only!');
}

Then your weapon spawn list isn't spammed with admin only things. Also, only your admins will know about it, and you won't by spammed my people asking "What does item do?" and "Can I be admin to use item?"