Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   I can't mine! (https://forums.graalonline.com/forums/showthread.php?t=61947)

excaliber7388 10-27-2005 10:41 PM

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;
}


ZeLpH_MyStiK 10-28-2005 01:22 AM

you forgot the weaponname in the clientside triggeraction.
while you're at it, this script is very insecure.

Edit: script sucks, delete!

excaliber7388 10-28-2005 01:43 AM

Oh, thanks, but it still doesn't give the player money, or show the gfx (or play the .wav file)

napo_p2p 10-28-2005 02:51 AM

Quote:

Originally Posted by ZeLpH_MyStiK
Edit: script sucks, delete!

What he said :redface:.

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?

excaliber7388 10-28-2005 04:06 AM

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


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

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