Offline Make Admin
#1

How would I make the following code into a offline make admin system?

Код:
if(!strcmp(cmdtext[1],"makeadmin",true,9)){  
if(!IsPlayerAdmin(playerid)||PlayerInfo[playerid][AdminLevel]<5)return SendClientMessage(playerid,0xFF00FF),"You're not authorized to use that command");  
new tmpspace = strfind(cmdtext," ",true,11);  
if(!cmdtext[11])return SendClientMessage(playerid,0xFF0000FF,"USAGE: /MakeAdmin <playerid> <admin level>");  
if(!cmdtext[tmpspace+1])return SendClientMessage(playerid,0xFF0000FF,"USAGE: /MakeAdmin <playerid> <admin level>");  
PlayerInfo[strval(cmdtext[11])][AdminLevel]=strval(cmdtext[tmpspace+1]);  
new tmpstring[128];  GetPlayerName(strval(cmdtext[11]),tmpstring,MAX_PLAYER_NAME);  
format(tmpstring,128,"You made %s AdminLevel %d",tmpstring,strval(cmdtext[tmpspace+1]));  
SendClientMessage(playerid,0xFFFFFFFF,tmpstring);  
GetPlayerName(playerid,tmpstring,MAX_PLAYER_NAME);  
format(tmpstring,128,"%s made you AdminLevel %d",tmpstring,strval(cmdtext[tmpspace+1])); 
 return SendClientMessage(strval(cmdtext[11]),0xFFFFFFFF,tmpstring);}
Reply
#2

Save their name in a file or create a file with their name & the level inside. Then all you need to do is, on login set their level to the level in their file and bam you're done. It's not really that difficult. I shouldn't really need to post the code.
Reply
#3

I mean, how can do this while they are offline and im online? from in game
Reply
#4

Like I just described lol

You could also skip the middle man and directly edit their player file.
Reply
#5

He said "While IG" not in the userfiles.
Reply
#6

Just Edit their Levels in Users => <TheirFile>. Doesn't need to create a Command for it.
Reply
#7

Quote:
Originally Posted by DouglasRamirez
Посмотреть сообщение
He said "While IG" not in the userfiles.
That's what I said multiple times.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)