UGX-Mods

Call of Duty 5: World at War => Help Desk => Scripting => Topic started by: KDXDARK on February 17, 2013, 05:28:25 am

Title: Little problem
Post by: KDXDARK on February 17, 2013, 05:28:25 am
Hey Overhere!
Fixed mule kick problems revive solo, more later i going to test it on coop! :) Thanks for the help people!
Title: Re: Little problem
Post by: YaPh1l on February 17, 2013, 11:14:49 am
Code Snippet
Plaintext
self TakeWeapon("current_weapon");
would take away a weapon with a weapon file called current_weapon from the player, which does obviouly not exist.
You probably want something like this:
Code Snippet
Plaintext
current_weapon = self GetCurrentWeapon();
self TakeWeapon(current_weapon);
// You should probably switch to another one then
If you mean (by "get up"), after the player is revived, you could also call GetWeaponsListPrimaries() and remove a weapon from that list if it contains 3.

- Phil.
Title: Re: Little problem
Post by: KDXDARK on February 17, 2013, 06:31:21 pm
Code Snippet
Plaintext
self TakeWeapon("current_weapon");
would take away a weapon with a weapon file called current_weapon from the player, which does obviouly not exist.
You probably want something like this:
Code Snippet
Plaintext
current_weapon = self GetCurrentWeapon();
self TakeWeapon(current_weapon);
// You should probably switch to another one then
If you mean (by "get up"), after the player is revived, you could also call GetWeaponsListPrimaries() and remove a weapon from that list if it contains 3.

- Phil.
the question is where i put that in laststand.gsc or zombiemode.gsc?
Title: Re: Little problem
Post by: treminaor on February 17, 2013, 06:39:43 pm
the question is where i put that in laststand.gsc or zombiemode.gsc?
You put it wherever your TakeWeapon code already is... "current_weapon" is not a valid parameter for TakeWeapon. You have to use a valid gun name and the player has to have the gun in order for it to do anything. current_weapon = self GetCurrentWeapon() sets the variable to the string name of whatever gun the player is holding when the function runs. Then self TakeWeapon(current_weapon) will take that gun name from the player.
Title: Re: Little problem
Post by: KDXDARK on February 17, 2013, 06:47:44 pm
You put it wherever your TakeWeapon code already is... "current_weapon" is not a valid parameter for TakeWeapon. You have to use a valid gun name and the player has to have the gun in order for it to do anything. current_weapon = self GetCurrentWeapon() sets the variable to the string name of whatever gun the player is holding when the function runs. Then self TakeWeapon(current_weapon) will take that gun name from the player.
if i give you the scripts you can see it? :)

Post Merge: February 19, 2013, 07:15:34 am
Update on the first reply!

Post Merge: February 19, 2013, 07:18:10 am
ads