[Include] CRF Library
#1

CRF Library







Introduction

This is a third party library for pawn/sa-mp, this consists of seven(7) (will be updating with more libraries) main libraries. These libraries will give you freedom of utilizing it in any way you want it to, CRF libraries will provide many useful function to the pawn scripters.








Libraries


• c_arlib: Array element sorting and searching library.

• c_rclib: Recreational mathematics library.

• c_strlib: String manipulation library.

• c_utils: Misc. library, contains function which can be very useful.

• c_stclib: Player State Checkers with some add-on functions.

• c_cblib: Callbacks

• crf: All in one library, contains all main libraries.








Updates

Update 1

Update 2

Update 3

Update 4








Function List

pawn Код:
c_arlib:
  • BubbleSort(array[],length,bool:AscOrDes)
  • SelectionSort(array[],length,bool:AscOrDes)
  • InsertionSort(array[],length,bool:AscOrDes)
  • quickSortAsc(array[],left,right)
  • quickSortDes(array[],left,right)
  • LinearSearch(array[],length,ToSearch)
  • BinarySearch(array[],length,ToSearch)
  • SwapElement(Array,element1,element2)
  • ElementPos(Array[],element)


c_rclib:
  • IsArmstrong(value)
  • IsNeon(value)
  • IsPerfect(value)
  • IsPrime(value)
  • IsMagic(value)
  • IsEvenOrOdd(value)
  • MaxDigit(value)
  • MinDigit(value)
  • DigitFreq(value)
  • Truncate(Float:value)
  • ToPositive(Float:value)
  • ToNegitive(Float:value)
  • Calculate(Float:number1,Float:number2,choice)
  • SumFirstLast(value)
  • NumberLength(value)
  • Pow(value,pow)
  • MiddleDigit(value)

c_strlib:
 • isPalindrome(input[])
 • isDigit(character[])
 • isLetter(character[])
 • isSpace(character[])
 • isUnderscore(character[])
 • isSpecial(character[])
 • isAnagram(string1[],string2[])
 • isUpperCase(character[])
 • isLowerCase(character[])
 • isNumeric(string[])
 • isAlphaNumeric(string[])
 • ToPalindrome(input[])
 • toUpperCase(string[])
 • toLowerCase(string[])
 • Find(haystack[],needle[],bool:Case)
 • Frequency(string[],character[])
 • WordFreq(string[],word[],bool:Case)
 • Equals(string1[],string2[])
 • ExtNum(string[])
 • ExtStr(string[])
 • Reverse(string[])
 • ReplaceChar(string[],character[],replacewith[])
 • FirstIndexOf(string[],character[])
 • LastIndexOf(string[],character[])
 • Compare(string1[],string2[])
 • Concat(string1[],string2[])
 • Substring(string[],firstindex,lastindex)
 • null(string[])
 • CharAt(string[],index)
 • StringDel(string[],fromindex,toindex)
 • FindChar(string[],tofind[])



c_utils:
 • PingKick(playerid,Amount)
 • AddHydraulic(vehicleid)
 • AddNitro(vehicleid,Amount)
 • EnableRangeSuntBonus(playerid,Float:Range,Float:x,Float:y,Float:z,bool:enable)
 • EnableRangeSuntBonusForAll(playerid,Float:Range,Float:x,Float:y,Float:z,bool:enable)
 • PlayerToClass(playerid) //Forces player to class selection.
 • GetDistanceBetweenObjects(objectid1,objectid2)
 • GetDistanceBetweenPO(playerid,objectid)  //Returns the distance between a player and an object.
 • GetDistanceBetweenPV(playerid,vehicleid) //Returns the distance between a player and a vehicle.
 • GetDistanceBetweenPlayers(playerid,targetid)
 • GetDistanceBetweenVehicles(vehicleid1,vehicleid2)
 • IsTargetInRangeBetweenPlayers(targetid,playerid1,playerid2)
 • CreatePlayerRangeGravity(playerid,Float:Range,Float:x,Float:y,Float:z,Float:gravity,vw=0) //YSF
 • SetGravityForAll(Float:gravity) //YSF
 • CreateRangeGravityForAll(Float:Range,Float:x,Float:y,Float:z,Float:gravity,vw=0)//YSF
 • IncreaseGravity(playerid,increaseby)//YSF
 • GetBulletShotDistance(playerid)




c_stclib:

   State Checkers:

   * IsPlayerFalling(playerid)
   * IsPlayerRunning(playerid)
   * IsPlayerCrouching(playerid)
   * IsPlayerInWater(playerid)
   * IsPlayerSwimming(playerid)
   * IsPlayerJumping(playerid)
   * IsPlayerEnteringInterior(playerid)
   * IsPlayerStanding(playerid)
   * IsPlayerClimbing(playerid)
   * IsPlayerMovingWhileAiming(playerid)
   * IsPlayerGettingUp(playerid)
   * IsPlayerPissing(playerid)
   * IsPlayerUsingJP(playerid)
   * IsPlayerGettingInitialised(playerid)
   * IsPlayerSelectingClass(playerid)
   * IsPlayerDriver(playerid)
   * IsPlayerPassenger(playerid)
   * IsPlayerSpectating(playerid)
   * IsPlayerInAir(playerid)
   * IsPlayerGliding(playerid)
   * IsPlayerOpeningCarDoor(playerid)
   * IsPlayerOpeningTruckDoor(playerid)
   * IsPlayerBlocking(playerid)


    Functions:

    * GetPlayerParaState(playerid)
    * GetBikeEnteringStyle(playerid)
    * GetCarEnteringStyle(playerid)
    * KicForOffensiveWeapon(offensive_weapon,targetid)


CallBacks:

  • OnPlayerSkydiving(playerid)
  • OnPlayerFall(playerid)
  • OnPlayerMovingWhileAiming(playerid)
  • OnPlayerSwim(playerid)
  • OnPlayerBlock(playerid)
  • OnPlayerStandIdle(playerid)
  • OnPlayerAmmoZero(playerid) //Mind the melee weapons
  • OnPlayerJump(playerid)
  • OnPlayerCrouch(playerid)
  • OnPlayerUseJetpack(playerid)
  • OnPlayerConnectWithRolePlayName(playerid);
Note: A detailed description is provided in the README.txt.





Include Guide

Extract the "CRF" folder to "\pawno\includes".

Including libraries:
pawn Код:
#include <CRF\include name> //Mind the slash.






Bugs

If you find any bug please report it in this thread.








Credits

• Sa-Mp Team








Download

******Drive
Reply


Messages In This Thread
CRF Library - by codectile - 04.08.2014, 15:05
Re : CRF Library - by XDamienX007 - 04.08.2014, 16:31
Re: Re : CRF Library - by codectile - 04.08.2014, 16:33
Re: CRF Library - by SanAndreasMP - 04.08.2014, 16:38
Re: CRF Library - by codectile - 06.08.2014, 16:42
Re: CRF Library - by SkittlesAreFalling - 07.08.2014, 00:06
Re: CRF Library - by codectile - 07.08.2014, 05:56
Re: CRF Library - by codectile - 07.08.2014, 06:18
Re: CRF Library - by Lorenc_ - 07.08.2014, 06:37
Re: CRF Library - by codectile - 07.08.2014, 06:49
Re: CRF Library - by codectile - 07.08.2014, 07:01
Respuesta: CRF Library - by Swedky - 07.08.2014, 15:18
Re: Respuesta: CRF Library - by codectile - 07.08.2014, 15:24
Re: Respuesta: CRF Library - by Lordzy - 07.08.2014, 15:28
Re: CRF Library - by codectile - 08.08.2014, 16:03
Re: CRF Library - by codectile - 12.08.2014, 15:56
Respuesta: CRF Library - by LuisR - 13.08.2014, 02:08
Re: CRF Library - by codectile - 17.08.2014, 12:30
Re: CRF Library - by codectile - 15.01.2015, 10:56

Forum Jump:


Users browsing this thread: 2 Guest(s)