Is it possible to make no weapons in hands when ...
Moderator: Moderators
Is it possible to make no weapons in hands when ...
Is it possible to make no weapons in hands when players enter the game?
I mean they have no weapons on hand when they joined the game, they only can pick up the weapons I set on the ground, is it possible?
Thank you.
I mean they have no weapons on hand when they joined the game, they only can pick up the weapons I set on the ground, is it possible?
Thank you.
Last edited by Eversun on Thu Jun 26, 2003 4:13 am, edited 1 time in total.
-
Desert Eagle
- Captain
- Posts: 237
- Joined: Mon Jan 13, 2003 1:05 am
- Location: Mapping Bunker
- Contact:
Any command in a multiplayer with a $player attatched affects every player in the game.
I have played around with $player in mulitplayer, and it effects everyone, using some sort of if dmteam allies or axis will effect just that team. I do not know the script exactly, but it can be set up to take away one side or the others. I have been playing around with some way to just take the allies weapons myself for a prison escape map. If I get it working right, I will post it
I have played around with $player in mulitplayer, and it effects everyone, using some sort of if dmteam allies or axis will effect just that team. I do not know the script exactly, but it can be set up to take away one side or the others. I have been playing around with some way to just take the allies weapons myself for a prison escape map. If I get it working right, I will post it
Desert-Eagle
....The Eagle Has Landed...
....The Eagle Has Landed...
-
nuggets
- General
- Posts: 1006
- Joined: Fri Feb 28, 2003 2:57 am
- Location: U-england-K (england in the UK) :P
- Contact:
don't know if using if($player[]) command is a real command, but using the for loop would solve your problem, repeating that line up to 64 times would be a pain in the ass
for (local.i = 1; local.i < 65; local.i++)
if ($player[local.i])
$player[local.i] takeall
for (local.i = 1; local.i < 65; local.i++)
if ($player[local.i])
$player[local.i] takeall
hope this helps, prob not cos it's all foreign 2 me :-/
yes doing $player takeall will remove weapons from all players. This is what he asked for though isn't it?
Alternativly you could loop through the players and remove them individually. In fact because there is a delay between the map starting and the players weapons being loaded out it is sometimes better to do this. Here's a script I put together for a similar purpose.
The following script uses several user defined CVARS. It allows anyone who has rcon to configure a specific weapons only mode by setting a cvar to 1. So someone could type RCON <password> set rifleonly 1 in console and then every player would be loaded out with a bolt action rifle. Note this script was written for spearhead, I have no idea if it works in MOHAA
Alternativly you could loop through the players and remove them individually. In fact because there is a delay between the map starting and the players weapons being loaded out it is sometimes better to do this. Here's a script I put together for a similar purpose.
The following script uses several user defined CVARS. It allows anyone who has rcon to configure a specific weapons only mode by setting a cvar to 1. So someone could type RCON <password> set rifleonly 1 in console and then every player would be loaded out with a bolt action rifle. Note this script was written for spearhead, I have no idea if it works in MOHAA
Code: Select all
//Script that assigns players weapons after they join a team
//could change it to be randomised or something
Start:
//level waittill spawn
level waittill roundstart
//First set up an array of 44 to store the players status
for (local.i = 1; local.i <= 44; local.i++)
{
level.PlayerGunsReplace[local.i] = 0
}
//Set this server variable to 1 to clear all the others!
local.AllWeapons = getcvar(AllWeapons)
local.RifleOnly = getcvar(RifleOnly)
local.PistolOnly = getcvar(PistolOnly)
local.SilencedOnly = getcvar(SilencedOnly)
local.SniperOnly = getcvar(SniperOnly)
local.SMGOnly = getcvar(SMGOnly)
local.MGOnly = getcvar(MGOnly)
local.RocketOnly = getcvar(RocketOnly)
if (local.AllWeapons == "1")
{
setcvar RifleOnly "0"
setcvar PistolOnly "0"
setcvar SilencedOnly "0"
setcvar SniperOnly "0"
setcvar SMGOnly "0"
setcvar MGOnly "0"
setcvar RocketOnly "0"
setcvar AllWeapons "0"
end
}
if ( (local.RifleOnly == "1") || (local.PistolOnly == "1") || (local.SilencedOnly == "1") || (local.SniperOnly == "1") || (local.SMGOnly == "1") || (local.MGOnly == "1") || (local.RocketOnly == "1") )
{
RepeatTest:
//Array initialised now loop
for (local.y = 1; local.y <= $player.size; local.y++)
{
if (level.PlayerGunsReplace[local.y] == 0)
{
if ( isalive($player[local.y]) && ($player[local.y].health > 0) )
{
if ( ( $player[local.y].dmteam == axis ) || ( $player[local.y].dmteam == allies ) )
{
level.PlayerGunsReplace[local.y] = 1
if (local.RifleOnly == "1")
thread GiveRifle $player[local.y]
else if (local.PistolOnly == "1")
thread GivePistolOnly $player[local.y]
else if (local.SilencedOnly == "1")
thread GiveSilencedOnly $player[local.y]
else if (local.SniperOnly == "1")
thread GiveSniper $player[local.y]
else if (local.SMGOnly == "1")
thread GiveSMG $player[local.y]
else if (local.MGOnly == "1")
thread GiveMG $player[local.y]
else if (local.RocketOnly == "1")
thread GiveRocket $player[local.y]
}
}
}
}
wait 1
goto RepeatTest
}
end
LoadAxisOther local.player:
local.player item models/weapons/steilhandgranate.tik
local.player ammo grenade 1
local.player item models/weapons/nebelhandgranate.tik
local.player ammo smokegrenade 1
end
LoadAlliedOther local.player:
local.player item models/weapons/mills_grenade.tik
local.player ammo grenade 1
local.player item models/weapons/M18_smoke_grenade.tik
local.player ammo smokegrenade 1
end
GiveRifle local.player:
wait 0.5
local.player takeall
if (local.player.dmteam == axis)
{
local.player item models/weapons/p38.tik
local.player item models/weapons/kar98.tik
waitthread LoadAxisOther local.player
}
else
{
local.player item models/weapons/Webley_Revolver.tik
local.player item models/weapons/enfield.tik
waitthread LoadAlliedOther local.player
}
local.player useweaponclass "rifle"
local.player iprint "You have been given a bolt action rifle"
end
GivePistolOnly local.player:
wait 0.5
local.player takeall
if (local.player.dmteam == axis)
{
local.player item models/weapons/p38.tik
}
else
{
local.player item models/weapons/Webley_Revolver.tik
}
local.player useweaponclass "pistol"
local.player iprint "You have been given a pistol only"
end
GiveSilencedOnly local.player:
wait 0.5
local.player takeall
local.player item models/weapons/silencedpistol.tik
local.player useweaponclass "pistol"
local.player iprint "You have been given a silenced pistol only"
end
GiveSniper local.player:
wait 0.5
local.player takeall
if (local.player.dmteam == axis)
{
local.player item models/weapons/p38.tik
local.player item models/weapons/KAR98sniper.tik
waitthread LoadAxisOther local.player
}
else
{
local.player item models/weapons/Webley_Revolver.tik
local.player item models/weapons/springfield.tik
waitthread LoadAlliedOther local.player
}
local.player useweaponclass "rifle"
local.player iprint "You have been given a sniper rifle"
end
GiveSMG local.player:
wait 0.5
local.player takeall
if (local.player.dmteam == axis)
{
local.player item models/weapons/p38.tik
local.player item models/weapons/mp40.tik
waitthread LoadAxisOther local.player
}
else
{
local.player item models/weapons/Webley_Revolver.tik
local.player item models/weapons/sten.tik
waitthread LoadAlliedOther local.player
}
local.player useweaponclass "smg"
local.player iprint "You have been given an SMG"
end
GiveMG local.player:
wait 0.5
local.player takeall
if (local.player.dmteam == axis)
{
local.player item models/weapons/p38.tik
local.player item models/weapons/mp44.tik
waitthread LoadAxisOther local.player
}
else
{
local.player item models/weapons/Webley_Revolver.tik
local.player item models/weapons/bar.tik
waitthread LoadAlliedOther local.player
}
local.player useweaponclass "mg"
local.player iprint "You have been given a Machine Gun"
end
GiveRocket local.player:
wait 0.5
local.player takeall
if (local.player.dmteam == axis)
{
local.player item models/weapons/p38.tik
local.player item models/weapons/panzerschreck.tik
waitthread LoadAxisOther local.player
}
else
{
local.player item models/weapons/Webley_Revolver.tik
local.player item models/weapons/bazooka.tik
waitthread LoadAlliedOther local.player
}
local.player useweaponclass "heavy"
local.player iprint "You have been given a rocket launcher"
end
[VS-UK]Capt.Parts[BnHQ]
-
Desert Eagle
- Captain
- Posts: 237
- Joined: Mon Jan 13, 2003 1:05 am
- Location: Mapping Bunker
- Contact: