Sending 'You are not a Cop!' to everyone.
#3

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/opendoor", true))
        {
        if(PlayerToPoint(2, playerid,1551.7325,-1690.1208,1723.1050))
            {
            if(IsACop(playerid))
                {
                MoveObject(pddoor1,1554.59216309, -1691.42968750, 1722.10498047, 1.5);
                MoveObject(pddoor2,1549.44067383, -1691.4589843, 1722.10498047, 1.5);
                SetTimer("pdoor1", 5000, 0);
                SendClientMessage(playerid, COLOR_GRAD2, "* The door will be closed in 5 seconds.");
                ApplyAnimation(playerid, "HEIST9", "Use_SwipeCard", 10.0, 0, 0, 0, 0, 0);
                SetTimer("OnPlayerPressButton_Delay", 500, 0);
                }
            else return SendClientMessage(playerid, COLOR_GRAD2, "You are not a Cop!");
            }
        else return SendClientMessage(playerid, COLOR_GRAD2, "You are not near the PD doors!");
        }
    else return SendClientMessage(playerid, COLOR_GRAD2, "SERVER: Unknown command.");
}
That should do the trick, I don't know the PlayerToPoint function ( As it's custom? At least, I have never seen it before. ) but your fault was you did put the 'else...... SendClientMessage(playerid, COLOR_GRAD2, "You are not a Cop!");' for if they weren't close enough to the doors, now it's in the right position.

Jesse
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)