Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   player.rupees issue (https://forums.graalonline.com/forums/showthread.php?t=134261354)

MattKan 12-20-2010 05:09 AM

player.rupees issue
 
I am having a problem with the variable "player.rupees".

When I use the following:

PHP Code:

player.rupees += var;
player.rupees -= var; 

The gralat amount goes down to what it should be (as instructed by above), but then it goes back to what it was before about 0.5 seconds later.

Is there something I'm doing wrong?

fowlplay4 12-20-2010 05:20 AM

You can't permanently modify it on the client-side, you have to do it on the server-side.

Also don't use "var" since it's a keyword that likes to mess with scripts.

MattKan 12-20-2010 05:23 AM

Ok, is it possible to use onPlayerChats serverside?

And "var" was just an example. I used a different variable name in the actual script.

MattKan 12-20-2010 05:30 AM

Never mind, I have figured it out. (Should have tested before I posted >_<)

Thanks

Deas_Voice 12-20-2010 08:54 AM

triggerserver sould be used instead of onPlayerChats() serverside

Twinny 12-20-2010 09:48 PM

Quote:

Originally Posted by Deas_Voice (Post 1616999)
triggerserver sould be used instead of onPlayerChats() serverside

For clarification, if onPlayerChats is used serverside in something like a weapon, it could have adverse affects along with inherent security risks. Best to do the initial checking clientside as a first step authentication to weed out any unauthorised use (saves a trigger) then trigger the server with the data. Serverside can authenticate and perform the action.

cbk1994 12-20-2010 11:52 PM

Quote:

Originally Posted by Twinny (Post 1617077)
For clarification, if onPlayerChats is used serverside in something like a weapon, it could have adverse affects along with inherent security risks. Best to do the initial checking clientside as a first step authentication to weed out any unauthorised use (saves a trigger) then trigger the server with the data. Serverside can authenticate and perform the action.

....what?

Fulg0reSama 12-20-2010 11:58 PM

Quote:

Originally Posted by cbk1994 (Post 1617115)
....what?

You had a problem following that?

DrakilorP2P 12-21-2010 04:52 PM

Quote:

Originally Posted by Twinny (Post 1617077)
For clarification, if onPlayerChats is used serverside in something like a weapon, it could have adverse affects along with inherent security risks.

Security risks like what? Would that even work in a weapon script?

fowlplay4 12-21-2010 05:01 PM

Quote:

Originally Posted by DrakilorP2P (Post 1617195)
Security risks like what? Would that even work in a weapon script?

My understanding is that weapon scripts act like Control type NPCs on the server-side. So I doubt it would.

Anything can end up being a security risk in the hands of uneducated scripter.

Mark Sir Link 12-21-2010 08:12 PM

last I checked, onPlayerChats doesn't work in weapons.

Deas_Voice 12-21-2010 08:48 PM

Quote:

Originally Posted by Mark Sir Link (Post 1617233)
last I checked, onPlayerChats doesn't work in weapons.

:oo: what?

Fulg0reSama 12-21-2010 08:49 PM

Quote:

Originally Posted by Deas_Voice (Post 1617243)
:oo: what?

that's what I was thinking.

Crow 12-21-2010 09:04 PM

He's probably talking about the serverside.

MattKan 12-21-2010 09:50 PM

Quote:

Originally Posted by Mark Sir Link (Post 1617233)
last I checked, onPlayerChats doesn't work in weapons.

Even I know that it does :O

Fulg0reSama 12-21-2010 09:55 PM

Quote:

Originally Posted by Crow (Post 1617251)
He's probably talking about the serverside.

Why would you use onPlayerChats on serverside anyways..? It's a clientside only function

Crow 12-21-2010 10:12 PM

Quote:

Originally Posted by Fulg0reSama (Post 1617267)
Why would you use onPlayerChats on serverside anyways..? It's a clientside only function

No, it is not. It's quite useful on the serverside when used in NPCs.

cbk1994 12-21-2010 10:13 PM

onPlayerChats is called clientside-only in weapons. If it was called serverside in weapons, that would usually be the preferred way to use it for most things. It certainly wouldn't be less secure.

This is why Twinny's post made no sense to me, and still does.

DustyPorViva 12-21-2010 10:21 PM

Quote:

Originally Posted by Fulg0reSama (Post 1617267)
Why would you use onPlayerChats on serverside anyways..? It's a clientside only function

No it's not?


All times are GMT +2. The time now is 06:39 PM.

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