Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Old Scripting Engine (GS1) (https://forums.graalonline.com/forums/forumdisplay.php?f=154)
-   -   [!help!] Script isnt Warping the player (https://forums.graalonline.com/forums/showthread.php?t=64159)

lordspawn 02-17-2006 04:40 AM

[!help!] Script isnt Warping the player
 
Ok, im makin a type of warpbook script for a server and it's just not warping the player to the spot. Im not sure if its the serverside section at the top that's messing it up or what, anyway heres the script. [NO STEALING =/]

PHP Code:

if (actionserverside) {  
    if(
strequals(#p(0),warpbook)) {
    
setlevel2 #p(0),strtofloat(#p(1)),strtofloat(#p(2));    
    
}
    }
//#CLIENTSIDE
if (weaponfired) {
  
playerdir=2;
  
setani cross-forplayerworld149-newwarp,;
  
this.mode=abs(this.mode-1);
  if(
this.mode=0){
    
hideimg 296;
    
hideimg 297;
    
timeout=0;
  }
  else{
timeout=.05;}
}
if(
timeout&&this.mode=1){
  
tokenize #s(PlayerWarps);
  
if(keydown(1)){this.selected=this.selected-4;timeout=.5;}
  elseif(
keydown(3)){this.selected=this.selected+4;timeout=.5;}
  else{
timeout=.05;}
  if(
this.selected<0){this.selected=tokenscount-4;}
  if(
this.selected>tokenscount-1){this.selected=0;}
  
showimg 296,@@cb@Left or Right To Change S To Warp or A to cancel,playerx+1.5,playery-2;
  
showimg 297,@@cb@#t(this.selected),playerx+1.5,playery-1;
  
freezeplayer1;
  if(
keydown(5)){
    
this.mode=0;
    
hideimg 296;
    
hideimg 297;
    
playerfreezetime=0;
    
setani warper,;
    
sleep 2;
    
triggeraction 0,0,serverside,Warpbook,warpbook;
  }
  if(
keydown(6)){
    
setani idle,;
    
playerfreezetime=0;
    
this.mode=0;
    
hideimg 296;
    
hideimg 297;
  }


Help, and advice on what to change to make it warp the player please x_x

Gambet 02-17-2006 04:48 AM

tokenize #s(PlayerWarps);


I'm not sure if the above is correct, but I believe

tokenize (PlayerWarps);

would work.

Tolnaftate2004 02-17-2006 04:56 AM

NPC Code:
if (actionserverside) {  
if(strequals(#p(0),warpbook)) {
setlevel2 #p(0),strtofloat(#p(1)),strtofloat(#p(2));
}
}



Param 0 is "warpbook". You can't warp to level "warpbook" (it doesn't exist, guaranteed).
Not only that, you have not specified params 1 or 2 (or 3) in the triggeraction.

ZeLpH_MyStiK 02-17-2006 07:50 AM

Quote:

Originally Posted by Gambet
tokenize #s(PlayerWarps);


I'm not sure if the above is correct, but I believe

tokenize (PlayerWarps);

would work.

tokenize (PlayerWarps) would give you (PlayerWarps) as #t(0). And that's it.

tokenize #s(PlayerWarps) however, tokenizes the string PlayerWarps.

ApothiX 02-17-2006 06:47 PM

For the PlayerWarps variable, you should probably make it a client. string or actually initialise it in the script.

Is the triggeraction actually getting called? I don't see any debugging going on serverside (like a sendtonc or so) to tell you if it's actually geting called.

Also, sleeps kill timeouts.

Rick 02-17-2006 06:48 PM

Off-topic: PLEASE make this script more secure before actually letting players use it.

lordspawn 02-17-2006 08:20 PM

good stuff, thanks, ill go back and redo some things.


All times are GMT +2. The time now is 09:00 AM.

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