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.
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.
The commands work if you run them through the console, but not the chatbox.
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..".");
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 ) then
local commandTable = pistachio.command:Get( arguments );
if (commandTable) then table.remove(arguments, 1); pistachio.command:Run(commandTable, client, arguments); end; end; client.nextCommand = CurTime() + 0.25; end; end);
[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]