[SOLVED] Stop Weapon Pick up

Posts 1–4 of 4 · Page 1 of 1
[SOLVED] Stop Weapon Pick up
Right, once again i'm in need of help, i've searched EVERYWHERE, google returns nothing, a search on this returns even less

Modifying a .GSC file for a mod i've downloaded to improve to my liking. So, is there anyway to stop people picking up weapons after someone has been killed.

I've been looking around and if that's not possible then you could technically make a loop that continiously looks and removes the weapon from the player?

If banning weapons being picked up isn't possible, then does anyone think the loop will work. For example:

If player doesn't have a specific weapon in his hand then remove all his weapons, replace it with the weapon he should have + remove ammo?
(It's a zombie mod, zombie's are going around picking up shotguns and such, and I just don't think that should be allowed
/Posts merged
[php]
gunCheck()
{
while(1) {
if(!isValidWeapon(self getCurrentWeapon())) { //If current weapon is not in the isValidWeapon list..
self takeAllWeapons(); // Take all weapons
self giveWeapon( "gunhere_mp", 0, false ); //Gives them a weapon
while(self getCurrentWeapon() != "gunhere_mp") { //After given weapon, checks if the player hasn't switched to the gun
self switchToWeapon("gunhere_mp"); //Switches to the gun for you
self setWeaponAmmoStock("gunhere_mp", 0 ); //Replace 0 to how much ammo stock you want
self setWeaponAmmoClip("gunhere_mp", 0 ); //Replace 0 to how much ammo clip you want
wait 0.05; }
}
}
}

isValidWeapon(weapon) {
switch(weapon) {
case "gunhere_mp": //Change this to the gun you used above
case "none":
return true;
}
return false;
}
[/php]

Then put "self thread gunCheck();" under "onPlayerSpawned".
/Marked As Solved
Posts 1–4 of 4 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us