PDA

View Full Version : Car script...? xd


mYg0tHaMpStEr
12-02-2006, 05:34 AM
Hey, I'm having trouble with a car script...

This is what I have. I want this to be similar to GXes (because they r leet. gj joey :D) Like a trunk and Radio and they'll have 2 people with one person shooting.

Then I'de like them parkable with keys to drive. I have this so far.. Can anyone complete this? (Joey.. XD)

//#CLIENTSIDE
function onCreated() enabledefmovement();
function onWeaponFired()
{
onCreated();
this.car = !this.car;
if ( this.car ) onTimeOut();
if ( !this.car ) setTimer( 0 );
}
function onTimeOut()
{
disabledefmovement();
showimg( 1, "fc_car.png", player.x, player.y );
findimg( 1 ).rotation = this.ang;
if ( keydown( 3 ) )
{
this.ang -= .1;
}
if ( keydown( 1 ) )
{
this.ang += .1;
}
if ( keydown( 0 ) )
{
player.x -= cos( this.ang ) * 1;
player.y -= sin( this.ang ) * 1;
}
setTimer( 0.05 );
}


Thank you!
-Ork

Bl0nkt
12-02-2006, 05:57 AM
cos( this.ang ) * 1

isn't that the same as cos( this.ang )?


Did anyone help you with this script?

Edit:
Btw, for the infamous question, ARE YOU DOING THIS OFFLINE?

mYg0tHaMpStEr
12-02-2006, 06:23 AM
isn't that the same as cos( this.ang )?


Did anyone help you with this script?

Edit:
Btw, for the infamous question, ARE YOU DOING THIS OFFLINE?

1) Dunno

2) No, this is ONLINE.

Bl0nkt
12-02-2006, 06:25 AM
Well one thing I noticed is as soon as you fire the weapon, it's setting this.car false. According to this script, for the timeout to activate, this.car needs to be true.