Thread: for(...) and i
View Single Post
  #2  
Old 11-04-2001, 05:06 AM
KJS KJS is offline
The one, The only -
KJS's Avatar
Join Date: Apr 2001
Location: USA, Minnesota
Posts: 1,012
KJS is on a distinguished road
Send a message via AIM to KJS
Re: for(...) and i

Quote:
Originally posted by nyghtGT
can someone explain the following code to me please ... i dont understand it .... Explain all parts and what they do please ...
NPC Code:

NPC Code:

if (wasshot) {
for (i=0; i<npcscount; i++)
callnpc i,swimming;
}



basically it calls every npc on that level if the npc was shot and gives it a swimming thing

and inside the other npcs you can say

if(swimming){
//coding
}

so humm lets say the npc calling that code is a person npc

and it gets shot

then the person npc would call all the npcs and set
swimming

then in the other npcs that you want it to effect you say

if(swimming){

}

and do whatever you want in that coding once the person npc gets shot
__________________
Thanks,
-KJL
Reply With Quote