Jump to content
The Indie Stone Forums
JonSyn

admin tools menu , sorta.

Recommended Posts

so im working on a menu that lets me just click a button when i wanna launch choppers or gunshots or help, also a few othere things to make admining easier for me, but im stuck on the chat aspect right now...

 

it has othere features but im only posting the section for the /help .

i tried this

	elseif feature == "Help" then		getPlayer():Say("/help");		

but instead of using as it would if i typed it into chat it shows it over my characters head .

 

 

i aslo tried

	elseif feature == "Help" then		player:Say("/help");		

but that returns a error in console.

-------------------------------------------------------------attempted index: Say of non-table: null-----------------------------------------STACK TRACE-----------------------------------------function: SpawnTools -- file: tools.lua line # 96function: onMouseUp -- file: ISButton.lua line # 55attempted index: Say of non-table: null-----------------------------------------STACK TRACE-----------------------------------------function: SpawnTools -- file: tools.lua line # 96function: onMouseUp -- file: ISButton.lua line # 55

im new to lua and not so good yet, so if i could get a push in the right direction id be very appreciative .

Share this post


Link to post
Share on other sites

Erm. player is a variable.

player needs to be assigned a value, else it is null.

Properly it's player = getPlayer(), which itself may prove inadequate having moved to MP coding. getSpecificPlayer(IsoPlayer) is probably the safer bet, which means using an Event that provides the player for you.

 

Then you can simply go player:Say("text"), assuming Say() is the correct method in IsoPlayer.

Share this post


Link to post
Share on other sites

with the "/" it causes an error in the client console tho with player:Say("/help"), what i want it to do is use it as if i was typing /help into the chat box .

so it'll show the help text in the chat.

 

and if i change it to

	elseif feature == "Help" then	    player = getPlayer()		player:Say("/help");		

it justs says /help over my characters head.

Share this post


Link to post
Share on other sites

Well that's because the "Say(...)" functions is supposed to print text over the characters head ^^

 

You'll need to find the correct function for the chat.

Share this post


Link to post
Share on other sites

just gunna continue my thread here......

looking to change my buttons from text based to png icons, im thinking i need to change alot of what im doing to do this.

if anyone could help that'd be great

Share this post


Link to post
Share on other sites

alright, so no one seems to be interested, but ill keep posting (fedora)

im looking for a way to destroy player built walls and doors and windows and etc.

not by using a sledge hammer or axe, but by clicking and having a destroy item menu option.

i can do the menu option but not sure how to destroy the selected item by a click.

would be nice to have for the hacker built garbage some server hosts find (my self included).

any ideas on it?

 

edit :

i dont think i made myself clear enough, maybe i did, but im looking for a way to destroy intently on click, i can make the menu option but nothing happens yet. is there a way to set damage to 0? i guess thats the idea here, mostly i want it to just vanish and leave no planks or nails. a little push would help but im sure ill figure it out alone. but thanks for any help

Edited by JonSyn

Share this post


Link to post
Share on other sites

Went to sleep before i could talk to Nero.

 

Let me just say i build an admin test base in about 5 minutes lol.

 

No more commands, thanks for letting me test this Jon :D

 

Creative-mode is the sh***t! :)

 

/Lets get drunk on Skype again tonight! :)

Share this post


Link to post
Share on other sites

im on man right now login.

the creative mode was pulled from a hack i found, not sure who did it but soon as i can verify that line of code to its creater ill post who it is.

Share this post


Link to post
Share on other sites

it can now destroy walls/doors/windows/tables/etc with no waisted time.

and it can be toggled on/off.

now to make it so it checks if the person is an admin before allowing it to be used by them.

any ideas on that?

Share this post


Link to post
Share on other sites

i was just about to post you an idea on how to destroy walls etc., but i have no idea on how to check for admin. But i came across a function called isClient() in ISInventoryTransferAction.lua, maybe there is a similar function to check if isServer(). But i did not check what isClient() actually does, so this might also totally wrong what im posting :P

Share this post


Link to post
Share on other sites

i got the item spawner, the events, god mode and invisability and the zombie spawner all so you have to be admin to use, still working on making the build and destroy parts admin use only.

 

cptl3.jpg

y836y.jpg

tffo.jpg

Share this post


Link to post
Share on other sites

i have added a line that cause sever damage to non admins who use it and says "I AM A HACKER, I AM USING ADMIN TOOLS BY: JonSyn TO HACK ON YOUR SERVER."  and "I JUST TRYED TO USE INVISIBILITY PLEASE IP BAN ME!!!!!!!!!!!!!!!!", difrent for every button, but it says it locally, i cant find a global chat command.

 

could use a lil help.

Share this post


Link to post
Share on other sites

/all is yeah, but when i try SendCommandToServer("/all  hello world");

i get the /all hello world is a unknown command in the chat window.

 

with         SendCommandToServer("/all", "hello world");

i get the /all  is a unknown command in the chat window.

 

        getPlayer():Say("/all", "hello world");

does nothing but give me a error in console for that line.

same with getPlayer():Say(command, "/all", "hello world");

 

 

and about a dozen other ways iv tried. after looking over the index and ISChat.lua .

Share this post


Link to post
Share on other sites

giving up on the global chat for now......lol

 

its annoying me, and im sure its sooooooooo simple im just missing it.

 

the next step is to find a way to distribute items throughout the map at a low chance while in game.

im sure something like...

table.insert(SuburbsDistributions["all"]["crate"].items,"Base.Axe");table.insert(SuburbsDistributions["all"]["crate"]["items"],1.1);

wont work in game.

Share this post


Link to post
Share on other sites

You can't use Say() for what you think you can. It can only take one variable ( a single string of text). Packing several into that function will rightly give you errors.

So, I'll do this once.

Grab a program like NotePad++ that allows you to get all the matching strings within a series of files.

For example, search for SendCommandToServer gives me . . .

 

  C:\Program Files (x86)\Steam\SteamApps\common\ProjectZomboid\media\lua\client\ISUI\ISChat.lua (1 hit)	Line 108:         SendCommandToServer(command);  C:\Program Files (x86)\Steam\SteamApps\common\ProjectZomboid\media\lua\client\OptionScreens\ISScoreboard.lua (5 hits)	Line 68:         SendCommandToServer("/kickuser " .. username);	Line 70:         SendCommandToServer("/banuser " .. username);	Line 72:         SendCommandToServer("/banuser " .. username .. " ip=true");	Line 74:         SendCommandToServer("/godmod " .. username);	Line 76:         SendCommandToServer("/invisible " .. username);
What, potentially, can we gather from this? From line 108, we see that SendCommandToServer only takes 1 paramemter (command). Any attempts to stuff more down its gullet will be futile.

Lines 68 through 76 indcate that /all may not be a valid command for this function, as it is never referenced in the Lua code. This doesn't necessarily mean this is true, as this is only the Lua code, not the Java code.

How about we search for /all in all files, then.

Well, look here:

 

  C:\Program Files (x86)\Steam\SteamApps\common\ProjectZomboid\media\lua\client\ISUI\ISChat.lua (3 hits)	Line 100:     if luautils.stringStarts(command, "/all") and ServerOptions.getBoolean("GlobalChat") then	Line 101:         local message = luautils.trim(string.gsub(command, "/all", ""));	Line 175:         ISChat.instance.textEntry:setText("/all ");
So, it wasn't getPlayer():say(String), or SendCommandToServer(String) After all! All this time, /all was referencing ISChat.lua! But what does all the rest of that do? . . .

Share this post


Link to post
Share on other sites
local item = button.internal;	SendCommandToServer('/additem "' .. item);

thats how i spawn items.... was why i used it to do global, i knew it wouldn't work since /all isnt in the list of commands.

i had already gone thru all those earlier.

  C:\Program Files (x86)\Steam\SteamApps\common\ProjectZomboid\media\lua\client\ISUI\ISChat.lua (3 hits)	Line 100:     if luautils.stringStarts(command, "/all") and ServerOptions.getBoolean("GlobalChat") then	Line 101:         local message = luautils.trim(string.gsub(command, "/all", ""));	Line 175:         ISChat.instance.textEntry:setText("/all ");

this is where i get lost as im still new to all this and i don't understand line 100, or 101 and 175 for that matter.

well i guess i under stand them a bit but i don't get how to use that to get global chat .

 

i use notepad++ :cool:

wonder.....is

setText("/all ");

what im looking for?

 

and would it be something like...

setText("/all ", "hello world");orsetText("/all hello world");

on a sidenote, would this work to force distribute new loot in game?

require "Items/SuburbsDistribution";function Spawner() --this is the function that would add the loot in gametable.insert(SuburbsDistributions["all"]["crate"].items,"Base.Axe");table.insert(SuburbsDistributions["all"]["crate"]["items"],1.1);end elseif feature == "Items" then --this would be linked to the feature button not shown        Spawner();

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...