[Include] Transfer-Mechanics
#1

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)
Reply
#2

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

Thank you for the feedback.

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

Its cool!
Reply
#5

Interesting! I'll check it later.
Reply
#6

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

whats this man
Reply
#8

Video or screens will make understand better this.
Reply
#9

Why not use MoveObject?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)