How to chose the spawn weapon for Admin
Moderator: Core Staff
How to chose the spawn weapon for Admin
Hey guys,
I recently made a server but I have a problem.
I made my friends Admin but they don't want to spawn with a Desert Eagle but with a sort of Brickblaster or Gravity gun.
Thanks if you can help I heard about scripts but I don't know how to script...
I recently made a server but I have a problem.
I made my friends Admin but they don't want to spawn with a Desert Eagle but with a sort of Brickblaster or Gravity gun.
Thanks if you can help I heard about scripts but I don't know how to script...
Re: How to chose the spawn weapon for Admin
The weapon admins spawn with is saved in
self.cj["weapon"]
And is reset to desert eagle 0.05 secs after you spawn
So you can only overwrite the code, or make another script, waiting for the player to spawn, to remove the deagle and give him another weapon
(Overwriting would be cleaner and easier, but since you don't have access to the source code you'll have to find another way)
self.cj["weapon"]
And is reset to desert eagle 0.05 secs after you spawn
So you can only overwrite the code, or make another script, waiting for the player to spawn, to remove the deagle and give him another weapon
(Overwriting would be cleaner and easier, but since you don't have access to the source code you'll have to find another way)
Code: Select all
_spawn() Â Â Â Â //would run on every player on spawn
{
weapon = "remington700_mp";
if(isDefined(self.cj["status"]) && self.cj["status"] >= 1)
{
wait 0.1;
self takeWeapon("deserteagle_gold") Â //or just leave it, if you want 3 Weapons (+c4 hands)
self giveWeapon(Weapon);
}
}
-
- Core Staff
- Posts: 13315
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: How to chose the spawn weapon for Admin
The admin weapon was supposed to be dvar based but unfortunately it is something I overlooked and never changed.
If I (or someone else) gets round to releasing a next version, then it will be changed.
For the time being, a custom script as above will do the trick.
If I (or someone else) gets round to releasing a next version, then it will be changed.
For the time being, a custom script as above will do the trick.

Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
Re: How to chose the spawn weapon for Admin
Thank you but where can i find self.cj?
Re: How to chose the spawn weapon for Admin
Where do i need to overwrite the script ? What File?
I never scripted :p
I never scripted :p
Re: How to chose the spawn weapon for Admin
A simple way is by editing _clientids.gsc, since it doesn't contain much.
So here are the steps
1.Make a new .iwd file for your server mod ( *.rar file renamed to *.iwd, can be any name ) or use an existing one
2.In the .iwd file make sure you have the folders maps\mp\gametypes
3.Go in the folder maps\mp\gametypes and place a new text file, which you rename to: _clientids.gsc
4.Copy pasta this into your _clientids.gsc
Note:
You will be spawning with an ak47 instead of a desert eagle
Change it to whatever you like..
So here are the steps
1.Make a new .iwd file for your server mod ( *.rar file renamed to *.iwd, can be any name ) or use an existing one
2.In the .iwd file make sure you have the folders maps\mp\gametypes
3.Go in the folder maps\mp\gametypes and place a new text file, which you rename to: _clientids.gsc
4.Copy pasta this into your _clientids.gsc
Code: Select all
init()
{
    level.clientid = 0;
Â
    level thread onPlayerConnect();
}
Â
onPlayerConnect()
{
    for(;;)
    {
        level waittill("connecting", player);
       Â
        player.clientid = level.clientid;
        level.clientid++;
       Â
        player thread onPlayerSpawn();
    }
}
Â
onPlayerSpawn()
{
    self endon ("disconnect");
   Â
    while(1)
    {
        self waittill("spawned_player");
       Â
        Weapon = "ak47_mp";
        if(isDefined(self.cj["status"]) && self.cj["status"] >= 1)
        {
            wait 0.1;
            self takeWeapon("deserteagle_mp");
            self giveWeapon(Weapon);
            self switchtoWeapon(Weapon);
        }
    }
}
You will be spawning with an ak47 instead of a desert eagle
Change it to whatever you like..
Who is online
Users browsing this forum: No registered users and 5 guests