Argument Type Mismatch (argument 1)
#1

So, im trying to open some prison gates when the password "gov123" is entered, and I screwed up somewhere, ill rep for the answer

Код:
CMD:gate(playerid, params[])
{
    new
        subcmd[ 6 ],
        password;

    if( sscanf( params, "ss", subcmd, password ))
        return SendClientMessage( playerid, 0xFFFFFFFF, "/gate [open/close] [password]" );

    if( !strcmp( subcmd, "open", true ))
    {
         if( !strcmp( password, "gov123", true )) <====ERROR
         {
             if(IsPlayerInRangeOfPoint(playerid, 5.0, -2819.3171,  2651.5464, 103.3268))
				{
				MoveObject(pgate1, -2819.3171, 2648.8591, 103.3268, 3.0);
				return 1;
				}
			if(IsPlayerInRangeOfPoint(playerid, 5.0, -2855.7876, 2659.5562, 107.6278))
				{
				MoveObject(pgate2, -2855.7678, 2656.9021, 107.6278, 3.0));
				return 0;
				}
         }
    }
    else
    {
        if(IsPlayerInRangeOfPoint(playerid, 5.0, -2819.3171,  2651.5464, 103.3268))
				{
				MoveObject(pgate1, -2819.3171,  2651.5464, 103.3268, 3.0);
				return 1;
				}
  			if(IsPlayerInRangeOfPoint(playerid, 5.0, -2855.7876, 2659.5562, 107.6278))
				{
				MoveObject(pgate2, -2855.7678, 2659.5361, 107.6278, 3.0);
				return 1;
				}
    }
    return true;
}
Reply
#2

Post the line that is getting errors

EDIT: Sorry, Didn't see the line you marked
Reply
#3

RESOLVED, used 2 commands for the gates
Reply
#4

Try this:
pawn Код:
CMD:gate(playerid, params[])
{
    new subcmd[4], password[6];

    if (!sscanf(params, "s[4]s[6]", subcmd, password))
    {
        if (strcmp(subcmd, "open", true)==0)
        {
            if(strcmp(password, "gov123", true)==0)
            {
                if(IsPlayerInRangeOfPoint(playerid, 5.0, -2819.3171,  2651.5464, 103.3268))
                            {
                                MoveObject(pgate1, -2819.3171, 2648.8591, 103.3268, 3.0);
                                return 1;
                }
                else if(IsPlayerInRangeOfPoint(playerid, 5.0, -2855.7876, 2659.5562, 107.6278))
                {
                                MoveObject(pgate2, -2855.7678, 2656.9021, 107.6278, 3.0));
                                return 1;
                }
                else if(IsPlayerInRangeOfPoint(playerid, 5.0, -2819.3171,  2651.5464, 103.3268))
                            {
                                MoveObject(pgate1, -2819.3171,  2651.5464, 103.3268, 3.0);
                    return 1;
                }
                       else if(IsPlayerInRangeOfPoint(playerid, 5.0, -2855.7876, 2659.5562, 107.6278))
                            {
                                MoveObject(pgate2, -2855.7678, 2659.5361, 107.6278, 3.0);
                                return 1;
                }
            }
            else return SendClientMessage( playerid, 0xFFFFFFFF, "Wrong password!" );
        }
        else return SendClientMessage( playerid, 0xFFFFFFFF, "/gate [open/close] [password]");
    }
    else return SendClientMessage( playerid, 0xFFFFFFFF, "/gate [open/close] [password]" );
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)