Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Closed Thread
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-17-2004, 06:19 PM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
trader

I made a token(the money used on my server) trader, using with and crap as shown:

NPC Code:

if (actionserverside) {
with(getplayer(#p(1))) {
setstring client.tokens,#v(strtofloat(#s(client.tokens))+str tofloat(#p(0)));
}
}
//#CLIENTSIDE
if (playerchats&&startswith(token,#c)) {
tokenize #c;
play bomb.wav;//just to tell the person the transaction is done
setstring client.tokens,#v(strtofloat(#s(client.tokens))-strtofloat(#t(1)));
triggeraction 0,0,serverside,Token trader,#t(1),#t(2);
}







But foir some reason, the person supposedly recieving the tokens doesnt get them. Can someone help me? (Note: I am not asking for someone to fix it for me, just tell me what i am doing wrong so I can learn that for future reference)
  #2  
Old 06-17-2004, 07:28 PM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
If you say token osrs 1; It will get the account of the player instead of the value to be transfered. Maybe that is your problem, you may be using the wrong syntax when saying the commands. Make sure that the token #t(1) is a number and it is > 0.
Also I would suggest you to use a clientr.string, since client.strings are hackables.
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
  #3  
Old 06-17-2004, 07:37 PM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
I have tried the syntax thing and it didnt work and i already changed it so it must be a number over 0, and what makes clientr.string less hackable?
  #4  
Old 06-17-2004, 07:57 PM
Ningnong Ningnong is offline
Registered User
Ningnong's Avatar
Join Date: Nov 2002
Location: < -- way
Posts: 262
Ningnong is on a distinguished road
Thats not formatted according to correct coding standards :/

NPC Code:

if (playerchats){
if (startswith(....



Also with that trading system you could say a minus value, which would give the player money.

i.e. trade -10 --- > current_tokens - -10 = +10
__________________
Former Global Scripting Team Member


  #5  
Old 06-17-2004, 08:08 PM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
why does the coding standards matter? and why would i use negative amounts? Im getting little help here...
  #6  
Old 06-17-2004, 08:46 PM
Xecutor Xecutor is offline
Former UN Manager
Join Date: Apr 2004
Posts: 117
Xecutor is on a distinguished road
You won't necessarily say negative values, but a player would use it as a bug to gain money.

Coding standards matter to keep a level of efficiency.
  #7  
Old 06-17-2004, 10:13 PM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
i Could just abs it and also i could care less about level of efficiency i just want it to work!
  #8  
Old 06-17-2004, 10:21 PM
Xecutor Xecutor is offline
Former UN Manager
Join Date: Apr 2004
Posts: 117
Xecutor is on a distinguished road
Unefficient coding doesn't work all the time. It works when it wants to.
  #9  
Old 06-17-2004, 10:43 PM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
"just getting it to work" is what killed Zone...
  #10  
Old 06-17-2004, 10:57 PM
Ningnong Ningnong is offline
Registered User
Ningnong's Avatar
Join Date: Nov 2002
Location: < -- way
Posts: 262
Ningnong is on a distinguished road
Also, you will need to include the players 'tokens' in that triggeraction (sending it to the server) using #s(client.tokens).
__________________
Former Global Scripting Team Member


  #11  
Old 06-17-2004, 10:57 PM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
erm well it works fine normally it's not like i did something backwards like
if (keydown(132)) {if (timeout) {blahdeeblah}}
lol
now can someone just help me figure out what is wrong with this script?!
  #12  
Old 06-17-2004, 11:36 PM
Trevor Trevor is offline
True
Trevor's Avatar
Join Date: Mar 2003
Posts: 2,253
Trevor is on a distinguished road
Wouldn't you want the sound after the triggeraction? The "transaction" isn't done untill control is returned to clientside. (Well, I guess if Graal just sends out a triggeraction and doesn't wait for a response to continue executing scripts it doesn't matter much.)

This is more of a question on my part, but is a #s in a strtofloat() call really nessecary? It seems rather redundant :\ .
__________________


name: Trevor Fancher
email: trevor at fancher dot org
home page: fancher.org
  #13  
Old 06-17-2004, 11:38 PM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
Triggeraction is not waiting for the action to be received.

#s is neccessary.
  #14  
Old 06-17-2004, 11:48 PM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
Angry

Uh yeah so telll me, how does this help me?! Doesnt anyone here have the ability to find out what is wrong with the script that stops it from giving the other person tokens, and telling me?!
I dont care about format, or anything lelse about it, I'll be happy if it just works like i want it to !!!!!!!
  #15  
Old 06-17-2004, 11:56 PM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
Yes, but we will not "be happy if it just works fine like you want it to !!!!!!! "
So if you request help, you should as well listen to suggestions and not ignore them.
  #16  
Old 06-18-2004, 12:47 AM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
i dont see why anyone else would care if its not formatted right or i dont use the right font size or whatever, since people who use the script wont be able to acess it. I do listen to suggestions but i ignore stuff like format it right because i dont care about that!
  #17  
Old 06-18-2004, 01:53 AM
Xecutor Xecutor is offline
Former UN Manager
Join Date: Apr 2004
Posts: 117
Xecutor is on a distinguished road
This forum is not made to just give you the answer, improper coding is not supported here. If you ignore the suggestions then you shouldn't bother asking at all.
  #18  
Old 06-18-2004, 01:50 PM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
Exactly. I do not need to type ten characters. *waves hand*
  #19  
Old 06-18-2004, 04:56 PM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
*restrains self* look, all i want is a little help on my npc, if you guys cant help me with what i asked, then please stop posting
  #20  
Old 06-18-2004, 05:24 PM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
Okay, I stopped the posting.
Closed Thread


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 09:06 PM.


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