KickPlayer: Difference between revisions

From Onset Developer Wiki
No edit summary
28days (talk | contribs)
No edit summary
Line 12: Line 12:


== Example ==
== Example ==
__EDIT_ME__
<syntaxhighlight lang="Lua">
AddCommand("kick", function(playerid, lookupid)
 
    if lookupid == nil then
        return AddPlayerChat(playerid, "Usage: /kick <lookupid>")
    end
 
    if not IsValidPlayer(lookupid) then
        return AddPlayerChat(playerid, "The playerid you have inserted is invalid.")
    end
 
    KickPlayer(lookupid, "Kicked by "..GetPlayerName(playerid)..".")
end)
</syntaxhighlight>


{{RelatedFunctions}}
{{RelatedFunctions}}
__EDIT_ME__
{{Template:ClientFunctions}}

Revision as of 13:15, 25 November 2019

KickPlayer

Type: Function
Context: Server
Introduced: v1.0

Description

Kicks a player with a reason, colors are not supported.

Syntax

KickPlayer(player, reason)

Parameters

  • player
    The player identifier.
  • reason
    The reason

Return Value

  • This function doesn't have a return value.

Example

AddCommand("kick", function(playerid, lookupid)

    if lookupid == nil then
        return AddPlayerChat(playerid, "Usage: /kick <lookupid>")
    end

    if not IsValidPlayer(lookupid) then
        return AddPlayerChat(playerid, "The playerid you have inserted is invalid.")
    end

    KickPlayer(lookupid, "Kicked by "..GetPlayerName(playerid)..".")
end)

See also

Pak

Game

Colors

Miscellaneous

Time

Player

Camera

Waypoints

Fireworks

Packages

Chat

HUDs

Post-processing

GUI

Ocean

Mouse

Sky / Environment

Network

NPC

Objects

Events

Pickup

Door

Text3D

Sound

Text

Timer

Vehicles

Web UI

Key