Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   ::need help:: (https://forums.graalonline.com/forums/showthread.php?t=15168)

nyghtGT 10-22-2001 06:03 AM

::need help::
 
How can i get this to show the players # of darts ?
NPC Code:

// NPC made by Nyght *Asst* (LAT Admin)
hide;
if (playerenters && !hasstats) {
toweapons -stats;
set hasstats;
}
if (created) {
showstats 1;
showstats 2;
showstats 4;
showstats 8;
showstats 16;
showstats 32;
showstats 64;
showstats 128;
showstats 256;
showstats 512;
showstats 1024;
showimg 521,norin_stats.gif,440,5;
changeimgvis 521,4;
changeimgpart 521,0,0,193,94;
}
// Setting Max Quantities
if (!maxarrows=50 || !maxarrows=99) {
setstring maxarrows,25;
}
if (strcontains(25,#s(maxarrows))) {
showimg 523,@verdana@<Players Dart Count>/25,486,65;
changeimgvis 523,4;
changeimgzoom 523,0.85;
changeimgcolors 523,0,0,0,1;
}

// Arrows
if (playerdarts>=26 && strcontains(25,#s(maxarrows))) {
playerdarts = 25;
}


Any help would be awesome !

TDO2000 10-22-2001 06:14 AM

showimg 523,@verdana@#v(playerdarts/25),486,65;


or what do u mean?

KJS 10-22-2001 06:24 AM

Re: ::need help::
 
Quote:

Originally posted by nyghtGT
How can i get this to show the players # of darts ?
NPC Code:

// NPC made by Nyght *Asst* (LAT Admin)
hide;
if (playerenters && !hasstats) {
toweapons -stats;
set hasstats;
}
if (created) {
showstats 1;
showstats 2;
showstats 4;
showstats 8;
showstats 16;
showstats 32;
showstats 64;
showstats 128;
showstats 256;
showstats 512;
showstats 1024;
showimg 521,norin_stats.gif,440,5;
changeimgvis 521,4;
changeimgpart 521,0,0,193,94;
}
// Setting Max Quantities
if (!maxarrows=50 || !maxarrows=99) {
setstring maxarrows,25;
}
if (strcontains(25,#s(maxarrows))) {
showimg 523,@verdana@<Players Dart Count>/25,486,65;
changeimgvis 523,4;
changeimgzoom 523,0.85;
changeimgcolors 523,0,0,0,1;
}

// Arrows
if (playerdarts>=26 && strcontains(25,#s(maxarrows))) {
playerdarts = 25;
}


Any help would be awesome !

just going though it quickly I fixed a few bugs...

NPC Code:

if (playerenters && !isweapon) {
toweapons -stats;
hide;
}
if (created && isweapond) {
showstats 1+2+4+8+16+32+64+128+256+512+1024;
showimg 521,norin_stats.gif,440,5;
changeimgvis 521,4;
changeimgpart 521,0,0,193,94;
timeout=0.1;
}
if(timeout){
// Setting Max Quantities
if (!maxarrows==50 || !maxarrows==99)
setstring maxarrows,25;
if (strcontains(25,#s(maxarrows))) {
showimg 523,@verdana@<Players Dart Count>/25,486,65;
changeimgvis 523,4;
changeimgzoom 523,0.85;
changeimgcolors 523,0,0,0,1;
}
// Arrows
if (playerdarts>=26 && strcontains(25,#s(maxarrows)))
playerdarts = 25;
timeout=0.1;
}


ownerofbabylon 10-22-2001 06:33 AM

on showimg is there a reason its 521? why not just do like 5?

nyghtGT 10-22-2001 06:41 AM

Quote:

Originally posted by ownerofbabylon
on showimg is there a reason its 521? why not just do like 5?
yeah ... 500 shows it locally for the player and if a playerenters a new level it is still there ...

btedji 10-23-2001 03:35 AM

you need to use #s and strtofloat when calling strings


All times are GMT +2. The time now is 08:25 PM.

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