02.10.2010, 10:33
I tired to make Adminduty script that only if the player is already an Admin he can use, but It doesn't work everyplayer can use that command.
pawn Код:
if(strcmp("/Adminduty", cmdtext, true, 6) == 0)
{
new pfile[256];
GetPlayerName(playerid, playername1, sizeof(playername1));
format(pfile,sizeof(pfile),"Users/%s.ini",playername1);
if(!dini_Exists(pfile)) { dini_Create(pfile);
dini_Set(pfile,"Admin",tmp);
}
new string[64];
if(!dini_Exists(pfile)) { format(string, sizeof(string), "Permission denied !");
SendClientMessage(playerid, 0xFF4646FF, string);
return 1;
}
new logged[MAX_PLAYERS];
if(!strcmp(tmp,dini_Get(pfile,"Admin"),true)) { logged[playerid] = 1;
SendClientMessage(playerid, 0xFF4646FF, " You are now on Adminduty");
} else { SendClientMessage(playerid, 0xFF4646FF, " Error: Invalid password "); }
SetPlayerColor(playerid,0x057AA0FF);
return 1;
}