
02-03-2009, 01:05 AM
|
|
Coder
|
 |
Join Date: Jan 2008
Location: -78.464422, 106.837328
Posts: 449
|
|
Quote:
Originally Posted by Unkownsoldier
Still doesnt work but I will try experimenting
PHP Code:
//#CLIENTSIDE
//up
if (playerdir=0){
this.x=playerx-10;
this.y=playery-20;
}
//left
if (playerdir=1){
this.x=playerx-10;
this.y=playery-10;
}
//down
if (playerdir=2){
this.x=playerx+0.4;
this.y=playery+10;
}
//right
if (playerdir=3){
this.x=playerx-10;
this.y=playery-10;
}
function onKeyPressed(c, k) {
if (k == "a") {
replaceani("idle", "idle");
replaceani("walk", "walk");
setani("idle", NULL);
}
}
if (weaponfired) {
setani pancho_katana-attack,;
replaceani idle,pancho_katana-idle;
replaceani walk,pancho_katana-walk;
}
function onWeaponFired() {
temp.dx = player.x + vecx(player.dir) * 1.5;
temp.dy = player.y + vecy(player.dir) * 2;
triggeraction(dx, dy, "AttackPlayer", player.account, .5);
}
function onActionAttackPlayer(acc, damage) {
if (acc == player.account) {
return; // this ends the function
}
if (damage <= 0) {
return;
}
hurt(damage);
setAni("HURTGANI", null);
}
|
Can you please encapsulate your code in [php] tags? This makes it easier to read and to understand. Thanks. |
__________________
- Iᴀɴ Zɪᴍᴍᴇʀᴍᴀɴ
|
|
|
|