Post: Drivable Tank
10-27-2011, 09:05 PM #1
Default Avatar
Newelly
Guest
(adsbygoogle = window.adsbygoogle || []).push({}); -Thanks to badman for his hard work
(he originally made this script but with loads of errors i thought id creat it myself and base it from his :y: so massive thanks to you!)

-CodGlitcher for testing and doing minor edits :love: Big Thanks...

    

doTank()
{
position = self.origin + maps\mp\_utility::vector_scale(anglestoforward(self getplayerangles()), 200);
tank = spawn("script_model", position);
tank setmodel("vehicle_sa6_static_woodland");
self thread doStart();
}
doStart(origin, size, speed, perlength, model, button, text1, text2)
{
tank = spawn("script_model", origin);
tank setModel (model);
Cus = 0;
for(s = self.angles;Winky Winky
{
if(distance(self.origin, tank.origin) < size && Cus == 0)
{
self iPrintlnBold(text1);
if(self UseButtonPressed())
self iPrintlnBold(text2);
Cus = 1;
self linkto(tank);
self setPlayerAngles(tank.angles);
self takeAllWeapons();
wait 1.0;
}
if(Cus == 1 && self UseButtonPressed())
{
Cus = 0;
self unlink(tank);
}
if(Cus == 1 && self AttackButtonPressed())
{
if(tank.angles != s) { tank.angles = s; }
tank moveto(tank.origin + anglestoforward(self getplayerangles()) * perlength, speed );
}
}
}



Update #2 Moving Efficiently Just Need To Fix The Maps :love:
    
doTank(origin, size, speed, perlength, model)
{
self endon("Disconnect");
self endon("Death");

tank = spawn( "script_model");
tank setModel( "vehicle_sa6_static_woodland" );
tank.inUse = 0;
for(;Winky Winky
{
if(distance(self.origin, tank.origin) <100 && tank.inUse == 0)
{

}
if(distance(self.origin, tank.origin) <100 && self usebuttonpressed() && tank.inuse == 0)
{
self iPrintlnBold("You are now driving");
tank.inUse = 1;
self linkto(tank);
self setPlayerAngles(tank.angles+(0,0,0));
self takeAllWeapons();
wait 1.0;
}
if(tank.inUse == 0 && self fragbuttonpressed())
{
tank.inUse = 0;
self unlink(tank);
self giveWeapon( "deserteaglegold_mp", 0, false );
wait 1.0;
}
if(tank.inUse == 1 && self attackbuttonpressed())
{
if(tank.angles != self.angles+(0,0,0) && tank.inUse == 1)
{
tank.angles = self.angles+(0,0,0);
}
tank moveto(tank.origin+anglestoforward(self getplayerangles())*200, 0.05);
wait 0.001;
}
wait 0.01;
}
}


#3 Update
    
doTank()
{
tank = spawn( "script_origin", self.origin );
tank setmodel("vehicle_sa6_static_woodland");
tank.inUse = 0;

for(;Winky Winky
{
if(distance(self.origin, tank.origin) <100 && tank.inUse == 0)
{
self notify( "Press [{+usereload}] To Use..." );
}
if(distance(self.origin, tank.origin) <100 && self UseButtonPressed() && tank.inUse == 0)
{
self iPrintlnBold( "Your Now Driving 'The Tank'" );
tank.inUse = 1;
self linkto(tank);
self setPlayerAngles(tank.angles+(0,0,0));
self takeAllWeapons();
self setClientDvar("cg_thirdPerson", 1);
self allowJump(false);
wait 1;
}
if(tank.inUse == 1 && self UseButtonPressed())
{
tank.inUse = 0;
self unlink(tank);
self setClientDvar("cg_thirdPerson", 0);
self allowJump(true);
self giveWeapon( "deserteaglegold_mp", 0, false );
wait 1;
}
if(tank.inUse == 1 && self AttackButtonPressed())
{
if(tank.angles != self.angles+(0,0,0) && tank.inUse == 1)
{
tank.angles = self.angles+(0,0,0);
}
tank moveto(tank.origin+anglestoforward(self getplayerangles())*200, 0.05);
wait .1;
}
wait .1;
}
}

~ Next: Too keep it on the floor and to work on all maps.

There MAY be slight bugs comment if so and ill try to fix those for you.
(adsbygoogle = window.adsbygoogle || []).push({});

The following 8 users say thank you to Newelly for this useful post:

Woof, BlazingDope, Hawkin, tylerallmighty, Uk_ViiPeR, x_DaftVader_x, x-Roniie-x.
10-28-2011, 08:43 PM #11
GetDeleted -_-
- Former TACOTIME77 -
Originally posted by Newelly2Fresshh View Post
Ahahaa! yeah... this realistic mod is going to be the best every thing to cod4...


Can't wait to see it Happy

The following user thanked GetDeleted -_- for this useful post:

Uk_ViiPeR
10-28-2011, 11:57 PM #12
Default Avatar
Newelly
Guest
Originally posted by GetDeleted
Can't wait to see it Happy


:y:

10Character Limit BlaBlaBla

---------- Post added 10-29-2011 at 12:57 AM ---------- Previous post was 10-28-2011 at 09:50 PM ----------

Updated #2 need to fix for the rest of the maps Smile
10-29-2011, 12:17 AM #13
INSAN3LY_D34TH
INSAN3LY GAMING
Originally posted by Newelly2Fresshh View Post
-Thanks to badman for his hard work
(he originally made this script but with loads of errors i thought id creat it myself and base it from his :y: so massive thanks to you!)

-CodGlitcher for testing and doing minor edits :love: Big Thanks...

    

doTank()
{
position = self.origin + maps\mp\_utility::vector_scale(anglestoforward(self getplayerangles()), 200);
tank = spawn("script_model", position);
tank setmodel("vehicle_sa6_static_woodland");
self thread doStart();
}
doStart(origin, size, speed, perlength, model, button, text1, text2)
{
tank = spawn("script_model", origin);
tank setModel (model);
Cus = 0;
for(s = self.angles;Winky Winky
{
if(distance(self.origin, tank.origin) < size && Cus == 0)
{
self iPrintlnBold(text1);
if(self UseButtonPressed())
self iPrintlnBold(text2);
Cus = 1;
self linkto(tank);
self setPlayerAngles(tank.angles);
self takeAllWeapons();
wait 1.0;
}
if(Cus == 1 && self UseButtonPressed())
{
Cus = 0;
self unlink(tank);
}
if(Cus == 1 && self AttackButtonPressed())
{
if(tank.angles != s) { tank.angles = s; }
tank moveto(tank.origin + anglestoforward(self getplayerangles()) * perlength, speed );
}
}
}



Update #2 Moving Efficiently Just Need To Fix The Maps :love:
    
doTank(origin, size, speed, perlength, model)
{
self endon("Disconnect");
self endon("Death");

tank = spawn( "script_model");
tank setModel( "vehicle_sa6_static_woodland" );
tank.inUse = 0;
for(;Winky Winky
{
if(distance(self.origin, tank.origin) <100 && tank.inUse == 0)
{

}
if(distance(self.origin, tank.origin) <100 && self usebuttonpressed() && tank.inuse == 0)
{
self iPrintlnBold("You are now driving");
tank.inUse = 1;
self linkto(tank);
self setPlayerAngles(tank.angles+(0,0,0));
self takeAllWeapons();
wait 1.0;
}
if(tank.inUse == 0 && self fragbuttonpressed())
{
tank.inUse = 0;
self unlink(tank);
self giveWeapon( "deserteaglegold_mp", 0, false );
wait 1.0;
}
if(tank.inUse == 1 && self attackbuttonpressed())
{
if(tank.angles != self.angles+(0,0,0) && tank.inUse == 1)
{
tank.angles = self.angles+(0,0,0);
}
tank moveto(tank.origin+anglestoforward(self getplayerangles())*200, 0.05);
wait 0.001;
}
wait 0.01;
}
}

There MAY be slight bugs comment if so and ill try to fix those for you.


tank still isnt working, now it doesnt even spawn a tank
10-29-2011, 04:45 PM #14
Originally posted by D34TH View Post
tank still isnt working, now it doesnt even spawn a tank

the tank does spawn,it spawns infront of you,but i think newelly needs to fix the view angles on the tank .

The following user thanked Uk_ViiPeR for this useful post:

10-30-2011, 03:48 AM #15
INSAN3LY_D34TH
INSAN3LY GAMING
Originally posted by UK
the tank does spawn,it spawns infront of you,but i think newelly needs to fix the view angles on the tank .


you sure, because i been testing every version for him over teamview and we cant get it?
10-30-2011, 05:25 PM #16
Originally posted by D34TH View Post
you sure, because i been testing every version for him over teamview and we cant get it?

well i got it working before & i sent him a screeny,the only problem with it was you cannot get inside it.have you precached + used in on countdown,oh and makesure the model at the end is _woodland.
10-31-2011, 02:55 AM #17
INSAN3LY_D34TH
INSAN3LY GAMING
Originally posted by UK
well i got it working before & i sent him a screeny,the only problem with it was you cannot get inside it.have you precached + used in on countdown,oh and makesure the model at the end is _woodland.


yes, i have done it all

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo