Graal Forums

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

callimuc 10-10-2011 09:22 PM

Some question
 
So I´m working on with my movement (still improving dusty´s bare bone movement) and I got up to this:

I tried making a DisableMove(); command, which will be like DisableDefMovement(); (that worked so far) and now I wanted to make it set a gani like DisableMove("walk");. Here´s the scripts parts:


PHP Code:

function onActionServerside() {
  if (
params[0] == "DisableMove") clientr.move = false;
}

//#CLIENTSIDE
public function DisableMove(ani) {
  
triggerserver("gui", name, "DisableMove");
  if (
ani != NULL) setani(ani, NULL);
} 

PHP Code:

//#CLIENTSIDE
function onPlayerChats() {
  if (
player.chat == "/test") DisableMove("walk");
} 

PHP Code:

//#CLIENTSIDE
function onTimeOut() {
  
//movement stuff similar to dustys bare bone one. Suggesting to take a look there (link below)
  
if (clientr.move == true) setani(client.mode, NULL); // set the characters animation
} 

(link >here<)


I always have to say twice /test to make the gani set. Why won´t it work at the first time? How can I fix it?

scriptless 10-17-2011 04:51 AM

Did you initialize your TimeOut? And do you also reset "setTimer()" at the end?

callimuc 10-18-2011 12:28 AM

Quote:

Originally Posted by scriptless (Post 1671036)
Did you initialize your TimeOut? And do you also reset "setTimer()" at the end?

Why should I disable it? Cause it also checks in the timeout if the player can move.

Mark Sir Link 10-18-2011 07:52 AM

the issue here is your timeout occuring before the clientr value being set properly, so if (clientr.move == true) setani(client.mode, NULL); is executing before the clientr value is changed.

you should send the ani to the serverside portion of your code as well, and change the ani there.


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

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