CanPlayerBeKnockedOffBike: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 12: Line 12:
*'''thePlayer:''' the player whose knockoffstatus being asked
*'''thePlayer:''' the player whose knockoffstatus being asked


==Example==  
===Returns===
Returns ''true'' if the player can be knocked off bikes, ''false'' if he can't or an invalid element was passed.
 
==Example==
This example puts the knockoff status in the chatbox.
This example puts the knockoff status in the chatbox.



Revision as of 00:24, 28 March 2008

Dialog-information.png This article needs checking.

Reason(s): Can someone confirm this?

This function checks if a player can fall off bikes.

Syntax

bool canPlayerBeKnockedOffBike ( player thePlayer )         

Required Arguments

  • thePlayer: the player whose knockoffstatus being asked

Returns

Returns true if the player can be knocked off bikes, false if he can't or an invalid element was passed.

Example

This example puts the knockoff status in the chatbox.

function canBeKnockedOff ( command )
    -- The player should enter /knockstatus
    if canPlayerBeKnockedOffBike ( getLocalPlayer() ) then
        outputChatBox ( "You can be knocked off your bike." )
    else
        outputChatBox ( "You can't be knocked off your bike." )
    end
end
addCommandHandler ( "knockstatus", canBeKnockedOff )

See Also