SA-MP Forums Archive
[Include] Transfer-Mechanics - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] Transfer-Mechanics (/showthread.php?tid=567356)



Transfer-Mechanics - vermaritt - 13.03.2015

Transfer-Mechanics


Introduction

Provides a simple mechanism for passing/transferring objects and weapons from one player to another.

Note: This is a work in progress and It needs to be tested with 2-3 players. Use the demo script in order to observer the functioning.


How it works ?

• When you pass on an object, it gets moved through the air with a particular velocity and a rotational velocity and when a player comes near that thrown object OnPlayerCatchObject is called where you can code the object attachment code or whatever you like to code within it.

• When you pass on weapon, it gets moved through the air with a particular velocity and a rotational velocity(for realism) and the weapon which you passed gets removed from your weapon inventory, if a player comes near the thrown weapon, he acquires the thrown weapon along with the ammo (which you used to have before passing it). Thus, he acquires your weapon.


Requirements

• San Andreas Multiplayer Client 0.3.7
• zcmd (for demo script)


Include Focus

This include focuses mainly on Roleplay and Cops and Robberers servers.


Situational Uses

• [CnR/RP] If an unarmed robberer is being chased by an armed police officer, then another robberer(his/her partner) can help him by passing a weapon to him. This makes the gameplay look better.

• [Fun/CnR/RP] You can even have some fun with this include. Imagine if your friend wants to use your hat object for just a time being, you would just have to pass your hat to him and that's it. (Attachments of objects has to be coded manually, as this include just provides the mechanism).

• There are lots of uses rather than the mentioned uses.


Functions

Better documentation at GitHub please go through it once for description about parameters.
Код:
TFR_ObjectInit(cell, objectid)
TFR_PassObject(cell, playerid, Float:velx, Float:vely, Float:velz = 0.0, Float:limit = 5.0)
TFR_PassWeapon(cell, playerid, color, error[], Float:velx, Float:vely, Float:velz = 0.0, Float:rx = 0.0, Float:ry = 0.0, Float:rz = 0.0, Float:limit = 5.0)
TFR_SetRotVelocity(cell, Float:rx, Float:ry, Float:rz)
Suggestions/Questions

If you have any questions or suggestions please post it here or create an issue in GitHub.


Bugs/Glitches

If you get any create an issue in GitHub.


Download

GitHub (Demo script provided here)



Re: Transfer-Mechanics - biker122 - 13.03.2015

Sounds cool, might be useful for some servers!
Good work, man!


Re: Transfer-Mechanics - vermaritt - 13.03.2015

Thank you for the feedback.

To be noted, it passes objects/weapons through the air to enhance the gameplay.


Re: Transfer-Mechanics - MafiaOink - 13.03.2015

Its cool!


Re: Transfer-Mechanics - Alex Magaсa - 13.03.2015

Interesting! I'll check it later.


Re: Transfer-Mechanics - vermaritt - 14.03.2015

Added "How it works ?" section below Introduction for clear understanding.


Re: Transfer-Mechanics - MafiaOink - 16.07.2016

whats this man


Re: Transfer-Mechanics - PT - 17.07.2016

Video or screens will make understand better this.


Re: Transfer-Mechanics - Kar - 18.07.2016

Why not use MoveObject?