ID:163406
 

ok in my game if a guy is gm he gets the boot verbs and other gm things

i have created a gm variable for every player so anyone whose gm variable value is 1 is a gm and if it is not one thn well u r not a gm.i have successfully done this but now the thing is tht i want to create a list in which there are names of the players who will be given gm verb so how do i do this.
var/list/GM_List=list("NOobsternation","NOobsternation")//to add more keys just put the key between parantheses and seperate each key by a comma

mob/var/gm=0

mob/proc/Give_GM()
if(GM_List.Find(src.key) //if it finds the key in the list
src.gm=1 //gives the player gm
for(var/x in typesof(/mob/GM/verb)) // for all the verbs wich location is /mob/GM/verb
src.verbs+=x // gives the player the verbs

mob/GM/verb
Boot()
Ban()
Mute()

mob/Login()
..()
src.Give_GM() // runs the Give_GM proc upon login
Making a variable for mobs to decide wether or not they have administrative powers is bad. Baaaaad.

-- Data
In response to NOobsternation
NOobsternation wrote:
> var/list/GM_List=list("NOobsternation","NOobsternation")//to add more keys just put the key between parantheses and seperate each key by a comma
>
> mob/var/gm=0
>
> mob/proc/Give_GM()
> if(GM_List.Find(src.key) //if it finds the key in the list
> src.gm=1 //gives the player gm
> for(var/x in typesof(/mob/GM/verb)) // for all the verbs wich location is /mob/GM/verb
> src.verbs+=x // gives the player the verbs
>
> mob/GM/verb
> Boot()
> Ban()
> Mute()
>
> mob/Login()
> ..()
> src.Give_GM() // runs the Give_GM proc upon login

Just because I KNOW he's going to Copy & Paste this --

if(GM_List.Find(src.key) <-- forgot a ")", it should be;

if(GM_List.Find(src.key))
var/gm = list("KirbyAllStar","Rafehchaudry")
mob/Login()
if(src.key in gm)
src.verbs+=typesof(/mob/GM/verb/)
..()
mob/GM/verb
GiveGM(mob/M as mob in world)
gm += M.key
src.verbs+=typesof(/mob/GM/verb/)
TakeGM(mob/M as mob in world)
gm -= M.key
src.verbs-=typesof(/mob/GM/verb/)


You'll probably want to create a Save and Load proc for your GM list.
In response to Android Data
Yes its easy to hack...
Inuyashaisbest wrote:
thats why u encrypt it :) md5 bah to easy use Popisfizzys :D

Hashing savefiles is of course a good start, but it's still a bad way of handling administators.

A best way is to make a list of administrators. Additionally, you can hash this as well.

-- Data
Hash is easy to get by if you know what your doin.
In response to AshHardwarez
AshHardwarez wrote:
Hash is easy to get by if you know what your doin.

Wrong. Assuming the hash is properly setup, it is quite difficult to get by.

The most I'd see is getting the DreamSeeker strings and getting the hash key from there. But since the key is by nature gibberish this is difficult on it's own. Plus, the key could be encrypted to make it even more difficult.

-- Data
In response to Android Data
Not unless I used a program with dream seeker while the game is running and change the variables that of the gm var. :p
wouldnt do you nogood. :p