28.06.2014, 14:17
(
Последний раз редактировалось Rittik; 09.07.2014 в 13:30.
Причина: Update v3.R
)
rFunctions© 3.R
Introduction
In this include there are total 66 (updated 3.R) functions, which you can use while scripting roleplay/freeroam/party or any other kind of server.Let us proceed with the functions below.
Functions
SendRangeMessageToPlayer(playerid, Float:Range, Float:x, Float:y, Float:z, color, text[])
This function will send a message to the player who is within the specified range.
SendRangeMessageToAll(Float:Range, Float:x, Float:y, Float:z, color, text[])
This function will send messages to all player who are present within the specified range.
GivePlayerRangeWeapon(playerid, weaponid,ammo, Float:Range, Float:x, Float:y, Float:z)
This function gives a weapon to a player who is within a specified range.
RangeKick(playerid, Float:Range, Float:x, Float:y, Float:z)
This function kicks the players who enters a specified area.
RangeKill(playerid, Float:Range, Float:x, Float:y, Float:z)
This function prevents the player from entering a specified range/area.
TeleportAllForEvent(Float:x, Float:y, Float:z, virtualworld, interior, bool:weaponallowance)
This functions teleports each and every connected player to a specified position and the weaponallowance boolean parameter is to disable and enable player weapon when they spawn to that position.
true = enable
false = disable
DuetTeleport(playerid, partnerid, Float:x, Float:y, Float:z)
This function teleports 2 players together to a position.There is a special feature in this function that, they will not get a spawn collapse bug, which means all players will not get stuck into each other.
TripletTeleport(playerid, partnerid1, partnerid2, Float:x, Float:y, Float:z, virtualworld, interior)
Same as above function, just teleports 3 players instead of 2.
GroupTeleport(playerid, Float:x, Float:y, Float:z,virtualworld, interior)
This function lets you and your friends teleport together, but your friends should be present within 15.0 range from you. No spawn collapse bug here too.
GetPlayerHeightDifference(playerid, heightid);
This function will let you know the height difference between you and any other player who is at position higher than you.Returns a float value.
GivePlayerWeapons(playerid, weaponid1, ammo1,weaponid2, ammo2,weaponid3, ammo3,weaponid4, ammo4,weaponid5, ammo5)
This funtion is used to give 5 weapons together to a player.
SetPlayerWeapon(playerid,weaponid,ammo)
This function removes all the weapons and gives you a weapon according to your wish.
SetPlayerWeapons(playerid, weaponid1, ammo1,weaponid2, ammo2,weaponid3, ammo3,weaponid4, ammo4,weaponid5, ammo5)
This function removes all the weapons and gives you 5 weapons according to your choice.This function is very beneficial for DeathMatches as it removes all the weapons and gives you specified weapons.
GetPlayerHealthDifference(playerid)
This function gets the amount of health loss from the actual health i.e. 100.0. Return loss of health as a float value.
FullFillPlayerHealth(playerid)
This function full fills the amount of health loss.Good for Roleplay scripter.(Hospital)
Update 2.R (6/30/2014)
Added some weapon functions, skydiving functions and co-ordinates functions.
Weapons
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)
Skydiving
DuetDive(playerid, partnerid, Float:height)
This function is used for 2 player skydive,you can set the height.
TripletDive(playerid, partnerid1, partnerid2, Float:height)
This function is used for 3 player skydive,you can set the height.
GroupDive(playerid,Float:Range, Float:height)
I made filterscript on this before, but now it's a function.This function checks the player present in a range specified by you in the "Range" parameter,you can set the height.
Co-ordinates
GetX(playerid)
Return the value of "X" co-ordinate.
GetY(playerid)
Return the value of "Y" co-ordinate.
GetZ(playerid)
Return the value of "Z" co-ordinate.
Update 3.R (7/8/2014)
Added 5 new useful functions and enhanced few teleport functions by adding virtualworld parameter and interior parameter.
SetRangeSkin(playerid, skinid, Float:Range, Float:x, Float:y, Float:z)
Sets the skin of the player who enters a specified position.
In the video below, the function is called under OnPlayerUpdate. This video demonstrates that as soon as we enter a specified range our skin gets changed to a specified skin.
https://www.youtube.com/watch?v=ZnbOyGN9bz4
AntiVehicleRange(playerid, Float:Range, Float:x, Float:y, Float:z)
This function does not let a player enter a specified range with a vehicle.
SetAllSkill(playerid, level)
Sets all type of weapon skills of a player.You must specify skill level between 0-999.
EnableGod(playerid)
Gives player god mode.
DisableGod(playerid)
Removes god mode.
SnatchWeaponFromTarget(playerid, targetid) (Special)
Disarms the targetid holding a specific weapon and arms the playerid with that weapon.
Note: Ammo will not get changed while snatching i.e. if the target has 15 ammo and you snatched that weapon from him, the ammo will remain 15 after snatching.
Total Include Functions
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)
RangeKick(playerid, Float:Range, Float:x, Float:y, Float:z)
RangeKill(playerid, Float:Range, Float:x, Float:y, Float:z)
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)
GetPlayerHeightDifference(playerid, heightid);
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)
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)
GetPlayerHealthDifference(playerid)
FullFillPlayerHealth(playerid)
DuetDive(playerid, partnerid, Float:height)
TripletDive(playerid, partnerid1, partnerid2, Float:height)
GroupDive(playerid,Float:Range, Float:height)
GetX(playerid)
GetY(playerid)
GetZ(playerid)
SetRangeSkin(playerid, skinid, Float:Range, Float:x, Float:y, Float:z)
AntiVehicleRange(playerid, Float:Range, Float:x, Float:y, Float:z)
SetAllSkill(playerid,level)
EnableGod(playerid)
DisableGod(playerid)
SnatchWeaponFromTarget(playerid, targetid) (Special)
Version
Version 3.R
GitHub
GitHub- rFunctions
Download
rFunc.inc v1.R
rFunc2.inc v2.R
rFunc3.inc v3.R
Note: I'll suggest you to use v3.R as it is more enhanced than the previous versions.