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 10-27-2005, 10:41 PM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
I can't mine!

another problem, this is a mining script, it doesn't work right, not showing GFX, and not getting money. whats wrong with it?
NPC Code:
if(actionserverside){
if(strequals(#p(0),bronze)){
sleep .25;
freezeplayer .5;
setani lift,;
playerrupees=playerrupees+3;
play chest.wav;
triggeraction 0,0,clientside,bronzegfx;
}
}
//#CLIENTSIDE
if(actionclientside){
if(strequals(#p(0),bronzegfx)){
showimg 5553,dr-bronze.png,playerx+.5,playery-.5;
}
}
if(weaponfired){
freezeplayer .5;
minetiles={
0x824,0x809,0x80A,0x809,0x80A,0x809,0x80A,0x809,
0x814,0x806,0x81A,0x819,0x81A,0x819,0x80E,0x80D,
0x824,0x825,0x826,0x829,0x82A,0x829,0x81C,0x81D,
0x814,0x815,0x816,0x345,0x345,0x80B,0x80C,0x80D,
0x824,0x825,0x826,0x345,0x345,0x81B,0x81C,0x81D,
0x814,0x815,0x808,0x807,0x808,0x807,0x80C,0x80D,
0x824,0x81E,0x818,0x817,0x818,0x817,0x80F,0x81D,
0x828,0x827,0x828,0x827,0x828,0x827,0x828,0x80D
};
if(playerdir==0&&tiles[playerx+.5,playery-1] in minetiles){
set okaytomine;
m=int(random(0,20));
setani jaxe,pickaxemetal.png;
}
if(playerdir==2&&tiles[playerx+.5,playery+4] in minetiles){
set okaytomine;
setani jaxe,pickaxemetal.png;
m=int(random(0,20));
}
if(playerdir==1&&tiles[playerx-1,playery+1.5] in minetiles){
set okaytomine;
setani jaxe,pickaxemetal.png;
m=int(random(0,20));
}
if(playerdir==3&&tiles[playerx+2.5,playery+1.5] in minetiles){
set okaytomine;
setani jaxe,pickaxemetal.png;
m=int(random(0,20));
}
if(!okaytomine){setplayerprop #c,Can't mine here}
if(m<5){
triggeraction 0,0,serverside,Mining Axe,bronze;
}
if(m<15&&m>10){
triggeraction 0,0,serverside,Mining Axe,silver;
}
if(m<20&&m>17){
triggeraction 0,0,serverside,Mining Axe,gold;
}
if(m==20){
triggeraction 0,0,serverside,Mining Axe,platnum;
}
unset okaytomine;
}

Reply With Quote
  #2  
Old 10-28-2005, 01:22 AM
ZeLpH_MyStiK ZeLpH_MyStiK is offline
Scripter
ZeLpH_MyStiK's Avatar
Join Date: May 2003
Location: NYC
Posts: 553
ZeLpH_MyStiK is on a distinguished road
Send a message via MSN to ZeLpH_MyStiK Send a message via Yahoo to ZeLpH_MyStiK
you forgot the weaponname in the clientside triggeraction.
while you're at it, this script is very insecure.

Edit: script sucks, delete!
__________________

Last edited by ZeLpH_MyStiK; 10-28-2005 at 01:46 AM..
Reply With Quote
  #3  
Old 10-28-2005, 01:43 AM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
Oh, thanks, but it still doesn't give the player money, or show the gfx (or play the .wav file)
Reply With Quote
  #4  
Old 10-28-2005, 02:51 AM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
Quote:
Originally Posted by ZeLpH_MyStiK
Edit: script sucks, delete!
What he said .

But to make this post productive, I'll give some advice:
You can do the random check serverside (for security).

Also:
Quote:
Originally Posted by excaliber7388
Heh, trust me, just use the format....they're watching you No really, some parts of it are kinda annoying (like not having weaponfired && playermp>2 in the same line, or when you have to do something like that multiple times) but it will help other people read it, as it is easy for every one.
You said that right?
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
  #5  
Old 10-28-2005, 04:06 AM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
still having trouble

was in a hurry to post, i normally like the format, however, when You're in a hurry (I am trying to complete the server) you don't do as well. Sorry for that, old habbits die hard.

btw, still can't mine X_X

Last edited by excaliber7388; 10-29-2005 at 02:24 AM.. Reason: updated
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 12:58 AM.


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