Scripting/Squirrel/Functions/Players/ShootInAir

From VC-MP Wiki

Jump to: navigation, search

Syntax

bool player.ShootInAir( int true/false )

Arguments

  • true/false - This is return to actived or desactived

Example

This example active/desactived shoot in air mod with the default one when they type '/c shootinair on/off'.

function onPlayerCommand( player, cmd, text )
{
     	if ( cmd == "shootinair" )
	{
        local status = player.ShootInAir;
		if ( !text ) PrivMessage( "Error, Missing Information, ShootInAir <on/off>", player );
		else if ( text == "on" )
        {
            if ( status == true ) PrivMessage( "Error, you already have shot in air mod turned on!!", player );
            else
            {
                ::PrivMessage( "Setting Shoot In Air Mod, To: On", player );
                player.ShootInAir = true; 
            }
        }
		else if ( text == "off" ) 
        { 
            if ( status == false ) PrivMessage( "Error, you already have shoot in air mod turned off!!", player );
            else
            {
                ::PrivMessage( "Setting Shoot In Air Mod, To: Off", player );
                player.ShootInAir = false; 
            }
        }
        else PrivMessage( "Error, Invalid Information, shootinair <on/off>", player );
    }
}

Made By MK.Shadow

Personal tools
squirrel scripting