mirror of
https://github.com/BeamMP/Docs.git
synced 2025-07-02 16:05:47 +00:00
simplify DropPlayer example
This commit is contained in:
parent
d26afe8630
commit
315c8d1f20
@ -548,17 +548,14 @@ As guests are anonymous, you may want to disallow them to join, however it is re
|
|||||||
Kicks the player with the specified ID. The reason parameter is optional.
|
Kicks the player with the specified ID. The reason parameter is optional.
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
local player_id = 3
|
function ChatHandler(player_id, player_name, message)
|
||||||
local vcount = 0
|
if string.find(message, "damn") then
|
||||||
local player_vehicles = MP.GetPlayerVehicles(player_id)
|
MP.DropPlayer(player_id, "Profanity is not allowed")
|
||||||
|
return 1
|
||||||
for vehicle_id, vehicle_data in pairs(player_vehicles) do
|
else
|
||||||
vcount = vcount + 1
|
return 0
|
||||||
if vcount > 1 then
|
|
||||||
MP.RemoveVehicle(player_id, vehicle_id)
|
|
||||||
MP.DropPlayer(player_id, "You can only have one vehicle spawned at once.")
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
```
|
```
|
||||||
#### `MP.GetStateMemoryUsage() -> number`
|
#### `MP.GetStateMemoryUsage() -> number`
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user