Thread: array help ...
View Single Post
  #1  
Old 08-02-2001, 08:46 AM
prozac424242 prozac424242 is offline
Registered User
prozac424242's Avatar
Join Date: May 2001
Location: Gone crazy: back soon
Posts: 356
prozac424242 is on a distinguished road
Send a message via ICQ to prozac424242 Send a message via AIM to prozac424242
array help ...

I want to make a shooting wepaon that
instead of
if (playerdir==0){y--;}
if (playerdir==2){y++;}
it is jsut one command thing.
here is what i got so far
except it goes diagonal.
How far off am i?
NPC Code:

// NPC made by Prozac
if (playerenters) {show;}
if (playertouchsme) {toweapons throw thing;}
if (weaponfired)
{
this.distance=10; //how far to throw
setarray this.newx,4;
this.newx[0]=playerx; this.newx[1]=playerx-1;
this.newx[2]=playerx; this.newx[3]=playerx2;
setarray this.newy,4;
this.newy[0]=playery-2; this.newy[1]=playery+1;
this.newy[2]=playery+4; this.newy[3]=playery+1;

setplayerprop #c,#v(this.newx[playerdir]);

for (this.i=0; this.i<this.distance; this.i++)
{
putexplosion 0,this.newx[playerdir]+this.i,this.newy[playerdir]+this.i;
sleep .1;
}

}

__________________

Useful links:
Graal Stats
Client Script Functions-GS1 to GS2
Serverside Script Functions-Gscript page
Particle Engine-Player Attributes
Server Options-Admin rights-Gmaps
Quote:
Originally Posted by Admins
Thanks for developing and improving playerworlds and such
Reply With Quote