2014-07-07 30 views
0

我有一個服務器,並希望標籤添加到我已經把在命令蓋瑞模組盧阿踢和gag Troubble

local force = actions:AddOption("Kick Player from the game") 
force:SetIcon("icon16/delete.png") 
function force:DoClick() 
    RunConsoleCommand("ulx kick","reason", ply:EntIndex()) 
end 

的菜單,但我得到這個錯誤標誌

RunConsoleCommand: Command has invalid characters! (ulx kick (' ')) 
     The first parameter of this function should contain only the command, the second parameter should contain arguments. 

請誰能幫我

+0

嘗試使用'RunConsoleCommand( 「踢」 層:EntIndex( ))'。根據[命令列表](http://steamcommunity.com/sharedfiles/filedetails/?id=170589737),ULX kick命令不接受原因參數。 – hjpotter92

+0

'kick'是'ulx'命令的參數。將它們分成不同的字符串。 –

回答

0

你的命令是ulx
你的論點:kickreasonply:EntIndex()

所以不是

RunConsoleCommand("ulx kick","reason", ply:EntIndex())

行應該是:

RunConsoleCommand("ulx", "kick", ply:EntIndex(), "reason")


「導致函數的第一個參數應該只包含要調用的命令。

來源:您的錯誤消息( 「此函數的第一個參數應該只包含命令,[...]」),並 http://wiki.garrysmod.com/page/Global/RunConsoleCommand