• Pistachio Role Play FCVAR_SERVER_CAN_EXECUTE
    2 replies, posted
[b]FIXED. SOMEONE RE-CODED HALF OF THE WAY THE COMMAND SYSTEM WORKS FOR ME. MAYBE I'LL REQUEST IT TO BE PUT ON THE PISTACHIO GITHUB AFTER I HAVE SOME FUN HOSTING THIS.[/b] Starting a Pistachio Role Play server. Works fine in singleplayer, all commands run fine (Obviously). On servers (I tested this on 2 different dedicated server hosts), whenever you try running any gamemode specific command in chat, you get this error: [lua]FCVAR_SERVER_CAN_EXECUTE prevented server running command: pistachio[/lua] This applies to ALL chat commands in the gamemode, whether it be /job, /changemodel, /pickup, or admin commands such as /createmailbox, /awardmoney, /awardkarma. [b]The commands work if you run them through the console, but not the chatbox.[/b] It was working at one time, but it stopped working again for an unknown reason. No changes were made to the server. I have been looking everywhere for a solution to this, and it seems to be a problem directly related with how the commands were coded by the creator of the game mode, but I still have no fix, and do not know what line to put where in what file. Here's an example of what most chat commands in gamemode look like: [lua]pistachio.command:Create("job", "<job>", "Specifies a job you want to be.", function(client, arguments) local data = table.concat(arguments, " "); if ( client:IsArrested() ) then client:Notify("You cannot change jobs while arrested!"); return; end; if (string.find(data, "police") and client:Team() != TEAM_POLICE) then client:Notify("You must use /votecop to become a police officer!"); return; end; if (string.len(data) < 1) then client:SetPublicVar("job", "Unemployed"); client:Notify("You're now unemployed."); return; end; client:SetPublicVar("job", data); client:Notify("You've set your job to: "..data.."."); end);[/lua] Edit: I found the source of the Pistachio Commands. Anyone see something interesting here? [lua]if (SERVER) then concommand.Add("pistachio", function(client, command, arguments) if ( (client.nextCommand or 0) < CurTime() ) then if ( IsValid(client) and arguments[1] ) then local commandTable = pistachio.command:Get( arguments[1] ); if (commandTable) then table.remove(arguments, 1); pistachio.command:Run(commandTable, client, arguments); end; end; client.nextCommand = CurTime() + 0.25; end; end); end;[/lua] [lua]if (commandTable) then local arguments = string.gsub(message, command, ""); client:ConCommand("pistachio "..command.." "..arguments); else client:Notify("That command doesn't exist!"); end;[/lua]
This is fixed. This can be locked now.
Marking as solved locks it
Sorry, you need to Log In to post a reply to this thread.