Graal Forums  

Go Back   Graal Forums > Development Forums > Tech Support
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-08-2004, 04:48 AM
Dach Dach is offline
call me Chad, it's cooler
Dach's Avatar
Join Date: Aug 2002
Posts: 1,899
Dach is on a distinguished road
aindexof - serverside

It has come to my attention that aindexof doesn't quite work serverside. When a variable not in the array is questioned, the function returns 0, but it should return -1.
NPC Code:

if (actionserverside) {
this.array = {0,1,2,4};
with (getplayer(#p(0)) setplayerprop #c,#v(aindexof(this.array,3));
}
}
//#CLIENTSIDE
if (keypressed) {
if (keydown2(keycode(c),false)) {
this.array = {0,1,2,4};
setplayerprop #c,#v(aindexof(this.array,3));
}
if (keydown2(keycode(v),false)) {
triggeraction 0,0,weaponname,#a;
}
}


Put this in a weapon script and try it. When you push c, you'll get -1, like you should. But, when you push v, you'll get 0, which is incorrect.
I forum PM'ed Stefan, but I wanted to make this thread to ensure he see's it (and to let others know, I suppose).
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial
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 04:38 PM.


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