CFC E2 Library

Array

Syntax Returns Description
R:difference(R) R Returns an array filled with the differing elements between the calling and argument arrays.
R:reversed() R Returns a reversed array.
R:shuffled() R Returns a randomly shuffled version of an array.
R:intersection(R) R Returns an array filled with the similar elements between the calling and argument arrays.
R:sub(N, N) R Returns an array representing the subset between indexes N1 and N2.
R:sub(N) R Returns an array representing the subset between index n1 and the end of the array.
R:indexOf(E|N|S|V|V2|V4) N Returns the first index at which the value is stored in the array, 0 if it was not found.

Entity

Syntax Returns Description
E:getPvpStatus() S Returns "pvp", "build", or ""
E:playerIsInBuild() N Returns 1 if a player is in Build, 0 otherwise.
E:playerIsInPvp() N Returns 1 if a player is in Pvp, 0 otherwise.
E:ejectPodTo(V) Ejects driver of seat to desired location.
E:getSimfphysHorsepower() N Returns the horsepower of a simfphys vehicle.

String

Syntax Returns Description
S:startsWith(S) N Returns 1 if the string on which it was called starts with the given string, 0 otherwise.
S:isNumber() N Returns 1 if string is a number, 0 otherwise.
S:isLetters() N Returns 1 if string provided is letters and spaces, 0 otherwise.
S:hasNumber() N Returns 1 if string contains numbers, 0 otherwise.
S:hasLetter() N Returns 1 if string has letters, 0 otherwise.
S:isUpper() N Returns 1 if string is uppercase, 0 otherwise.
S:isLower() N Returns 1 if string is lowercase, 0 otherwise.

Helper functions

Syntax Returns Description
averagePing() N Returns a floating-point number representing the average ping of all players in the server.
minPing() N Returns a floating-point number representing the lowest ping of all players in the server.
maxPing() N Returns a floating-point number representing the highest ping of all players in the server.
averageLoss() N Returns a floating-point number representing the average packet loss of all players in the server.
minLoss() N Returns a floating-point number representing the lowest packet loss of all players in the server.
maxLoss() N Returns a floating-point number representing the highest packet loss of all players in the server.
getBuilders() R Returns an array of all players currently in Build mode.
getPvpers() R Returns an array of all players currently in Pvp mode.
getAlive() R Returns an array of all players that are alive.
getDead() R Returns an array of all players that are dead.