Wiki

Clone wiki

0.4 Squirrel / Functions

Table of Contents


Data Structures

Bounds

  • Bounds( maxX, minX, maxY, minY )
  • Bounds
    • .maxX float
    • .minX float
    • .maxY float
    • .minY float

cRGB (Colour)

  • cRGB( R, G, B )
  • cRGB
    • .R int 0-255
    • .G int 0-255
    • .B int 0-255

Quaternion

  • Quaternion( X, Y, Z, W )
  • Quaternion
    • .X float
    • .Y float
    • .Z float
    • .W float

Vector

  • Vector( X, Y, Z )
  • Vector
    • .X float
    • .Y float
    • .Z float

WastedSettings

  • WastedSettings( DeathTime, FadeTime, FadeInSpeed, FadeOutSpeed, FadeColour, CorpseFadeDelay, CorpseFadeTime )
  • WastedSettings
    • .DeathTime int
    • .FadeTime int
    • .FadeInSpeed float
    • .FadeOutSpeed float
    • .FadeColour cRGB
    • .CorpseFadeDelay int
    • .CorpseFadeTime int

Functions and Entities

Messages

  • void Message( string message )
  • void MessagePlayer( string message, Player player )
  • void MessageAllExcept( string message, Player player )
  • void PrivMessage( Player player, string message )
  • void PrivMessageAll( string message )
  • void SendPlayerMessage( Player playerToFake, Player playerTo, string message )
  • void ClientMessage( string message, Player player, int r, int g, int b, int a = 255 )
  • void ClientMessageToAll( string message, int r, int g, int b, int a = 255 )
  • void GameMessage( Player player, string message, int type = 0 )
  • void GameMessageToAll( string message, int type = 0 )

Server Settings

  • void ReloadScripts()
  • void SetServerName( string message )
  • void SetMaxPlayers( int newMaxPlayers )
  • void SetServerPassword( string password )
  • void SetGameModeText( string gamemodeName )
  • void SetTimeRate( int timeRate )
  • void SetHour( int hour )
  • void SetMinute( int minute )
  • void SetTime( int hour, int minute )
  • void SetWeather( int weather )
  • void SetGravity( float gravity )
  • void SetGamespeed( float speed )
  • void SetWaterLevel( float waterLevel )
  • void SetMaxHeight( float maxHeight )
  • string GetServerName ()
  • int GetMaxPlayers ()
  • string GetServerPassword ()
  • string GetGameModeText ()
  • int GetTimeRate ()
  • int GetHour ()
  • int GetMinute ()
  • int GetWeather()
  • float GetGravity()
  • float GetGamespeed()
  • float GetWaterLevel ()
  • float GetMaxHeight()
  • int GetTickCount()
  • void ToggleSyncFrameLimiter( bool toggle )
  • void ToggleFrameLimiter( bool toggle )
  • void ToggleTaxiBoostJump( bool toggle )
  • void ToggleDriveOnWater( bool toggle )
  • void ToggleFastSwitch( bool toggle )
  • void ToggleFriendlyFire( bool toggle )
  • void ToggleDisableDriveby( bool toggle )
  • void TogglePerfectHandling( bool toggle )
  • void ToggleFlyingCars( bool toggle )
  • void ToggleJumpSwitch( bool toggle )
  • void ToggleShowOnRadar( bool toggle )
  • void ToggleStuntBike( bool toggle )
  • void ToggleShootInAir( bool toggle )
  • void ToggleShowNametags( bool toggle )
  • void ToggleJoinMessages( bool toggle )
  • void ToggleDeathMessages( bool toggle )
  • bool EnabledSyncFrameLimiter ()
  • bool EnabledFrameLimiter ()
  • bool EnabledTaxiBoostJump()
  • bool EnabledDriveOnWater ()
  • bool EnabledFastSwitch ()
  • bool EnabledFriendlyFire ()
  • bool EnabledDisableDriveby ()
  • bool EnabledPerfectHandling()
  • bool EnabledFlyingCars ()
  • bool EnabledJumpSwitch ()
  • bool EnabledShowOnRadar()
  • bool EnabledStuntBike()
  • bool EnabledShootInAir ()
  • bool EnabledShowNametags ()
  • bool EnabledJoinMessages ()
  • bool EnabledDeathMessages()

Game Functions

  • void CreateExplosion( int world, int type, Vector pos, int playerCaused, bool onGround )
  • void PlayGameSound( int player, int sound, Vector pos )
  • void SetWorldBounds( float maxX, float minX, float maxY, float minY )
  • Bounds GetWorldBounds ()
  • string GetWeaponName( int weaponID )
  • string GetDistrictName( float x, float y )
  • string GetSkinName( int skinID )
  • int GetWeaponID( string name )
  • bool InPoly( float x, float y, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4 )
  • float DistanceFromPoint( float x1, float y1, float x2, float y2 )
  • int GetVehicleModelFromName( string name )
  • stringGetVehicleNameFromModel( int model )

Spawn and Wasted Screen Functions

  • void SetUseClasses( bool toUse )
  • bool UsingClasses()
  • void AddClass( int team, cRGB colour, int skin, Vector spawnPos, float spawnAngle, int wep1, int ammo1, int wep2, int ammo2, int wep3, int ammo3 )
  • void SetSpawnPlayerPos( Vector pos )
  • void SetSpawnCameraPos( Vector pos )
  • void SetSpawnCameraLook( Vector pos )
  • void SetWastedSettings( int deathTime, int fadeTime, float fadeInSpeed, float fadeOutSpeed, cRGB colour, int corpseFadeDelay, int corpseFadeTime )
  • WastedSettings GetWastedSettings ()

Administrative Functions

  • void BanIP( string ip )
  • void UnbanIP( string ip )
  • bool IsIPBanned( string ip )

Player Functions

  • Player FindPlayer( int id )
  • int GetPlayerIDFromName( string name )
  • bool IsWorldCompatibleWithPlayer( Player player, int world )
  • void KickPlayer( Player player )
  • void BanPlayer( Player player )

Player Entity

  • Player
    • .AddSpeed( Vector speed )
    • .Admin
    • .Alpha (read-only)
    • .Ammo (read-only)
    • .Angle
    • .Armour
    • .Ban()
    • .CameraLocked (read-only)
    • .CanAttack
    • .CanDriveby
    • .Cash
    • .Class (read-only)
    • .Colour
    • .Disarm()
    • .Eject()
    • .Frozen
    • .GetAmmoAtSlot( int weaponSlot )
    • .GetWeaponAtSlot( int weaponSlot )
    • .GiveMoney( int money )
    • .GiveWeapon( int weapon, int ammo )
    • .GreenScanlines
    • .Health
    • .ID (read-only)
    • .Immunity
    • .IP (read-only)
    • .IsOnRadar
    • .IsSpawned (read-only)
    • .Key (read-only)
    • .Kick()
    • .Name (read-only)
    • .Ping (read-only)
    • .Pos
    • .RestoreCamera()
    • .RemoveWeapon( int weapon )
    • .Score
    • .SecWorld
    • .Select()
    • .SetAlpha( int alpha, int fadeTime )
    • .SetAnim( int animationID )
    • .SetCameraPos( Vector pos, Vector lookAt )
    • .SetInterior( int interior )
    • .SetWantedLevel( int wantedLevel )
    • .SetWeapon( int weapon, int ammo )
    • .ShowMarkers
    • .Slot
    • .Skin
    • .Spawn()
    • .StandingOnObject (read-only)
    • .StandingOnVehicle (read-only)
    • .State (read-only)
    • .StreamedToPlayer( Player pStreamer )
    • .Typing (read-only)
    • .Team
    • .UniqueWorld (read-only)
    • .Vehicle
    • .Weapon (read-only)
    • .WhiteScanlines
    • .Widescreen
    • .World

Player Game Functions

These functions exist for compatibility with the R2 Squirrel server.

  • bool GetCinematicBorder( Player player )
  • bool GetGreenScanLines( Player player )
  • bool GetWhiteScanLines( Player player )
  • void SetCinematicBorder( Player player, bool toEnable )
  • void SetGreenScanLines( Player player, bool toEnable )
  • void SetWhiteScanLines( Player player, bool toEnable )

Vehicle Functions

  • Vehicle CreateVehicle( int model, int world, Vector pos, float angle, int col1, int col2 )
  • Vehicle FindVehicle( int id )
  • void ResetAllVehicleHandling ()
  • bool IsHandlingRuleSet( int model, int rule )
  • void SetHandlingRule( int model, int rule, float value )
  • float GetHandlingRule( int model, int rule )
  • void ResetHandlingRule( int model, int rule )
  • void ResetVehicleHandling( int model )

Vehicle Entity Functions

  • Vehicle
    • .Alarm
    • .Angle
    • .Colour1
    • .Colour2
    • .Damage
    • .Delete()
    • .Driver (read-only)
    • .GetHandlingData( int rule )
    • .GetOccupant( int seatID )
    • .GetPart( int partID )
    • .GetTyre( int tyreID )
    • .Health
    • .ID (read-only)
    • .Immunity
    • .Kill
    • .Lights
    • .Locked
    • .Model (read-only)
    • .Pos
    • .RelativeSpeed
    • .RelativeTurnSpeed
    • .ResetAllHandling()
    • .ResetHandlingData( int rule )
    • .Respawn()
    • .RespawnTimer
    • .Rotation
    • .SetHandlingData( int rule, float value )
    • .SetPart( int partID, int damageStatus )
    • .SetTyre( int partID, bool isPopped )
    • .SpawnAngle
    • .SpawnPos
    • .Speed
    • .StreamedForPlayer( Player player )
    • .SyncSource (read-only)
    • .SyncType (read-only)
    • .TurnSpeed
    • .World
    • .Wrecked (read-only)

Pickup Functions

  • Pickup CreatePickup( int model, int world, int quantity, Vector pos, int alpha, bool isAuto )
  • Pickup FindPickup( int id )

Pickup Entity

  • Pickup
    • .Alpha
    • .Automatic
    • .ID (read-only)
    • .Model (read-only)
    • .Pos
    • .Quantity (read-only)
    • .Remove()
    • .StreamedToPlayer( Player pStreamer )
    • .Timer
    • .World

Object Functions

  • Object CreateObject( int model, int world, Vector pos, int alpha )
  • Object FindObject( int id )
  • void HideMapObject( int nModelId, float x, float y, float z )
  • void ShowMapObject( int nModelId, float x, float y, float z )
  • void ShowAllMapObjects ()
  • void ForceAllSelect()

Object Entity

  • Object
    • .Alpha (read-only)
    • .Delete()
    • .ID (read-only)
    • .Model (read-only)
    • .MoveBy( Vector posOffset, int time )
    • .MoveTo( Vector pos, int time )
    • .Pos
    • .RotateTo( Quaternion rotation, int time )
    • .RotateToEuler( Vector rotation, int time )
    • .RotateBy( Quaternion rotationOffset, int time )
    • .RotateByEuler( Vector rotationOffset, int time )
    • .Rotation (read-only)
    • .RotationEuler (read-only)
    • .SetAlpha( int alpha, int fadeTime )
    • .TrackingBumps
    • .TrackingShots
    • .World

Timer Functions

  • Timer NewTimer( string functionName, int interval, int repetitions, [...] )

Timer Entity

  • Timer
    • .Delete()
    • .Elapsed (read-only)
    • .Interval
    • .Paused

Deprecated Functions

These functions are for compatibility, but may be removed in future versions.

  • int GetTime ()
  • string GetFullTime ()

Updated