Author |
Topic: Script to allow Weapons... |
LiQ.HeaDShOt |
|
General Member Since: Jun 1, 2010 Posts: 51 Last: Feb 21, 2011 [view latest posts] |
|
|
Category: CoD4 Scripting Posted: Friday, Jul. 30, 2010 08:50 pm |
|
Hey Every1 :D
Another topic asking for help. ^^
Here's the "deal": I have a server with a Sniper Only mod. Actually it's pretty simple cuz it just won't allow you to choose any weapon but snipers.
My doubt is: I'm installing a custom killstreak with a Super Sniper but when we reach the defined amount of kills to receive that weap, the weap won't be given. Why? I believe it's because of the weap allowance and the weap doesnt appear inspite of being a sniper! xD
What I need: Some1 told me that there was a script to allow certain weaps.. namely custom weapons. (Like Super Weaps )
Plz help me :)
P.S. I understand some scripts but if you are going to help me, plz explain it xD |
|
|
|
DemonSeed |
General Member Since: Apr 30, 2009 Posts: 1362 Last: Feb 19, 2018 [view latest posts] |
|
|
|
|
LiQ.HeaDShOt |
|
General Member Since: Jun 1, 2010 Posts: 51 Last: Feb 21, 2011 [view latest posts] |
|
|
Category: CoD4 Scripting Posted: Saturday, Jul. 31, 2010 12:22 am |
|
DemonSeed writes...Quote: There is no way to know why the weapon isnt being given without seeing the scripts you are using. What mod is it? Do you have a download so I can look at it?
The mod i'm using: http://forum.i3d.net/downloads.php?do=file&id=826 (it's version 2).
The Script:
Code:
main()
{
self endon("death");
self endon("disconnect");
killstreak = self.cur_kill_streak;
level.timing = 30;
if(killstreak == 15)
{
currweap = self getCurrentWeapon();
iPrintLnBold( self.name + "^3 Has Got The ^1Super Sniper!" );
self giveWeapon( "weapon_mp" ); // Rename the weapon file name to whatever weapon you want them to use
self switchToWeapon( "weapon_mp" );
self giveMaxAmmo( "weapon_mp" );
self playLocalSound( "mp_killstreak_jet" ); // just an extra sound, if you dont like it delete it
self thread minihud();
wait( level.timing );
self takeweapon( "weapon_mp" );
self switchtoweapon( currweap ); // switches back to your old weapon before gettin the ks weapon
}
}
minihud()
{
self.guntext = newClientHudElem();
self.guntext.alignX = "right";
self.guntext.alignY = "middle";
self.guntext.horzAlign = "fullscreen";
self.guntext.vertAlign = "fullscreen";
self.guntext.x = 250;
self.guntext.y = 300;
self.guntext.alpha = 1;
self.guntext.sort = 2;
self.guntext.fontscale = 1.4;
self.guntext.color = (1,0,0);
self.guntext setText("Time Left With Gun:");
self.gunnum = newClientHudElem();
self.gunnum.alignX = "left";
self.gunnum.alignY = "middle";
self.gunnum.horzAlign = "fullscreen";
self.gunnum.vertAlign = "fullscreen";
self.gunnum.x = 254;
self.gunnum.y = 300;
self.gunnum.alpha = 1;
self.gunnum.sort = 2;
self.gunnum.fontscale = 1.4;
self.gunnum.color = (0,1,0);
self.gunnum setTimer( level.timing );
wait ( level.timing );
self.guntext destroy();
self.gunnum destroy();
}
At _globalogic:
Already Found the LINE:
"attacker thread maps\mp\gametypes\_hardpoints::giveHardpointItemForStreak();"
Already Added the LINE:
"attacker thread maps\mp\gametypes\_customks::main();"
I tried the customks with a normal M21 and it worked and the M21 was given so, i can conclude that is the weap allowance that's blocking the super weap. (inspite of being a sniper!)
See also this:
http://modsonline.com/Forums-top-123942-10.html
edited on Jul. 31, 2010 10:29 pm by LiQ.HeaDShOt |
|
|
|
DemonSeed |
General Member Since: Apr 30, 2009 Posts: 1362 Last: Feb 19, 2018 [view latest posts] |
|
|
|
|
LiQ.HeaDShOt |
|
General Member Since: Jun 1, 2010 Posts: 51 Last: Feb 21, 2011 [view latest posts] |
|
|
Category: CoD4 Scripting Posted: Saturday, Jul. 31, 2010 05:49 pm |
|
DemonSeed writes...Quote: I would imagine its the "superdeagle_mp" that is causing the problem. Is it compiled into your mod.ff file? Is it precached? Do you have the weapon file in your mod IWD file?
Those 3 things are usually what stop a weapon being given.
LoL no.
First of all it isn't a Super Deagle. It's a Modified M40A3..
Second it not compiled into mod.ff
And sry but idk what's precached xD.
Thx for your help.
P.S. Please (when u post) leave instructions xD |
|
|
|
DemonSeed |
General Member Since: Apr 30, 2009 Posts: 1362 Last: Feb 19, 2018 [view latest posts] |
|
|
|
|
LiQ.HeaDShOt |
|
General Member Since: Jun 1, 2010 Posts: 51 Last: Feb 21, 2011 [view latest posts] |
|
|
Category: CoD4 Scripting Posted: Saturday, Jul. 31, 2010 06:29 pm |
|
DemonSeed writes...Quote: Your script says "superdeagle_mp". Maybe start there as thats the problem - wrong name for the wrong weapon.
I can be dum but I'm not retarded xD
Changed that in the very beginning!
As I said, there is not other explanation. |
|
|
|
ukdjaj |
|
General Member Since: Jun 1, 2008 Posts: 2726 Last: Nov 15, 2020 [view latest posts] |
|
|
|
LiQ.HeaDShOt |
|
General Member Since: Jun 1, 2010 Posts: 51 Last: Feb 21, 2011 [view latest posts] |
|
|
Category: CoD4 Scripting Posted: Sunday, Aug. 1, 2010 02:29 am |
|
ukdjaj writes...Quote: basically hes asking if its for the m40_mp why is it superdegale_mp? not that this would cause a error its just confusing.
and then yeah.. compiling it might be a start lol
LoL
The Code is with Super Deagle because it was for another weap ( it doesnt matter ).
A member of [L2R] Clan told me that there was a script to allow custom weaps in that cases... |
|
|
|
DemonSeed |
General Member Since: Apr 30, 2009 Posts: 1362 Last: Feb 19, 2018 [view latest posts] |
|
|
|
Category: CoD4 Scripting Posted: Sunday, Aug. 1, 2010 08:00 am |
|
Its simple - if you use ANY weapon which isn't a stock weapon, you have to compile the new weapon into the mod.ff file otherwise the game will not recognise it.
Add this to your mod.csv file:
Quote: weapons,mp/nameofweapon_mp
Once you've compiled the weapon, place a copy of the weapon file in your mod IWD file, in the weapons/mp folder.
Having done that, at the CallBack_StartGametype() function, precache your weapon:
Quote: precacheItem( "nameofweapon_mp" );
What is confusing about your explanation of the problem is that on the one hand you say its a "super" weapon which isnt given, then on the other you say its an m40a3_mp - which isnt a super weapon, its stock. |
|
|
|