Revised. Still not working.
PHP Code:
function punch(dx, dy) {
player.chat = "2";
if ( player.ani != "human2_swim" ) {
if ( player.ani != "human2_hthc_punch" ) setani( "human2_hthc_punch", null);
freezeplayer(.5);
for (temp.pl : findNearestPlayers(dx, dy)) {
if (! (dx in |player.x, player.x + 3| && dy in |player.y, player.y + 3|)) {
continue;
}
if (pl == player) continue;
pl.hit(0.5, player);
}
waitfor( GraalControl, "punch", .5);
if ( this.keyb_d == true ) {
setani( "human2_shield_hold", null );
onshield();
} else setani( "human2_idle" , null );
}
}
function onCreated() {
disableweapons();
addtiledef("picso2.png","psi_", 0);
enablefeatures( allfeatures -2 -8 -0x10 -0x20 );
showstats(256 + 512 + 1024);
// allow ourselves to hurt :o
player.join("hurt");
}
//#CLIENTSIDE
function GraalControl.onKeyDown(keycode, keychar) {
this.("keyb_" @ keychar) = true;
switch( keychar ) {
case "s":
player.chat = "1";
punch(player.x, player.y);
break;
case "d":
setani( "human2_shield_hold", null );
this.playerdir = player.dir;
onshield();
break;
}
if ( keycode == 9 ) {
this.keyb_d = false;
setani( "human2_idle", null );
shield();
}
}