[Include] Rit Server Includes ( rSI )
#1

rit Server Includes

RIT©


Update (7/16/2014)


Note: Some changes has been made ,regarding include names for more details, go through
the README.txt provided with the file.New functions are added too.
Functions marked with "(new)"
are new functions.

This include contains 80+ unique,useful and time saving functions.Which can be used
while scripting any kind of server.Note: Do not compare YSI and RIT both are different,though
YSI is more advanced.
Installation process is in the "README.txt".
If you have any suggestions for the next update , feel free to post it here.Though,
I will try my best to create it.Please do not worry if your suggestion will be useful , you will be automatically
added in the credits section.


rit_cord

Introduction


This include is mostly related with co-ordinates,velocity and vectors. With this
include you can easily get the player axis co-ordinates ,velocity and much more
things related to axis co-ordinates.

GetX :- Returns the value of the "X" co-ordinate of a player.
Note: Returns a Float value

GetY :- Returns the value of the "Y" co-ordinate of a player.
Note: Returns a Float value

GetZ :- Returns the value of the "Z" co-ordinate of a player.
Note: Returns a Float value

GetVelX :- Returns the velocity of player in "X" axis while moving.
Note: Returns a Float value

GetVelY :- Returns the velocity of player in "Y" axis while moving.
Note: Returns a Float value

GetVelZ :- Returns the velocity of player in "Z" axis while moving.
Note: Returns a Float value

GetPlayerSpeed :- Returns the speed of a player in KM/H. Returns integer type value.
Note: Returns '-1' If player not connected.


GetVehicleSpeed :- Returns the speed of a vehicle in KM/H. Returns integer type value.
Note: Returns '-1' If player not connected or if player is not present within a vehicle.

SkyDive :- Give player a parachute and makes player skydive.
Note: Return 0 if player not connected.

SyncPlayer :- Syncs the player if they get stuck any where within the server.
Returns 1 if the player is connected ,if not, Returns 0


--------------------------------------------------------------------------------


Syntax:-

GetX(playerid);

GetY(playerid);

GetZ(playerid);

GetVelX(playerid);

GetVelY(playerid);

GetVelZ(playerid);

GetPlayerSpeed(playerid);

GetVehicleSpeed(playerid);

SkyDive(playerid, Float:height);

SyncPlayer(playerid);









rit_health :

Introduction


This include provides you some player health related functions.Which are very
useful for roleplay servers as well as freeroam servers.


GetHealthLoss :- Returns the amount of health loss of a player.Returns Float value.

GivePlayerHealth :- Gives certain amount of health to player according to your
specification. Returns '0' if the amount of health is set
above 100.0.

EnableGod :- Gives God mode to player. Returns '0' if the player is not connected.

DisableGod :- Removes god mode from a player, as well as set player's health to
100.0. Returns '0' if the player is not connected.

TransferBlood :- This function transfers the blood from one player to another player.
Note: The player who is transferring the blood should contain blood more than
target players health loss.

playerid = The one who will give the blood.
targetid = The one who will accept the blood.
Returns -1 if both of the players are not connected.
Return 0 if playerid does not have suitable amount of blood to satisfy
the target or if loss of blood equals to '0'.

Kill :- Kills the player.





--------------------------------------------------------------------------------


Syntax:-

GetHealthLoss(playerid);

GivePlayerHealth(playerid, Float:amount);

EnableGod(playerid);

DisableGod(playerid);

TransferBlood(playerid,targetid);

Kill(playerid);









rit_misc:

Introduction


This include contains miscellaneous functions related to playe, which simplifies your
work too.

AddAllClass :- With this function you don't need write 299 lines of code, just
Just Add this function and you're done.

ClassCamSet :- With this function you simply set your camera facing angle,camera
position, and camera look at, just in online.
Instead of writing this :-

SetPlayerPos(playerid, 1479.1705,-905.9827,59.6022);
SetPlayerCameraPos(playerid, 1480.6584,-908.8497,59.6022);
SetPlayerFacingAngle(playerid,208.2598);
SetPlayerCameraLookAt(playerid, 1479.1705,-905.9827,59.6022);

You can simply add :-

ClassCamSet(playerid,1480.6584,-908.8497,59.6022,208.2598,1479.1705,-905.9827,59.6022);

"And you're done"

SnatchCashFromPlayer :- Snatches cash from the targetid and gives all his money to playerid.
i.e. who snatched it.

SetSkinForAll :- Sets skin for each and every player connected to the server.

FreezePlayer :- Freezes the targetid. Return 1 if connected ,if not Returns 0. (new)

UnFreezePlayer :- Un-freezes the targetid. Return 1 if connected ,if not Returns 0.(new)

FreezeAll :- Freezes all the players connected except the playerid who used this function.(new)

UnFreezeAll :- Un-freezes all. (new)



--------------------------------------------------------------------------------


Syntax:-

AddAllClass(Float:x, Float:y, Float:z, Float:Angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);

ClassCamSet(playerid,Float:camx,Float:camy,Float:c amz,Float:fAngle,Float:lookx,Float:looky,Float:loo kz);

SnatchCashFromPlayer(playerid, targetid);

SetSkinForAll(skinid);

FreezePlayer(targetid);

UnFreezePlayer(targetid);

FreezeAll(playerid);

UnFreezeAll();







rit_range:

Introduction


This include contains functions related to Range, there are some very "useful" for "RolePlay"
servers. Video of SetRangeSkin -->

SendRangeMessageToPlayer :- This function sends message to a player present within
a specified range.

SendRangeMessageToAll :- This function sends message to all players present within
a specified range.

GivePlayerRangeWeapon :- Gives weapon to player present within a specified range.

RangeKill :- Kills the player present with a specified range.

RangeKick :- Kicks the player who enters a specified range.

SetRangeSkin :- Sets the skin of a who enter that range.
"Skin is settable" I have a video of it, look above.

AntiVehicleRange :- Creates an "anti-vehicle" range i.e. no one can enter that range with
a vehicle.

RangeTeleport :- Teleports all players who are present within a specified "range" from
"playerid".

AntiWeaponRange :- Creates an "anti-weapon" range i.e. if player enters that range he/she will
not be able to use weapon. (new)

TeleportationPortal :- Creates a "range portal" which is capable teleporting players from one place to another.
As soon as player step inside that specified range they get teleported to a specified position.(new)



--------------------------------------------------------------------------------


Syntax:-

SendRangeMessageToPlayer(playerid, Float:Range, Float:x, Float:y, Float:z, color, text[]);

SendRangeMessageToAll(Float:Range, Float:x, Float:y, Float:z, color, text[]);

GivePlayerRangeWeapon(playerid, weaponid,ammo, Float:Range, Float:x, Float:y, Float:z);

RangeKill(playerid, Float:Range, Float:x, Float:y, Float:z);

RangeKick(playerid, Float:Range, Float:x, Float:y, Float:z);

SetRangeSkin(playerid, skinid, Float:Range, Float:x, Float:y, Float:z);

AntiVehicleRange(playerid, Float:Range, Float:x, Float:y, Float:z);

RangeTeleport(playerid, Float:Range, Float:dx,Float:dy,Float:dz);

AntiWeaponRange(playerid, Float:Range, Float:x, Float:y, Float:z);

TeleportationPortal(playerid,Float:Range,Float:x,F loat:y,Float:z,Float:dx,Float:dy,:Float:dz,virtual ,interior);










rit_teles:

Introduction


This include contains functions related to player teleporation, which simplifies your
work in a much better way, you can easily make teleport players from one place to another.

TeleportAllForEvent :- With this function you can teleport all players to a specific position
present in your server."Special" thing about this function is you can set
"weapon allowance" with function and "Players won't get stuck with each other".
WeaponAllowance :

True: Players spawn at event with weapons.
False: Players spawn at event without weapons.

DuetTeleport :- This function teleports 2 players to a specific position.
Player itself and his "partner1".

TripletTeleport :- This function teleports 3 players to a specific position.
Player itself , his "partner1" and "partner2".

GroupTeleport :- This function teleports a "chunk" of player to a specified position
present within a range of "15.0" from the playerid.

DueDive :- Same as "DuetTeleport" just makes you skydive with your "partnet1".
"Height is settable". Automatically provides "Parachute" to players.

TripletDive :- Same as "TripletTeleport" just makes you skydive with your "partnet1" and "partner2".
"Height is settable" Automatically provides "Parachute" to players.

GroupDive :- This is one of my "favorite" functions, this function makes all the players skydive present within
a specified range. Automatically provides "Parachute" to players.
"Height is settable"
Range "is settable".

GoTo :- Teleports target to a player."Can be also used as GetHere command".


--------------------------------------------------------------------------------


Syntax:-

TeleportAllForEvent(Float:x, Float:y, Float:z, virtualworld, interior, bool:weaponallowance);

DuetTeleport(playerid, partnerid, Float:x, Float:y, Float:z, virtualworld, interior);

TripletTeleport(playerid, partnerid1, partnerid2, Float:x, Float:y, Float:z, virtualworld, interior);

GroupTeleport(playerid, Float:x, Float:y, Float:z, virtualworld, interior);

DuetDive(playerid, partnerid, Float:height);

TripletDive(playerid, partnerid1, partnerid2, Float:height);

GroupDive(playerid,Float:Range, Float:height);

GoTo(playerid,targetid);










rit_weap:

Introduction


This include contains functions related to player weapons, which simplifies your
work in a much better way.

GivePlayerWeapons :- Gives player 5 weapons "together".

SetPlayerWeapon :- Gives player a specified weapon and Removes all "other weapons" .Good for "DeathMatches".

SetPlayerWeapons :- Gives player "5"(FIVE) specified weapons and Removes all "other weapons" .Best for "DeathMatches".

SnatchWeaponFromTarget :- Snatches a weapon from a target holding a specified weapon , and gives the weapon to player who
snatched it i.e. "playerid".

SetAllSkill :- Sets all type of weapon skills to a player.


Functions You Know About :-

GiveBrassKnucle
GiveGolfClub
GiveNightStick
GiveKnife
GiveBat
GiveShovel
GivePoolCue
GiveKatana
GiveChainsaw
GiveDildo
GiveDildo2
GiveVibrator
GiveVibrator2
GiveFlower
GiveCane
GiveGrenade
GiveTearGas
GiveMolotov
GiveColt45
GiveSilenced
GiveDeagle
GiveShotgun
GiveSawn
GiveCombat
GiveUzi
GiveMP5
GiveAK47
GiveM4
GiveTec9
GiveRifle
GiveSniper
GiveRPG
GiveFlameThrower
GiveMini
GiveSprayCan
GiveFireExt
GiveCamera
GivePara






--------------------------------------------------------------------------------


Syntax:-

GivePlayerWeapons(playerid, weaponid1, ammo1,weaponid2, ammo2,weaponid3, ammo3,weaponid4, ammo4,weaponid5, ammo5)

SetPlayerWeapon(playerid,weaponid,ammo)

SetPlayerWeapons(playerid, weaponid1, ammo1,weaponid2, ammo2,weaponid3, ammo3,weaponid4, ammo4,weaponid5, ammo5)

SnatchWeaponFromTarget(playerid, targetid)

SettAllSkill(playerid ,level)

GiveBrassKnucle(playerid)
GiveGolfClub(playerid)
GiveNightStick(playerid)
GiveKnife(playerid)
GiveBat(playerid)
GiveShovel(playerid)
GivePoolCue(playerid)
GiveKatana(playerid)
GiveChainsaw(playerid)
GiveDildo(playerid)
GiveDildo2(playerid)
GiveVibrator(playerid)
GiveVibrator2(playerid)
GiveFlower(playerid)
GiveCane(playerid)
GiveGrenade(playerid, ammo)
GiveTearGas(playerid, ammo)
GiveMolotov(playerid , ammo)
GiveColt45(playerid, ammo)
GiveSilenced(playerid, ammo)
GiveDeagle(playerid, ammo)
GiveShotgun(playerid, ammo)
GiveSawn(playerid, ammo)
GiveCombat(playerid, ammo)
GiveUzi(playerid, ammo)
GiveMP5(playerid, ammo)
GiveAK47(playerid, ammo)
GiveM4(playerid, ammo)
GiveTec9(playerid, ammo)
GiveRifle(playerid, ammo)
GiveSniper(playerid, ammo)
GiveRPG(playerid, ammo)
GiveFlameThrower(playerid)
GiveMini(playerid, ammo)
GiveSprayCan(playerid)
GiveFireExt(playerid)
GiveCamera(playerid, ammo)
GivePara(playerid)




Credits:

Sa-Mp Team



GitHub:

RIT - GitHub



Download:

RIT.zip
Reply
#2

Nice !
can be useful
Reply
#3

You certainly didn't do you homework when you wrote these functions. But hey at least you put something out there just fix your velocity calculation.

pawn Code:
GetPlayerSpeed(playerid);
GetVehicleSpeed(playerid);
Reply
#4

Quote:
Originally Posted by [uL]Pottus
View Post
You certainly didn't do you homework when you wrote these functions. But hey at least you put something out there just fix your velocity calculation.

pawn Code:
GetPlayerSpeed(playerid);
GetVehicleSpeed(playerid);
I guess it's just fine.
Reply
#5

These are useful includes, and I will be using some of them once I need to. Other than that, thanks for notifying people not to compare this with YSI, or you would had been having spammed messages .

Great work tho!
Reply
#6

Quote:
Originally Posted by Rittik
View Post
I guess it's just fine.
Not when the calculations are not even close to accurate at all.
Reply
#7

Quote:
Originally Posted by [uL]Pottus
View Post
Not when the calculations are not even close to accurate at all.
Magic numbers cannot be accurate at all, they are just derivations of speed in real life compared to in game vehicles.
Reply
#8

It is great.! Thanks!
Reply
#9

Updated (7/16/2014)
Reply
#10

TeleportationPortal video


Reply
#11

Quote:
Originally Posted by Rittik
View Post
Magic numbers cannot be accurate at all, they are just derivations of speed in real life compared to in game vehicles.
Thats why you set default magic number to 0 and leave users to set their own without editing include

stock GetVehicleSpeed(vehicleid, Float:magicno = 0)


Well its one of the most useful and useless includes i have seen so far...
Also you made function for each weapon to give it to player. I dont see how it can be useful as you simply can declare weapon name and its id.That way no need for all that functions and you still have more flexibility.

By the way GitHub is for hosting code not just readme.md


But i must say respect for making something of your own and not just ripping someones work and claiming it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)