After using your method it didn´t work:
PHP Code:
//#CLIENTSIDE
function onKeypressed(){
if (keydown2(keycode(d),true) && this.key==0){
this.key=1;
callweapon selectedweapon,"weaponfired";
while (keydown2(keycode(d),true))sleep .05;
this.key=0;
}
}
function onWeaponFired() {
player.chat = "test";
}
Also a lot parts where in GS1 ;I
But the script got me into some ideas so I came up to this:
PHP Code:
//#CLIENTSIDE
function onKeypressed(){
if (keydown2(keycode(d),true) && this.key==0){
this.key=1;
findweapon(name).onWeaponFired();
while (keydown2(keycode(d),true)) sleep(.05);
this.key=0;
}
}
public function onWeaponFired() {
player.chat = "test";
}
This also works. But is it a good way of using it like this?