-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add npc_relationships.lua #98
Conversation
Another plugin for a job. Allows admins to toggle PVP. |
The first plugin is basically a duplication of the The second one is full of several issues like the indentation which is clearly not uniform with the rest of the Helix code. The declaration of local variables on the client and server side to use it only on the server side. Finally, there are many things to review in the loops. You should strongly look at the Helix code to try to factorize and improve the readability of both plugins. |
As disable_pvp.lua is no longer needed, it has been removed.
Your criticism has been addressed. Readability has been improved. Variables now only initialize on the server. Thank you. |
npc_relationships.lua
Outdated
for i, Ply in ipairs(player.GetAll()) do -- get all players | ||
if !Ply:GetCharacter() then continue end -- if player is not loaded | ||
|
||
if Ply:Team() != friendlyFaction then Ply.VJ_NPC_Class = {nil}; continue end -- if not a friendly faction |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why insert a semi colon when you didn't before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe semi-colons are required when not using new lines, which I saw as unnecessary seeing as it was one function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I remember, I don't think there's any need for it, but as I can't test this right now, I'll trust you on this point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are not required in lua.
Thank you both for your comments. Most of the above changes have been addressed. Let me know if I missed anything. |
The whole thing looks pretty good to me, well done! If there are still inconsistencies or changes to be made, the Helix maintainers will report them. |
A plugin made for a job. Allows certain npcs to be friendly to certain factions.