Graal Forums

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

Kansuke 10-23-2001 10:35 AM

Donations..
 
How do u make a donations box.. so you can say Donate (ammount) and it saves and only one account (Kansuke) can withdraw from it..

dragoonvenganc 10-23-2001 10:42 AM

if (startswith(Donation,#c)){tokenize #c;
setstring donation,#v(#s(donation)+#t(1));
setplayerprop #c, Thank you for Donating;}

if (playersays(withdraw)&&strequals(#a,kansuke)){play errupees=playerrupees+strtofloat(#s(donation));set string donation,;}

that should work i did it fast.. i think startswith is (partstr,fullstr)

Kansuke 10-23-2001 11:07 AM

when i say donation 5 it doesn't take away 5 rupees from me but it donates 5g

Kansuke 10-23-2001 11:26 AM

should i use playerrupees-=#t;
??

Shard_IceFire 10-23-2001 08:41 PM

Why are there two threads about this!?

dragoonvenganc 10-23-2001 10:09 PM

lol sorry u said make it so it donates not does it all try this one

if (startswith(Donation,#c)){tokenize #c;
if (playerrupees<=strtofloat(#t(1))){playerrupees=pla yerrupees-#t(1);
setstring donation,#v(#s(donation)+#t(1));
setplayerprop #c, Thank you for Donating;}
else setplayerprop #c, Sorry you do not have enough money;}

try that one

And the 2 forum thing.. because he messed up.. USE ONE FORUM OR DO NOT POST

hope this helps

TDO2000 10-23-2001 10:20 PM

Quote:

Originally posted by dragoonvenganc
lol sorry u said make it so it donates not does it all try this one

if (startswith(Donation,#c)){tokenize #c;
if (playerrupees<=strtofloat(#t(1))){playerrupees=pla yerrupees-#t(1);
setstring donation,#v(#s(donation)+#t(1));
setplayerprop #c, Thank you for Donating;}
else setplayerprop #c, Sorry you do not have enough money;}

try that one

And the 2 forum thing.. because he messed up.. USE ONE FORUM OR DO NOT POST

hope this helps

I think u have to use strtofloat in the setstring part too


if (startswith(Donation,#c)){tokenize #c;
if (playerrupees<=strtofloat(#t(1))){playerrupees=pla yerrupees-#t(1);
setstring donation,#v(strtofloat(#s(donation))+strtofloat(#t (1)));
setplayerprop #c, Thank you for Donating;}
else setplayerprop #c, Sorry you do not have enough money;}


All times are GMT +2. The time now is 12:08 AM.

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