Author Topic: Item Mounting Script  (Read 4530 times)

The Item Mounting Script

I wrote a very simple script showing how easy it is for someone to make an item that can be mounted with a simple server command. I found it very useful, considering all the add-on testing I've done lately.

To use,
Type /mountgun   for a gun in your hand
Type /mountrl   for a rocket launcher in your hand
Type /mountwrench   for a wrench in your hand
Type /mounthammer   for a hammer in your hand.

Feel free to go inside the script and change things too your liking (I.E. removing a script, changing one), and/or take the script to put into your own item add-on.

Here's the link:
http://www.mediafire.com/?jjz2melyjve

there was a similar one, that crashed a server if you used it whilst dead, same problem here?

there was a similar one, that crashed a server if you used it whilst dead, same problem here?

I'm not sure how that would affect it. The function was called serverCmd, but why would a dead server crash because of that?

/usehammer already exists. Wrench seems very useful, though.

I'm not sure how that would affect it. The function was called serverCmd, but why would a dead server crash because of that?
I think it console spammed the server to death cause it wouldn't give up on getting it in the hand

I think it console spammed the server to death cause it wouldn't give up on getting it in the hand

There's always many server commands, this doesn't have anything to do with the problem

This isn't really mounting, is it? It just gives you the item? Real mounting is tank turrets on the wings of the biplane :3

This isn't really mounting, is it? It just gives you the item? Real mounting is tank turrets on the wings of the biplane :3

The command is mountImage. It just means the weapon is mounted to your hand

I don't see why you have so many different server commands. You could have just done something like /Equip itemName.
Code: [Select]
function serverCmdEquipItem(%client,%uiName) {
if(isObject(%client.player)) {
%image=%uiName@"Image";
%client.player.updateArm(%image);
%client.player.mountImage(%image,0);
}
}
This should work. And it will work with most items, the only items it won't work with is ones that have an alternate image name than just 'uiName'Image.

EDIT: Why do you use playThread() when you could use updateArm()?

EDIT2:
I have a suggestion, if you know how. Make it so you type after the /cmd, say /mountwrech (Player's Name). Mount it on a player other than you, admin only.
Code: [Select]
function serverCmdEquipTo(%client,%uiName,%victim) {
%victimCl=findClientByName(%victim);
if(isObject(%victimCl.player)) {
%image=%uiName@"Image";
%victimCl.player.updateArm(%image);
%victimCl.player.mountImage(%image,0);
}
}
« Last Edit: January 30, 2010, 05:42:59 PM by HellsHero »

I have a suggestion, if you know how. Make it so you type after the /cmd, say /mountwrech (Player's Name). Mount it on a player other than you, admin only.

I don't see why you have so many different server commands. You could have just done something like /Equip itemName.

Too much variety. What if you have something very spamable?

This isn't really mounting, is it? It just gives you the item? Real mounting is tank turrets on the wings of the biplane :3
Could you make that? :D

Also, the /mountgun /cmd is useful when you don't wanna spawn a gun to test some sort of projectile event.

Too much variety. What if you have something very spamable?
You can easily restrict the 'spamable' item.

Also, the /mountgun /cmd is useful when you don't wanna spawn a gun to test some sort of projectile event.

This is EXACTLY what I use this for

You can easily restrict the 'spamable' item.
How do you restrict something if everyone has access to every single weapon on the server?

How do you restrict something if everyone has access to every single weapon on the server?
You make no god damn sense, since you said that then,
What if you have something very spamable?
is not valid.
« Last Edit: January 30, 2010, 05:55:50 PM by HellsHero »