07.04.2013, 21:55
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;
}