Can't solve it, hopeless please help me.
#1

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;
}
Reply
#2

This code is very messy and disorganized. I cleaned the code up and put it on pastebin, but I don't really understand what you are trying to accomplish. Can you explain a bit more?
Reply
#3

He's attempting to make it so only admins can use that command. This might work.

http://pastebin.com/EJzSbfr3
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)