PL/takeAllWeapons

From Multi Theft Auto: Wiki
Revision as of 17:37, 13 September 2018 by WilQ (talk | contribs) (Created page with "__NOTOC__ {{PL/Server function}} This function removes every weapons from a specified ped, rendering it unarmed. {{Note|Weapons are removed when a ped dies by default. Thi...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function removes every weapons from a specified ped, rendering it unarmed.

[[{{{image}}}|link=|]] Note: Weapons are removed when a ped dies by default. This means that it is only appropriate to use this function while a ped is alive.

Syntax

bool takeAllWeapons ( ped thePlayer )

Wymagane argumenty

Wynik

Zwraca true jeśli broń została poprawnie nadana, false jeśli nie.

Przykłady

Ten przykład dodaje komendę "usunbronie", która usuwa bronie wszystkim graczom na serwerze.

addCommandHandler( "usunbronie",
  function ( player, command )
    for k, v in ipairs ( getElementsByType("player") ) do
        takeAllWeapons(v)
        outputChatbox("Gracz " .. getPlayerName( player ) .. " zabiera wszystkim bronie.", player )
    end
  end
)

Zobacz również