Thread: Bombs and Bows
View Single Post
  #11  
Old 05-15-2011, 02:42 AM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
The default weapons are implemented with built-in scripts, if you want to write a custom one then you need to use a different weapon name.
I'm not sure if we have already posted the default scripts, but they are quite simple, here the bomb and bow:
PHP Code:
//#CLIENTSIDE
function onWeaponFired() {
  if (
player.bombs<=0)
    return;
  if (
player.dir==0putbomb(1,player.x+0.5,player.y-1);
  if (
player.dir==1putbomb(1,player.x-1.5,player.y+1);
  if (
player.dir==2putbomb(1,player.x+0.5,player.y+2.5);
  if (
player.dir==3putbomb(1,player.x+2.5,player.y+1);
  
player.bombs--;

PHP Code:
///#CLIENTSIDE
function onWeaponFired() {
  if (
player.darts<=0)
    return;
  
freezeplayer(0.3);
  
setani("shoot","wbow1.png");
  
setTimer(0.25);
}
function 
onTimeout() {
  
shootarrow(player.dir);
  
player.darts--;

Reply With Quote