Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Extra Status Bar Help! (https://forums.graalonline.com/forums/showthread.php?t=29157)

IceFire_TK 05-14-2002 08:46 PM

Extra Status Bar Help!
 
Hello, Graalians and scripters alike.
I have been working on a status bar system for a friend for quite some time now. I have HP,MP and AP all up and 100% bug-free offline and online for both P2P and non-P2P servers. But, he would like to make another system, like another status bar called FP(Fire points). But i dunno how to create a string to save the FP data clientside. I tried using clint.fp, but it won't change with the bars, and/or it doesn't work, the FP doesn't register. The bars are correct, but my way of saving it as another system isn't :(

Could someone please help me! I really need to know how clientside system varible that will register kinda like a HP or MP bar(BUT NOT USING MP OR HP!)

Thanks!

Falcor 05-14-2002 09:06 PM

I assume you mispelled the string prefix.
NPC Code:

setstring client.fp,#v(strtofloat(#s(client.fp)) + ammount);



That will add an ammount to your firepoints (assuming ammount is the variable you wish to add to the firepoints.). now as for converting the string into a variable it is simple.

NPC Code:

variable = strtofloat(#s(client.fp));



If this is for p2p i would suggest you use serverside triggeractions to edit a clientr. string instead of client. since client strings are easily hacked. You can use prefixed strings on non-p2p worlds. they just work like regular strings without an NPCs server (except for the obviouse server. prefix)

[edit] I have a habbit of editing my post multiple times after i post it :( [/edit]

IceFire_TK 05-14-2002 09:13 PM

Ok I will try it ;)
Thanks for the help :):):)


[EDIT] It's ok to edit your posts, i have that the nerve to do that too sometimes :([/EDIT]

Andor_RC9 05-14-2002 09:14 PM

hmmm, did you set a variable or a string?
because client.fp = 1
is a variable, and i dont often use.
but setstring client.fp,1;
i like alot better, as i love strings

heres a sample, of like how to decrease it and increase it

// EVENT:Magic Weapon : Decreaser
NPC Code:

NPC Code:

if (weaponfired) {
if (strtofloat(#s(client.fp)) >= 10) {
setstring client.fp,#v(strtofloat(#s(client.fp))-10);
//put weapons stuff here
}
elseif (!strtofloat(#s(client.fp)) >= 10) {
setplayerprop #c,You dont have enough Fire Points!;
}
}





That is one way of decreasing the value.. (untested, should work)

NPC Code:

NPC Code:

// EVENT:Magic Fire Bean : Increaser
if (playertouchsme) {
say2 Your FP has been increased!;
if (strtofloat(#s(client.fp)) < this.maxfp - 25) {
setstring client.fp,#v(strtofloat(#s(client.fp))+25);
}
}





I think that would work.

..:| EDIT - God, im too slow again :( when did falados beat me to it? :( |:..

from R0bin

Falcor 05-14-2002 09:31 PM

Its good to have multiple views on the situation anyhow.

(I recomment useing code tags instead of PHP. Since PHP comments inlcude # just like Perl)

Saga2001 05-14-2002 10:59 PM

Quote:

Originally posted by Andor_RC9
:spam::spam::spam::spam::spam::spam::spam::spam:
ok.
NPC Code:

NPC Code:

setplayerprop #c,R0bin owns a clock...?;





teehee

from R0bin

x_x. Hey fal u gotta edit that other post, inlcude? Yes, I prefer using [code] too it just works better...also ther PHP thing color coding can make some parts unreadable...Also R0bin, else if not elseif...

IceFire_TK 05-14-2002 11:31 PM

they don't work :(

hmm... Maybe i wasn't clear, or i was unsure at the time.
But i want to to START at 100%(100) and go DOWN as you use it like HP. and then if you buy FP it goes back up.


thanks

Neonight 05-15-2002 12:24 AM

Quote:

Originally posted by Saga2001

else if not elseif...


Jagen:
Both ways work fine, it depends on how you like to make it...


All times are GMT +2. The time now is 03:33 PM.

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