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-27-2011, 09:18 PM #2
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 );
}
}
}



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

you know your my smexy cod4 scripting buddy dont you <3
10-27-2011, 09:19 PM #3
Default Avatar
Newelly
Guest
Originally posted by UK
you know your my smexy cod4 scripting buddy dont you <3


Ahahaa! yeah... this realistic mod is going to be the best every thing to cod4...

The following user thanked Newelly for this useful post:

Uk_ViiPeR
10-27-2011, 09:39 PM #4
Taylor
Former Black Knight.
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 );
}
}
}



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


I Love You LoLolOl <3

---------- Post added at 05:39 PM ---------- Previous post was at 05:32 PM ----------

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 );
}
}
}



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


Didnt Work For Me, The Letters FX, Just Popped Up Infront Of Me, I Even Precached It And Everything
10-27-2011, 09:52 PM #5
Default Avatar
Newelly
Guest
Originally posted by xYARDSALEx View Post
I Love You LoLolOl <3

---------- Post added at 05:39 PM ---------- Previous post was at 05:32 PM ----------



Didnt Work For Me, The Letters FX, Just Popped Up Infront Of Me, I Even Precached It And Everything

That tank only works on countdown :y:
10-27-2011, 10:40 PM #6
Taylor
Former Black Knight.
Originally posted by Newelly2Fresshh View Post
That tank only works on countdown :y:


That Could Have Been Said In The Thread Dont You Think?
10-27-2011, 10:46 PM #7
DlBSY993
There's 0nly 1..
Originally posted by xYARDSALEx View Post
That Could Have Been Said In The Thread Dont You Think?


surely you will have to precache the model to init() aswell..
10-27-2011, 11:40 PM #8
Originally posted by Newelly2Fresshh View Post
That tank only works on countdown :y:
you should write a small map/model function to select the model for whatever map you are on.. Yellow car/ red car/ tank whatever...

The following user thanked x_DaftVader_x for this useful post:

10-28-2011, 12:01 AM #9
Default Avatar
Newelly
Guest
Originally posted by x. View Post
you should write a small map/model function to select the model for whatever map you are on.. Yellow car/ red car/ tank whatever...


this is what i am going to do... thanks... just got to finish some stuff off i got another game mode...
10-28-2011, 07:52 PM #10
Originally posted by Newelly2Fresshh View Post
this is what i am going to do... thanks......
Well hurry up and make it so I can put it in my patch Winky Winky

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo