Script Name:WeaponCollecting
Script Description: Weapons spawn in the map at defined places and you can collect them by walking over them
Original Author: Dr.Thrax
Core Version:2.6.3
Code:
This Script is .ini based , that means there is this "Weaponscollecting.ini" where you do all the important stuff:
[MAP_N1] // The part you also change in the Weapons-Collect.pas
MapName=Map // Your Map
Weapon_Limit=0 // Number of Weapon-Spawnpoints
FirstWep=0 // the primary Weapon for default (otherwise it won't function correctly)
Weapon#1=0 // Weapon (by Number (for example 1 fo Deagle)) on Spawn point #1
Weapon#2=0 // Weapon (by Number (for example 1 fo Deagle)) on Spawn point #2
Weapon#3=0 // Weapon (by Number (for example 1 fo Deagle)) on Spawn point #3
Weapon#4=0 ...
Weapon#5=0 ...
Weapon#6=0 ...
...
// I made this script for maximum 20 Weapon Spawnpoints
Weapon#1_Spawn_X= 0 // Spawn_X_coordinate for Weapon #1 (I made a Command "/wep (number of spawnpoint)" for auto save of coordinates. They will be saved in the coordinates.ini)
Weapon#1_Spawn_Y= 0 // Spawn_Y_coordinate for Weapon #1
Weapon#2_Spawn_X= 0 ...
Weapon#2_Spawn_Y= 0 ...
...
...
// Again maximum 20 SpawnPoints
If you've choosen your map you can simply add it by changing these parts of the Script
procedure ActivateServer();
begin
OnMapStart('MAP_N1');
//OnMapStart('MAP_N2');
//OnMapStart('MAP_N3');
end;
procedure AppOnIdle(Ticks: integer);
begin
WeaponSpawn('MAP_N1');
//WeaponSpawn('MAP_N2');
//WeaponSpawn('MAP_N3');
end;
procedure OnJoinTeam(ID, Team: byte);
begin
DisableWeaponsOnJoin('MAP_N1',ID);
//DisableWeaponsOnJoin('MAP_N2',ID);
//DisableWeaponsOnJoin('MAP_N3',ID);
end;
procedure OnMapChange(NewMap: string);
begin
SpawnWeaponsOnNewMap('MAP_N1');
DisableWeaponsOnMapChange('MAP_N1')
//SpawnWeaponsOnNewMap('MAP_N2');
//DisableWeaponsOnMapChange('MAP_N2')
//SpawnWeaponsOnNewMap('MAP_N3');
//DisableWeaponsOnMapChange('MAP_N3')
end;
The functions that go with this Weapons-Collect.Pas are saved in the Core.pas
It's just that its easier to understand , so i put it in a seperate file.
The Weapons will spawn at this Point and if someone takes up the Weapon it will spawn again at the same Point.
I set the secondary weapons active for default , so that you can only collect the primary's
I used it first on my UT04:Bombing Run server (lostgalaxy.de:1100)
and it works quite good!
Have Fun
Dr.Thrax
Edit: The .ini files have to be in the default Soldat Folder