Posts: 1,741
Threads: 93
Joined: Mar 2012
Reputation:
26
Well I haven't gotten enough time to mess with it since I had volunteered today and yesterday. I really won't have time to work with this since I have school VERY soon. If it's okay with JayDi I will send you it.
Do not take life too seriously. You will never get out of it alive.
Posts: 836
Threads: 48
Joined: Feb 2012
Reputation:
11
JayDi has kindly sent me the source, but any help on restricting weapons for infected would be appreciated.
Posts: 502
Threads: 13
Joined: Feb 2012
Reputation:
42
CSHARP Code
if (Client.Team != Teams.Axis)
{
giverandomweapon(Client);
} else {
TellClient("Zombies stink!",null);
}
Had a life, Got a modem..
Posts: 502
Threads: 13
Joined: Feb 2012
Reputation:
42
i dont have the source but its probably named differently lol
Had a life, Got a modem..
Posts: 502
Threads: 13
Joined: Feb 2012
Reputation:
42
07-19-2012, 08:02
(This post was last modified: 07-19-2012, 08:04 by JoSchaap.)
ok got the source, here's my idea
also disables the plugin during gungame (would destroy the game)
start of the randomweaponmachine
CSHARP Code
void weapz(Object arg)
{
Thread.Sleep(200);
ServerClient Client = (ServerClient)arg;
// magic trick to avoid running in infected and gungame (by: Pieter/JoSchaap)
bool younoworkokay = false;
String gametype = GetDvar("g_gametype");
if (gametype == "gun")
{
younoworkokay = true;
}
if (gametype == "infect")
{
younoworkokay = false;
if (Client.Team != Teams.Allies)
{
younoworkokay = true;
}
}
if (younoworkokay != true)
{
// end of the trick: time to run the randomweapon-machine (also added a '}' at the end)
Client.Other.ClearPerks(); // Clear perks ffs
string[] AllSecondaries = {
// ........long list of random weapons blablabla
// ....... skipping to the end of the function to add a closing bracket
}
Ammoz(Client);
} // added this } because of the trick to avoid giving infecteds weapons)
}
Im posting this rather then replying, because im not a C# guru lol. i started learning Csharp when i registerred on itsmods
so there might be a better way!
Had a life, Got a modem..
Posts: 836
Threads: 48
Joined: Feb 2012
Reputation:
11
07-19-2012, 12:19
(This post was last modified: 07-19-2012, 12:22 by hillbilly.)
worked a treat pieter, could you possibly add a choice of weapons for infected, ie: shield,smoke etc ? just so say some will spawn with a shield and some not. and smoke (always smoke)
Posts: 502
Threads: 13
Joined: Feb 2012
Reputation:
42
that would mean completely rewriting it, i really dont have time for that atm
Had a life, Got a modem..
Posts: 836
Threads: 48
Joined: Feb 2012
Reputation:
11
oh ok, thanks for what you have done anyway.