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 11-19-2001, 01:28 AM
RpgWarrior-Online RpgWarrior-Online is offline
Registered User
Join Date: Nov 2001
Posts: 4
RpgWarrior-Online is on a distinguished road
Question Please someone, I reall need help with this one

can anyone script a script that lets players donate money to a npc by saying donate ammount, and then only specifed accounts can take the moneys out of that npc ??
i.e. donate 5
then only 1 player account can take it out
anyone can do that for me ??
Reply With Quote
  #2  
Old 11-19-2001, 03:47 AM
Faheria_GP2 Faheria_GP2 is offline
Banned
Faheria_GP2's Avatar
Join Date: Oct 2001
Posts: 1,177
Faheria_GP2 is on a distinguished road
NPC Code:

if (playerchats) {
tokenize #c;
if (strequals(#c,Donate #t(1)) && strequals(#t(1),#v(strtofloat(#t(1))) && strtofloat(#t(1))>0 && playerrupees>=strtofloat(#t(1))) {
playerrupees-=strtofloat(#t(1));
rupees+=strtofloat(#t(1));
}
if (strequals(#c,Withdraw #t(1)) && strequals(#t(1),#v(strtofloat(#t(1))) && strtofloat(#t(1))>0 && rupees>=strtofloat(#t(1))) {
if (strequals(#a,SupersonicII)) { //Change this line to your account name
playerrupees+=strtofloat(#t(1));
rupees-=strtofloat(#t(1));
}
}
}



each part of the if statement has a purpose which i will explain
NPC Code:

strequals(#c,Donate #t(1))


This part checks to see if you said "Donate [amount]"
NPC Code:

strequals(#t(1),#v(strtofloat(#t(1)))


This part checks to see you didn't say "Donate [gibberish]"
NPC Code:

strtofloat(#t(1))>0


This part checks to see you didn't say "Donate -2100000" essentially exploiting a bug for an unlimited amount of cash
NPC Code:

playerrupees>=strtofloat(#t(1))


This part checks to see you actually have the rupees you are donating, otherwise (this might have been fixed by now) you will go to 2.1million
Reply With Quote
  #3  
Old 11-20-2001, 06:33 AM
RpgWarrior-Online RpgWarrior-Online is offline
Registered User
Join Date: Nov 2001
Posts: 4
RpgWarrior-Online is on a distinguished road
Thumbs up thanx

thanx
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 08:39 AM.


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