Spawn without weapons

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Ramah Palmer
Warrant Officer
Posts: 131
Joined: Sun May 25, 2003 10:13 am
Location: Nottinghamshire: UK

Spawn without weapons

Post by Ramah Palmer »

Ok, this is my second question in as many days that I am doubtful is in the right forum. Possibly better in scripting but as I know NOTHING about that I'll place it in here.
Is it possible to have a player spawn in a multiplayer map without any weapons?
Mapping is just INCREDIBLY time consuming.
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Post by Alcoholic »

yeah this should work:

Code: Select all

while (1)
{
    waitframe
    $player thread noweapon
}
end

noweapon:

    if (self.runningthread == 1)
    {
        end
    }
    else
    {
        self.runningthread = 1
        self thread noweaponspawn
    }
    end

noweaponspawn:

    self waittill death
    self waittill spawn
    self takeall
    
    thread noweaponspawn
    end
i may have forgot something, but that should work. :wink:
Ramah Palmer
Warrant Officer
Posts: 131
Joined: Sun May 25, 2003 10:13 am
Location: Nottinghamshire: UK

Post by Ramah Palmer »

Thanks Alcoholic. I will try it later today.
Just one thing though if you see this before I start - where abouts in the script should this go? Sorry but I'm a total script spaz.
Does it go like, before the prespawn?
Thanks.
Mapping is just INCREDIBLY time consuming.
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Post by Alcoholic »

see the while (1)? place that at the end of your level waittill roundstart (if you dont have that then waittill spawn). it should automatically replace the end there. then after that first end, just paste everything else thats there.
Ramah Palmer
Warrant Officer
Posts: 131
Joined: Sun May 25, 2003 10:13 am
Location: Nottinghamshire: UK

Post by Ramah Palmer »

Ok, I'm sorry to dredge up such an old thread but I never did get this working. I put it on the back-burner coz I had plenty of other things to do on my map but now it is almost complete and this has got kind of urgent for me.
I did another search and found some other threads regarding this same topic and I tried every way suggested but nothing seems to work and I always spawn drawing that damned Thompson.
Most of the ways I've seen written involve:

$player takeall

But this just doesn't seem to want to work for me. Can anyone place an example of a working script with this noweapon thing here so I can check I've got everything in the correct places?
Thanks in advance. :)
Mapping is just INCREDIBLY time consuming.
User avatar
CorporalPunishment
Sergeant
Posts: 62
Joined: Mon May 19, 2003 5:25 am

Almost

Post by CorporalPunishment »

I have no weapon areas in the spawn parts of my map.
The players spawn on top of a trigger that does "holster" then "takeall"

There are also triggers that remove weapons from players
as they re-enter the spawn part of the base.

So there is no spawn killing possible.

However if you have a primed grenade when the "takeall"
is executed it crashes the server.

Is there a way to safely remove weapons with a trigger?
I'm thinking that an +attack command may throw the grenade
and then do takeall.

Anyone know how to script that?
User avatar
CorporalPunishment
Sergeant
Posts: 62
Joined: Mon May 19, 2003 5:25 am

Here's my Script

Post by CorporalPunishment »

Take_Weapons:

local.player = parm.other

if ((local.player.Equip != 0) || (local.player.dmteam ! local.player.curteam) )
{
// iprintln ("Weapons Removed!" )
local.player holster
local.player.Equip = 0

local.player playsound rifle_drop1
local.player.curteam = local.player.dmteam
local.player takeall

}

end
Post Reply