Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   Car script...? xd (https://forums.graalonline.com/forums/showthread.php?t=70536)

mYg0tHaMpStEr 12-02-2006 05:34 AM

Car script...? xd
 
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)

NPC Code:
//#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

Quote:

Originally Posted by mYg0tHaMpStEr (Post 1249246)
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

Quote:

Originally Posted by Bl0nkt (Post 1249252)
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.


All times are GMT +2. The time now is 11:40 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.