SamB Posted July 14, 2006 Share Posted July 14, 2006 Hey im looking if someone knows how to show admins? ive got this so far: on *:SIGNAL:mta.command: { if ($3 == !admin) { mta.text $1 mta.admin $1 $2 } } it doesnt work anyway wondering if anyone cud help me? Link to comment
Oli Posted July 15, 2006 Share Posted July 15, 2006 well it depends on the script you are using.. but that^^ wont work at all.. mta.admin is a function called when admin types something.. not something u call to get admins Link to comment
SamB Posted July 15, 2006 Author Share Posted July 15, 2006 im using the latest mtama on mtasa 1.1.1 i have no idea wat u use to call admins i wud like it to look like this: Player:!admin *Admin, Admin level* *next admin etc* Link to comment
lil Toady Posted July 15, 2006 Share Posted July 15, 2006 where are stored the levels for admins? in my example they are in $readini($scriptdir $+ admins.ini,levels,$mta.nick($1,%a)), change it to whatever on *:SIGNAL:mta.command:{ if (!admin* iswm $3) { var %a = 0,%b while (%a <= $mta.server($1).cmax) { if ($readini($scriptdir $+ admins.ini,levels,$mta.nick($1,%a)) >= 1) { if (!%b) %b = $mta.nick($1,%a) $+ (Level: $readini($scriptdir $+ admins.ini,levels,$mta.nick($1,%a)) $+ ) elseif (%b) %b = %b $+ , $mta.nick($1,%a) $+ (Level: $readini($scriptdir $+ admins.ini,levels,$mta.nick($1,%a)) $+ ) } !inc %a } mta.text $1 $iif(%b,Admins online: %b,There are currently no admins online) } } Link to comment
SamB Posted July 15, 2006 Author Share Posted July 15, 2006 sorry new to this but what do i have to write in admins.ini for admins? is it something like: Admin Level Admin Level over and over Link to comment
lil Toady Posted July 15, 2006 Share Posted July 15, 2006 if you dont have an ini with admin levels, so my admins.ini must look like this: [levels] SamB=4 lil_Toady=5 n00b=3 name=level Link to comment
lil Toady Posted July 15, 2006 Share Posted July 15, 2006 hmm, i can't find any mistake in my script.. is admins.ini in the same dir as the script? does it give up any errors? i don't know how to help you.. i gave you an example of an !admin script that must work fine imo try this on *:SIGNAL:mta.command:{ if (!admin* iswm $3) { var %a = 0,%b,%c while (%a <= $mta.server($1).max) { if ($readini($scriptdir $+ admins.ini,levels,$mta.nick($1,%a)) >= 1) { %c = $readini($scriptdir $+ admins.ini,levels,$mta.nick($1,%a)) if (!%b) %b = $mta.nick($1,%a) $+ (Level: %c $+ ) elseif (%b) %b = %b $+ , $mta.nick($1,%a) $+ (Level: %c $+ ) } !inc %a } mta.text $1 $iif(%b,Admins online: %b,There are currently no admins online) } } Link to comment
CoZ Posted July 15, 2006 Share Posted July 15, 2006 lets start with the beginning script type admins are different then rcon admins that said do you even have script admins ? if the answer is no, well .. change that first if your trying to write your own script its still not a bad idea to 'borrow' the admin part of a ready script .. just ask the author for permision maybe u can use tommis script Link to comment
SamB Posted July 15, 2006 Author Share Posted July 15, 2006 hmm well i was thinking all the admins on my server i put in a .ini [Admins] {XN}Boylett 5 {XN}Tomson 3 {XN}Paddy 5 paulgti 4 etc. then i was thinking of a script which does this: someone says !admin or !admins the script looks at admins.ini it sees if any of those ppl are online if one of them is online it shows their name and their lvl like so: {XN}Boylett 5, {XN}Tomson 3 etc. (this wud be if only me and tomson were online) so it doesnt bother with rcon it just shows someones name if they admin and online i think its an ok idea to use if u wanna keep RCON i was thikning maybe: on *:SIGNAL:mta.command: { if ($3 == !admins) { ($readini admins.ini) If ($4 == mta.online) mta.text $1 mta.nick $1 $2 mta.level elseif ($4 == mta.offline) mta.nothing } } i no its all messed and mangled like my SA car but i was thinking a good scripter cud fix it. i have no idea wat anything means anyway Link to comment
lil Toady Posted July 15, 2006 Share Posted July 15, 2006 man, that's what the script i typed is exactly doing.. Link to comment
lil Toady Posted July 15, 2006 Share Posted July 15, 2006 it gives up any errors or something? im sure ur ini aint right Link to comment
CoZ Posted July 16, 2006 Share Posted July 16, 2006 you do realise with the ini and the !admin command IF you get both running STILL you wont have functional admins try this code ingame type !set (dont mess manualy with the ini file , type !set once to make yourself admin level 10 and use !setlevel nickname 5 to add a level 5 admin ) on *:SIGNAL:mta.command: { ;Parameters: ;$1 = Server ;$2 = ID ;$3 = Command ;$4- = Parameters if ($3 == !admin) || ($3 == !admins) { var %aa = 0,%bb,%cc,%dd while (%aa <= $mta.server($1).cmax) { if ($readini($scriptdir $+ admin.ini,ADMIN,$mta.nick($1,%aa)) >= 2) { if (!%bb) %bb = $mta.nick($1,%aa) elseif ($numtok(%bb,32) <= 7) %bb = %bb $mta.nick($1,%aa) elseif (!%cc) %cc = $mta.nick($1,%aa) elseif ($numtok(%cc,32) <= 7) %cc = %cc $mta.nick($1,%aa) elseif (!%dd) %dd = $mta.nick($1,%aa) elseif ($numtok(%dd,32) <= 7) %dd = %dd $mta.nick($1,%aa) } !inc %aa } if (%bb) { mta.text $1 Online Admin(s): %bb if (%cc) mta.text $1 %cc if (%dd) mta.text $1 %dd } else mta.text $1 There are no online admins. } elseif ($3 == !setlvl) || ($3 == !setlevel) { if ($gus.level($1,$2) >= 10) { if ($4 && $5) { if ($4 && $5 isnum) { if ($5 >= $gus.level($1,$2)) mta.pm $1 $2 Error - Cannot set a level higher or equal to yours else { if (%a == -1) mta.pm $1 $2 Error - Absent ID else { mta.text $1 $mta.nick($1,%a) $+ 's Level changed from $gus.level($1,%a) to $5 !writeini -n " $+ $scriptdir $+ admin.ini" ADMIN $mta.nick($1,%a) $5 !writeini -n " $+ $scriptdir $+ admin.ini" IP $mta.nick($1,%a) $mta.ip($1,%a) } } } else mta.pm $1 $2 Error - Syntax: $3 } else mta.pm $1 $3 Error - Syntax: $3 } else mta.pm $1 $2 Error - You need to be level 10 to use this command } elseif ($3 == !set) { if ($readini($scriptdir $+ admin.ini,SET,SET) == $null) { !writeini -n " $+ $scriptdir $+ admin.ini" SET SET 1 !writeini -n " $+ $scriptdir $+ admin.ini" ADMIN $mta.nick($1,$2) 10 !writeini -n " $+ $scriptdir $+ admin.ini" IP $mta.nick($1,$2) $mta.ip($1,$2) !writeini -n " $+ $scriptdir $+ options.ini" OPTIONS maker $mta.nick($1,$2) mta.text $1 Nick " $+ $mta.nick($1,$2) $+ " Added with Admin Level 10 mta.pm $1 $2 Type !setupload to add a Upload URL! mta.pm $1 $2 Type !setwelcomemsg to add a Welcome Message! } else mta.pm $1 $2 Error - You can only use this command once! } } on *:SIGNAL:mta.join: { !writeini -n " $+ $scriptdir $+ alias.ini" GETIP $mta.nick($1,$2) $mta.ip($1,$2) !writeini -n " $+ $scriptdir $+ alias.ini" GETNICK $mta.ip($1,$2) $mta.nick($1,$2) !writeini -n " $+ $scriptdir $+ stats.ini" VISITS $mta.nick($1,$2) $gus.add($gus.visits($1,$2),1) if ($gus.level($1,$2) == $null) !writeini -n " $+ $scriptdir $+ admin.ini" ADMIN $mta.nick($1,$2) 1 if ($gus.level($1,$2) >= 2) { if ($readini($scriptdir $+ admin.ini,IP,$mta.nick($1,$2)) == $null) !writeini -n " $+ $scriptdir $+ admin.ini" IP $mta.nick($1,$2) $mta.ip($1,$2) elseif ($readini($scriptdir $+ admin.ini,IP,$mta.nick($1,$2))) { if ($gettok($mta.ip($1,$2),1-2,46) isin $readini($scriptdir $+ admin.ini,IP,$mta.nick($1,$2))) { mta.text $1 Welcome Back $mta.nick($1,$2) } else { mta.text $1 $mta.nick($1,$2) - Invalid IP Match mta.kick $1 $2 } } } } on *:SIGNAL:mta.nick: { ;Parameters: ;$1 = Server ;$2 = ID !writeini -n " $+ $scriptdir $+ alias.ini" GETIP $mta.nick($1,$2) $mta.ip($1,$2) !writeini -n " $+ $scriptdir $+ alias.ini" GETNICK $mta.ip($1,$2) $mta.nick($1,$2) !writeini -n " $+ $scriptdir $+ stats.ini" VISITS $mta.nick($1,$2) $gus.add($gus.visits($1,$2),1) if ($gus.level($1,$2) >= 2) { if ($readini($scriptdir $+ admin.ini,IP,$mta.nick($1,$2)) == $null) !writeini -n " $+ $scriptdir $+ admin.ini" IP $mta.nick($1,$2) $mta.ip($1,$2) elseif ($readini($scriptdir $+ admin.ini,IP,$mta.nick($1,$2))) { if ($gettok($mta.ip($1,$2),1-2,46) isin $readini($scriptdir $+ admin.ini,IP,$mta.nick($1,$2))) { mta.text $1 $mta.nick($1,$2) Logged into Admin. (Level: $gus.level($1,$2) $+ ) } else { mta.text $1 $mta.nick($1,$2) - Invalid IP Match mta.kick $1 $2 } } } } but still .. when this works you'll have a admin thing but no admin commands example place this in the on *:command section before the last closing } elseif ($3 == !kick) { if ($gus.level($1,$2) >= 5) { if (%a == -1) mta.pm $1 $2 Error - Absent ID elseif (%a == $2) mta.pm $1 $2 Error - Cannot $3 yourself elseif ($gus.level($1,%a) >= $gus.level($1,$2)) mta.pm $1 $2 Error - You cannot $3 a preson with the same or higer level. else mta.kick $1 %a } else mta.pm $1 $2 Error - You need to be level 3 to use this command } (tnx to tommis for this script) Link to comment
Recommended Posts