Author Topic: Heed's learning to script!  (Read 1460 times)

Oh, you are right. I did not notice that. Just replace %obj.client.ammo >= 8  with %obj.client.ammo > 8.

No my point is the ammo should start at a high value and get reduced when the weapon is fired, and then prevent the weapon firing when it reaches 0. At the moment it seems to increase to 8 and the weapon can only fire (once) when it reaches 9. That doesn't seem to be the correct way for ammo to work.

My mistake, this should be correct.
Code: [Select]
package AmmoMod
{
function GunImage::onFire(%this,%obj,%slot)
{
if(%obj.client.Ammo <= 0)
{
echo("You have no ammo!");
                return;
}
else
{
echo(%obj.client.Ammo);
%obj.client.Ammo -= 1;
parent::onFire(%this,%obj,%slot);
return;
}
}
};
activatePackage(AmmoMod);

Wellanyway, what should I attempt to make since I am starting off?

I got this.

Code: [Select]
package SpawnMessage
{
   function gameConnection::onClientEnterGame(%client)
   {
      parent::onClientEnterGame(%client);
   
      commandToClient(%client, 'messageBoxOK', "Please do not spam.", "Please act mature.\n\n\nDO NOT USE RANDOM VEHICLE/WEAPON SPAWNS.\n\nPressing 'Ok' verifys that you accept these rules.");
   }
};
activatePackage(SpawnMessage);

But when you spawn, it appear for like, a second, then disappears. How would i make it appear longer?

Well, at least you're not trying to script vista this time.

ehehe

Well, at least you're not trying to script vista this time.

ehehe
Obvious Beekay is Obvious.


.. what
You join sometime in august, so you decide to snoop through people's old posts and bring stuff up that is like a year old, just like Beekay did.

You join sometime in august, so you decide to snoop through people's old posts and bring stuff up that is like a year old, just like Beekay did.
Not trying to derail or anything, but I'm an old member from .. a long time ago. [/end theroy]