Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Tech Support (https://forums.graalonline.com/forums/forumdisplay.php?f=7)
-   -   aindexof - serverside (https://forums.graalonline.com/forums/showthread.php?t=51567)

Dach 03-08-2004 04:48 AM

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).


All times are GMT +2. The time now is 05:53 AM.

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