[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
#2

Very usefull !!
I will use it !
Thanks !
Reply
#3

Quote:
Originally Posted by XDamienX007
Посмотреть сообщение
Very usefull !!
I will use it !
Thanks !
Do not forget to read the README.txt first.
Reply
#4

Useful though. Thanks for sharing. +rep
Reply
#5

c_crypto

Deleted from the CRF.
Reply
#6

You can get awarded a degree without schooling? What the hell.
Reply
#7

Quote:
Originally Posted by ******
Посмотреть сообщение
DO NOT try and write your own password hashes. The standard ones have literally YEARS of mathematical analysis behind them to show their strength, and are developed by experts. Knocking one up in 10 minutes gives the impression of being secure with none of the proof. If it was that simple to write secure hashes, they wouldn't be so far and far between. People get awarded doctorates for making new ones!
It is just an extension for CRF, actually it depends on the people if they really want to use it or not.

Note: Added sample hash, In the above post.
Reply
#8

@******: Do not take it in an offensive manner, but I would like to say that I have an idea of cryptography. Even "whirpool" is not secure, it can be cracked by brute force attack, in my opinion.
Even my algorithms can be cracked through brute force attack. None of the hashes are secure. Cracking algorithms through brute force attack may take some time, but it can be surely cracked.

Can you please list down the people to whom you had given infractions regarding hashes ?
Reply
#9

It's not bad to see how hashing works, but adapting to renowned hashing algorithms would be more ideal. I could only see these functions being used for minor additions (secret keys?).

Anyhow, you gotta start somewhere or you'll end up nowhere Nice job anyway.
Reply
#10

@Lorenc_: MD5,LM, NTLM,SHA1, MYSQL5, etc. are very much crackable. Popular algorithms gets decrypted easily.

Q. Why Popular algorithms gets decrypted easily ?

A. Because they are popular.


Creating an unpopular algorithm will be more secure in this sense.


Anyway, thank you.
Reply
#11

Okay, as you say sir.

Bye c_crypto, will miss you.
Reply
#12

Add this in utils functions:

pawn Код:
#define GetVehicleMaxSpeed(%1) (max_vehicle_speed(%1)-400)
// modelid.

static const Float:max_vehicle_speed[][]  =
{
    {....},.....
};

Btw well done +4
Reply
#13

Thank you for you suggestion, if you have some more ideas please do share it.

By the way... why -(minus)400 ?
pawn Код:
#define GetVehicleMaxSpeed(%1) (max_vehicle_speed(%1)-400)
// modelid.

static const Float:max_vehicle_speed[][]  =
{
    {....},.....
};
Reply
#14

Quote:
Originally Posted by codectile
Посмотреть сообщение
Thank you for you suggestion, if you have some more ideas please do share it.

By the way... why -(minus)400 ?
pawn Код:
#define GetVehicleMaxSpeed(%1) (max_vehicle_speed(%1)-400)
// modelid.

static const Float:max_vehicle_speed[][]  =
{
    {....},.....
};
Because the model ids are starting from 400 and that's why he used a negative sign there. Using it like GetVehicleMaxSpeed(VEHICLE_ID_HYDRA) would be like : 520-400 and return it's max_speed from the array. (In case if it's ordered properly)
Reply
#15

Update 1



Updated Libraries:
Код:
• c_arlib: 
              • SwapElement(Array[],element1,element2)
              • ElementPos(Array[],element)


• c_rclib:
              • SumFirstLast(value)


• c_utils: 
              • IsPlayerInRangeBetweenPlayers(targetid,playerid1,playerid2)
IsPlayerInRangeBetweenPlayers Implementation

Note: Please go through the README.txt at least once. A detailed description is provided in it.


Download links are updated.
Reply
#16

Update 2

Addition of a new library, c_stclib.

Updated Libraries:


Код:
c_rclib:
          • NumberLength(value)
          • Pow(value,pow) //something is special about it. Go through README.txt.
          • MiddleDigit(value)


c_utils:
          • 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
          • AddGravityPoint(playerid,addby)//YSF
          • SetDistanceFromPoint(playerid,Float:distance,Float:x,Float:y,Float:z)
• CreatePlayerRangeGravity(playerid,Float:Range,Floa t:x,Float:y,Float:z,Float:gravity,vw=0) //YSF
• CreateRangeGravityForAll(Float:Range,Float:x,Float :y,Float:z,Float:gravity,vw=0)//YSF

These two functions should be under OnPlayerUpdate(playerid)


Note: Please go through the README.txt at least once. A detailed description is provided in it.



Download Links are updated.
Reply
#17

SEXY! Thanks for it!
Reply
#18

Update 4


Update Libraries:

Код:
• c_strlib:  
                • FindChar(string[],tofind[])


• c_utils:
                • GetBulletShotDistance(playerid)


• c_cblib:
                • OnPlayerConnectWithRolePlayName(playerid)
Note: Please go through the README.txt at least once. A detailed description is provided in it.

Download link updated.
Reply
#19

UPDATE

Added to Github repository.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)