• Changing from ASSmod to Evolve
    4 replies, posted
Hi, I have an this code a friend gave to me, it is basically an admin stick that you use to do whatever the functions limit. I have coded myself some nice functions and in the original code it uses ASSmod, however I prefer to use Evolve so I was wondering if someone could help me change it over please Here is the coding as it stands: [lua]AddGear("Ban", "Aim at a player to ban them", true, function ( Player, Trace ) if IsValid(Trace.Entity) and Trace.Entity:IsPlayer() then ASS_ShortBan( Trace.Entity, 10, Player:Nick(), "Faggotry (God-Stick Ban)", "", Player:SteamID()) end end ) AddGear("[O] *OWNER FUNCTIONS HERE*", "Click to...", false, function ( Player, Trace ) if Player:GetLevel() != 0 then Player:Notify("This gear requires Owner status.") return false end --Code of the function here )[/lua] (Just ignore the AddGear etc, that is just creating a new function to use) -As you can see for the ban, it creates an ASS_ShortBan, so for this I want to change it so that it will ban using Evolve -As for the Owner function that may be a bit harder. Looking in the ASSmod coding it bases its ranks by giving the player levels, 0 being Owner and then obviously the function ends if your not the Owner according to ASSmod. So for this I need to change it so that it only works for Owner status on the Evolve admin mod Thanks for reading and hopefully you can help me
The code supplied isn't even going to work. The function at line 10 isn't ended. The function at line 2 dosent have a name supplied. Player, Trace aren't valid arguments. [lua] AddGear("Ban", "Aim at a player to ban them", true, function BanPlayer(ply) local length = 60 -- minutes to ban local reason = "Banned" -- banned reason local tr = ply:GetEyeTrace() local ent = tr.Entity if ent:IsValid() && ent:IsPlayer() then ply:ConCommand("ev_ban", ent:Nick(), length, reason) end end ) AddGear("[O] *OWNER FUNCTIONS HERE*", "Click to...", false, function OwnerFunc(ply) if Player:GetLevel() != 0 then Player:Notify("This gear requires Owner status.") return false end end --Code of the function here ) [/lua]
You must be using the Godstick.
[QUOTE=Godlike2;26706876]You must be using the Godstick.[/QUOTE] Yeah I am, and also I was saying don't worry about the codes, it's just getting it from ASS to Evolve It all works, but incase you are wondering it goes: [lua]AddGear("Title", "Description", true/false (Superadmin only), Function stuff here ) [/lua] As you may now see the function IS ended in my codes, the AddGear function contains information with parenthisis (), so thats why at the ends there is no end, but a single closed bracket Also Zzaacckk, thatnks for the ban code, I'll give that a go when I get back from school later [b]EDIT[/b] Infact I just pulled this out of the code, it uses Gears as a table and the Godstick calls upon the function of the certain Gear when selected [lua]local function AddGear ( Title, Desc, SA, Func ) table.insert(Gears, {Title, Desc, SA, Func}) end[/lua]
Sorry, you need to Log In to post a reply to this thread.