Jump to content

[Help]Spript


kietla

Recommended Posts

policeSkins = { [280]=true,[281]=true,[282]=true,[283]=true,[284]=true,[285]=true,[286]=true } 
  
function kick (commandName, playerSource, playerName, opis) 
    local player = getPlayerFromName (playerName) 
    if policeSkins[getElementModel(playerSource)] then 
  
    if ( hasObjectPermissionTo ( sourcePlayer, "function.kickPlayer" ) ) then 
        -- Kick the player 
        kickPlayer ( kicked, sourcePlayer, reason ) 
    end 
    end 
end 
addCommandHandler ("wyrzuc", kick) 

[22:32:28] WARNING: dodatki/kick.lua:5: Bad argument @ 'getElementModel' 
[22:32:48] WARNING: dodatki/kick.lua:5: Bad argument @ 'getElementModel' 
[22:33:00] WARNING: dodatki/kick.lua:5: Bad argument @ 'getElementModel' 

Please help

command does not work

Link to comment
  
policeSkins = { [280]=true,[281]=true,[282]=true,[283]=true,[284]=true,[285]=true,[286]=true } 
  
function kick(playerSource, commandName, playerName, opis) 
  if policeSkins[getElementModel(playerSource)] then 
    local player = getPlayerFromName(playerName) 
    if player and hasObjectPermissionTo(playerSource, "function.kickPlayer") then 
      -- Kick the player 
      kickPlayer(player, playerSource, opis) 
    end 
  end 
end 
addCommandHandler("wyrzuc", kick) 
  

Link to comment

with your script you have to write eXAcT full name, including case.

your script must be in meta.xml, server type

you must have police skin

you must be allowed to use kickPlayer function

you resource must be allowed to use kickPlayer function

etc. as you see there are too many factors with your "not working".

use /debugscript 3

Link to comment
  
policeSkins = { [280]=true,[281]=true,[282]=true,[283]=true,[284]=true,[285]=true,[286]=true } 
  
function kick (commandName, playerSource, playerName, opis) 
    local player = getPlayerFromName (playerName) 
    if policeSkins[getElementModel(playerSource)] then 
        if isElement(player) then 
            if opis then 
                kickPlayer (player) 
                outputChatBox ("Gracz " .. tostring(playerName) .. " został wyrzucony przez " .. tostring(getPlayerName(playerSource)) .. ", powów: " .. tostring(opis) .. ".") 
            end 
        else 
            outputChatBox ("Nie ma takiego gracza", playerSource) 
        end 
    end 
end 
addCommandHandler ("wyrzuc", kick) --/wyrzuc gracz dlaczego 

also in this script are errors or you can correct it?

Polish:

w tym skrypcie tez są błędy czy byś mógł go poprawić??

Link to comment

WARNING: ttt/team.lua:4: Bad argument @ 'getPlayerFromName'

Acl Admin:

OK

policeSkins = { [280]=true,[281]=true,[282]=true,[283]=true,[284]=true,[285]=true,[286]=true } 
  
function kick (playerSource, commandName, playerName, opis) 
    local player = getPlayerFromName (playerName) 
    if policeSkins[getElementModel(playerSource)] then 
        if isElement(player) then 
            outputChatBox ("Nie ma takiego gracza", playerSource) 
        end 
    end 
end 
addCommandHandler ("ttest", kick) --/wyrzuc gracz dlaczego 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...