Jump to content

[Help]Spript


kietla

Recommended Posts

Posted
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

Posted

could you improve the code too much because I do not know what's going on

Poland:

mógł byś poprawić kod bo za bardzo nie wiem o co chodzi

Posted
  
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) 
  

Posted

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

Posted
  
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ć??

Posted

same thing, change

function kick (commandName, playerSource, playerName, opis) 

to

function kick (playerSource, commandName, playerName, opis) 

Posted

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 

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...