Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-26-2002, 07:40 AM
Spectre1337 Spectre1337 is offline
Banned
Spectre1337's Avatar
Join Date: Nov 2001
Location: United States
Posts: 790
Spectre1337 is on a distinguished road
Send a message via AIM to Spectre1337 Send a message via Yahoo to Spectre1337
My crappy fishpole

My first ever fishpole, yay!
Tell me what you think or tell what I can do to make it better!

NPC Code:
if (weaponfired&&onwater(playerx-1,playery-1)||onwater(playerx+1,playery+1)||onwater(playerx-1,playery+1)||onwater(playerx+1,playery-1))
{
freezeplayer 5;
setani kick,;
sleep 1;
setani kick,;
sleep 1;
setani kick,;
sleep 1;
setani kick,;
sleep 1;
setani kick,;
sleep 1;
client.fish+=1;
setplayerprop #c,I got one!;
setstring client.fish,#v(client.fish);
}else if (weaponfired){
setplayerprop #c,On WATER!;
}

if (weaponfired&&#m=swim)
{
setplayerprop #c,On WATER!;
}
if (playerchats&&strequals(#c,show fish)){
setplayerprop #c,You have #v(client.fish) fish(s);
}

Reply With Quote
  #2  
Old 03-26-2002, 07:46 AM
haunter haunter is offline
Registered User
haunter's Avatar
Join Date: Mar 2001
Posts: 7,989
haunter is on a distinguished road
There must be a way to shorten all those onwater flags... im just not sure how... Maybe someone can say and i'll learn something... X>X
Reply With Quote
  #3  
Old 03-26-2002, 08:09 AM
screen_name screen_name is offline
is watching you
Join Date: Mar 2002
Location: The 3rd Dimension
Posts: 2,160
screen_name is on a distinguished road
Send a message via AIM to screen_name Send a message via MSN to screen_name
use the vector or x and y, much easier
__________________
[signature]insert here[/signature]
Reply With Quote
  #4  
Old 03-26-2002, 09:34 AM
BARGAD BARGAD is offline
Registered User
Join Date: Aug 2001
Location: Sweden
Posts: 345
BARGAD will become famous soon enough
Hm, not really,maybe if you use an onboard detector

/CaRnIe
__________________
Gori

Born To Kill
Death Silent Killers

Two little newbies, out in the sun.
Then came Gori and there was only one.

Reply With Quote
  #5  
Old 03-26-2002, 09:57 AM
screen_name screen_name is offline
is watching you
Join Date: Mar 2002
Location: The 3rd Dimension
Posts: 2,160
screen_name is on a distinguished road
Send a message via AIM to screen_name Send a message via MSN to screen_name
works same with onwater
__________________
[signature]insert here[/signature]
Reply With Quote
  #6  
Old 03-26-2002, 10:45 AM
Spectre1337 Spectre1337 is offline
Banned
Spectre1337's Avatar
Join Date: Nov 2001
Location: United States
Posts: 790
Spectre1337 is on a distinguished road
Send a message via AIM to Spectre1337 Send a message via Yahoo to Spectre1337
I dont even know "vecx" and "vecy".. I dont even know onwater. I had to look in the Commands.rtf.. ha
Reply With Quote
  #7  
Old 03-26-2002, 03:24 PM
joseyisleet joseyisleet is offline
Registered User
Join Date: Aug 2001
Posts: 378
joseyisleet is on a distinguished road
-=Josey=-
NPC Code:
if (onwater(playerx+1+vecx(playerdir)*2.5,playery+1.5  +vecy(playerdir)*2.5){}

__________________
Account used by Josey and Howard.
Ali G: 'Is it cause i Black?'
Reply With Quote
  #8  
Old 03-26-2002, 03:41 PM
nyghtGT nyghtGT is offline
Banned
nyghtGT's Avatar
Join Date: Jun 2001
Posts: 3,993
nyghtGT is on a distinguished road
Send a message via AIM to nyghtGT
Re: My crappy fishpole

Quote:
Originally posted by Spectre1337
My first ever fishpole, yay!
Tell me what you think or tell what I can do to make it better!

NPC Code:
if (weaponfired&&onwater(playerx-1,playery-1)||onwater(playerx+1,playery+1)||onwater(playerx-1,playery+1)||onwater(playerx+1,playery-1))
{
freezeplayer 5;
setani kick,;
sleep 1;
setani kick,;
sleep 1;
setani kick,;
sleep 1;
setani kick,;
sleep 1;
setani kick,;
sleep 1;
client.fish+=1;
setplayerprop #c,I got one!;
setstring client.fish,#v(client.fish);
}else if (weaponfired){
setplayerprop #c,On WATER!;
}

if (weaponfired&&#m=swim)
{
setplayerprop #c,On WATER!;
}
if (playerchats&&strequals(#c,show fish)){
setplayerprop #c,You have #v(client.fish) fish(s);
}

try using arrays ...
and the 'for' command could be used as well ...
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 09:14 AM.


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