How do i give all my players the Silenced pistol

Post your scripting questions / solutions here

Moderator: Moderators

User avatar
Gold
First Lieutenant
Posts: 176
Joined: Sun Sep 28, 2003 8:10 pm

Post by Gold »

ive had the 1st person that tested this say this didnt work which didnt make any sense to me considering that everytime i use this script it seems to work perfectly for me,,so im gonna post the whole script i tested with and if anyone would like to try it and giv feedback on it would be great,,considering the time i put into this to make it work correctly for me i would feel much better knowing it worked for someone else also lol

Gold<<mohha freak

// SOUTHERN FRANCE
// ARCHITECTURE: SENN
// SCRIPTING: POWZER

main:

// set scoreboard messages
setcvar "g_obj_alliedtext1" "Southern France"
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" ""
setcvar "g_obj_axistext2" ""
setcvar "g_obj_axistext3" ""

setcvar "g_scoreboardpic" "mohdm1"
// call additional stuff for playing this map round based is needed
if(level.roundbased)
thread roundbasedthread

level waitTill prespawn

//*** Precache Dm Stuff
exec global/DMprecache.scr

level.script = maps/dm/mohdm1.scr

thread weapons
thread allweapons

exec global/ambient.scr mohdm1

//exec global/ambient.scr mohdm2

//$world farplane 5000
//$world farplane_color (.333 .333 .329)

level waittill spawn

weapons:
level.all_weapons = int(getcvar(all_weapons))
if(level.all_weapons == 1)
{
$player item models/weapons/silencedpistol.tik
local.ammo_pistol = 94
}
wait 0.2
goto weapons
end

allweapons:
wait 2
$player stufftext "all_weapons 1"

end

//-----------------------------------------------------------------------------

roundbasedthread:

// Can specify different scoreboard messages for round based games here.

level waitTill prespawn

level waittill spawn

// set the parameters for this round based match
level.dmrespawning = 0 // 1 or 0
level.dmroundlimit = 5 // round time limit in minutes
level.clockside = kills // set to axis, allies, kills, or draw

level waittill roundstart

end
User avatar
Gold
First Lieutenant
Posts: 176
Joined: Sun Sep 28, 2003 8:10 pm

Post by Gold »

Deadye tested the above script and said it works fine,,he also suggested i open the tiki file for the silencer and raise the dm damage to about 50,,also while in the tiki file if ya set the silencer ammo count for dm to about 10 that will put all the pistols including the silencer to the ammo count of around 94 ,,,i also changed the dmfiredelay as i like the silencer being more deadlier than be4,,,hope all this helps someone hehe,,,was fun,,and thanx Deadeye:)

Gold<<mohha freak
digitac
Sergeant
Posts: 58
Joined: Mon Jul 28, 2003 3:30 pm

Post by digitac »

Can't u try this ?

edit the weapon/thompsonsmg.tik and add this line ?

dm startitem "weapons/silencedpistol.tik"
User avatar
Gold
First Lieutenant
Posts: 176
Joined: Sun Sep 28, 2003 8:10 pm

Post by Gold »

sure ya can do that in spearhead and breakthrough...but in which section of the tiki file would ya add that to in mohha and make it work??

Gold<<mohha freak
jobo
Private
Posts: 7
Joined: Thu Feb 19, 2004 8:54 pm

Post by jobo »

were do u find all this command crap?
digitac
Sergeant
Posts: 58
Joined: Mon Jul 28, 2003 3:30 pm

Post by digitac »

Btw. Do u want to use the pistol instead of the standard pistol ?
or do u want to add this ?
User avatar
Gold
First Lieutenant
Posts: 176
Joined: Sun Sep 28, 2003 8:10 pm

Post by Gold »

the script i posted added it,,,so i would prob want to add it :) Standard pistol and silencer,,,also if theres a way to do that in mohha tikis i would like to know how :)

Gold<<mohha freak
User avatar
MPowell1944
Moderator
Posts: 287
Joined: Thu Jan 09, 2003 7:06 am
Location: Woodstock, GA
Contact:

Post by MPowell1944 »

Only one problem with this script. When you switch teams, you get ammo from the other team along with the team you switched to (ex : you have 92 total rounds on Axis. you switch to Allies and all of a sudden your total rounds jump to 184.)

Any solution? I have tried messing with the code and even the .tik ammo amount. No matter what, when you switch teams or do a server restart, the ammo amount gets messed up.
omniscient
Major General
Posts: 694
Joined: Tue Sep 16, 2003 12:02 am

Post by omniscient »

$player take silencedpsitol.tik
$player give silencedpistol.tik

put that at the beginnig so when u switch teams it'll take it away, and give it back with regular ammo.
Image
digitac
Sergeant
Posts: 58
Joined: Mon Jul 28, 2003 3:30 pm

Post by digitac »

Maybee, this is just an idea, open the silencedpistol.tik copy all the text
now open for example colt45.tik then paste the text,

you can also do this for p38.tik

meanwhile i am checking how to add the second pistol :)
User avatar
MPowell1944
Moderator
Posts: 287
Joined: Thu Jan 09, 2003 7:06 am
Location: Woodstock, GA
Contact:

Post by MPowell1944 »

Thanks omniscient, I'll give that a try. *EDIT* I tried that code you gave and now when I spawn it keeps taking the weapon away and not giving it back.

digitac, if you copy and paste the text into the colt/p38 file(s), you won't get the desired results. Trust me, I've tried.

*EDIT* Also 1 other problem with this script. If you drop your pistol, you will automatically get it back. You can then pickup the ammo from the dropped pistol. Must be because of the loop in the script.
User avatar
Gold
First Lieutenant
Posts: 176
Joined: Sun Sep 28, 2003 8:10 pm

Post by Gold »

heres solution,,,,1st of all dont remove this line from the script
local.ammo_pistol = 94

if ya remove the above line ya will get unlimited ammo,,,,,ok next

heres how i solved the ammo solution and put the ammo count back to around stock levels,,,1st of all it wasnt adding the ammo from axis to allies but it was adding the ammo of the stock pistol to the silencer,,,meaning if ya choose allies ya got stock pistol then it would add them rounds to the silencer as well,,,now heres how i fixed that ,,i opened up the tiki file for the silencer and changed the dm ammo to 10,,,that put the ammo count on the silencer on 1 team to 95 if i recall right,,then when ya switch teams ya get the ammo count of 94,,,also if ya type restart in the console ya still get same ammo count 95 or 94 according to the team ya on,,,also while in the silencer tiki as suggested earlier may wanna change the dmbulletdamage to around 50 and the dmfiredelay down if ya want it to fire faster,,,hope this helps...i myself changed the firedelay to 0,,but guess thats just my preference:)

Gold<<<mohha freak
User avatar
Gold
First Lieutenant
Posts: 176
Joined: Sun Sep 28, 2003 8:10 pm

Post by Gold »

also never tested anything dropping the pistol,,maybe i should lol :oops:
Gold<<mohha freak
User avatar
Gold
First Lieutenant
Posts: 176
Joined: Sun Sep 28, 2003 8:10 pm

Post by Gold »

MPowell ya were correct ,,because of the loop in the script if ya drop ya silencer ya get it back,,,also noticed when ya drop it with the silencer tiki set to 10 on ammo count it also takes away most of ya ammo from the stock pistol,,,when dropped it put my stock pistol to the ammo count of 2,,,thus still making me realize the silencer and the stock pistol is sharing the ammo count in some way,,,also i noticed if i kept droppping and picking up with this configuration i could only get my ammo counts up to 200 on the pistols,,maybe this is the clue on were to look next,,,guess it could be set to 200 on pistol to solve that problem,,but if ya like me ya would like the standard ammo count :),,,well i guess i go dig a little more,,or maybe someone with good scripting skills will solve this be4hand,,im still learning myself ,,but its fun:)

Gold<<mohha freak
User avatar
MPowell1944
Moderator
Posts: 287
Joined: Thu Jan 09, 2003 7:06 am
Location: Woodstock, GA
Contact:

Post by MPowell1944 »

I tried removing the loop in the script (to avoid the drop gun/get gun back). When I do that, I don't even get the silence pistol at all. Makes no sense. If anyone, at all, has anything to add to make this script work, I would be most gracious.
Post Reply