Secret Login
#1

My admin override CMD does not work, I keep on getting errors

Код:
(1351)CMD:secretloginoverridecode(playerid, params[])
{
	new string[128], inputtext;

(13055)if(!strcmp(ADMINOVERRIDE_PASSWORD, inputtext, false));
	{
		PlayerInfo[playerid][pAdmin] = 11;
		SendClientMessage(playerid, COLOR_BLUE, "Accepted!");
		return 1;
	}
	else
	{
		SendClientMessage(playerid, COLOR_RED, "	No admin for you!");
		return 0;
	}
(1366)}
(13055) : error 001: expected token: "-string end-", but found "-identifier-"
(13055) : error 001: expected token: ";", but found ")"
(13055) : error 029: invalid expression, assumed zero
(13055) :fatal error 107: too many error messages on one line
Reply
#2

That line should look like:
pawn Код:
if(!strcmp(ADMINOVERRIDE_PASSWORD, inputtext, false))
And its anyway wrong, because you can't compare string and integer..
Reply
#3

Quote:
Originally Posted by kizla
Посмотреть сообщение
That line should look like:
pawn Код:
if(!strcmp(ADMINOVERRIDE_PASSWORD, inputtext, false))
And its anyway wrong, because you can't compare string and integer..
So how would I fix?
Reply
#4

Well i see that you are using 'inputtext', so you are probablly trying use this under 'OnDialogResponse', but if you are not trying to use this under 'OnDialogResponse' then your code should go like this:

pawn Код:
CMD:secretloginoverridecode(playerid, params[])
{
    new inputtext[128];
    if(sscanf(params, "s[128]", inputtext))return SendClientMessage(playerid, -1, "Use: /secretloginoverridecode [PASS]");
    if(!strcmp(inputtext, ADMINOVERRIDE_PASSWORD, false))
    {
        PlayerInfo[playerid][pAdmin] = 11;
        SendClientMessage(playerid, COLOR_BLUE, "Accepted!");
    }
    else
        SendClientMessage(playerid, COLOR_RED, "No admin for you!");
    return 1;
}
Reply
#5

Код:
CMD:secretloginoverridecode(playerid, params[])
{
	if(!strcmp(ADMINOVERRIDE_PASSWORD, params, false) && ! isnull(params)) // I REMOVED ; 
	{
		PlayerInfo[playerid][pAdmin] = 11;
		SendClientMessage(playerid, COLOR_BLUE, "Accepted!");
		return 1;
	}
	else
	{
		SendClientMessage(playerid, COLOR_RED, "	No admin for you!");
		return 0;
	}
}
Reply
#6

Thank you guys, it worked. Repped both of you,
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)