Quote:
Originally Posted by napo_p2p
For testing, I guess you could remove the weapon. When it goes to players though, you could just have the movement system stop working when a car is on.
That script is able to go over walls because you need to add some onwall detection :P. I think you have the skills to play around with onwall detection yourself. If you hit a snag, you know where to ask  .
|
i got it to work!!! now i am gonna try to make it slow down... here is the script that works:
PHP Code:
//#CLIENTSIDE
function onCreated() enabledefmovement();
function onPlayerChats()
{
if (player.chat == "/car")
{
onCreated();
this.car = !this.car;
if (this.car) onTimeOut();
if (!this.car) setTimer( 0 );
}
}
function onTimeOut()
{
disabledefmovement();
client.frozen = true;
showimg( 1, "utopia_car3.gif", player.x, player.y );
setani( "blank", null );
findimg( 1 ).rotation = this.ang;
if ( keydown( 3 ) )
{
this.ang -= .1;
timeout;
}
if ( keydown( 1 ) )
{
this.ang += .1;
timeout;
}
if ( keydown( 0) )
{
player.x -= cos( this.ang ) * 1.2;
player.y += sin( this.ang ) * 1.2;
}
setTimer( 0.05 );
}
temp.newx = player.x + (this.graalspeed * cos(this.angle));
temp.newy = player.y + (this.graalspeed * -sin(this.angle));
function Accelerate()
{
this.smod = 0;
this.speed += (this.speed < this.maxspeed) ? .20 : 1;
}
function LeftTurn()
{
this.angle += degtorad(this.turnpower);
timeout;
if (radtodeg(this.angle)+this.turnpower <= 0)
{
this.angle = degtorad(360);
}
if (radtodeg(this.angle)+this.turnpower >= 360)
{
this.angle = degtorad(0);
}
}
function RightTurn()
{
this.angle -= degtorad(this.turnpower);
if (radtodeg(this.angle)+this.turnpower >= 360)
{
this.angle = degtorad(359);
}
if (radtodeg(this.angle)+this.turnpower <= 0)
{
this.angle = degtorad(360);
}
}