Help with a command
#1

okay, i have a /area command that shows somones area, i need it when somone wearing a mask i can't /area him any one can help me?
pawn Код:
CMD:area(playerid,params[])
{
    new Zone[34],Name[24],string[130],targetid;
    if(!IsACop(playerid) && !IsAHSF(playerid) && !IsAFBI(playerid) && !IsAARMY(playerid) && !IsASATF(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not a LAW member.");
    if(sscanf(params, "u", targetid))return SendClientMessage(playerid, -1, "USAGE: /area [playerid]");
    if(targetid == INVALID_PLAYER_ID)return SendClientMessage(playerid, -1, "Invalid player id.");
    if(GetPlayerInterior(targetid)) return SendClientMessage(playerid, COLOR_GREY, "Player is in an interior.");
        GetPlayerName(targetid,Name,24);
        GetPlayer2DZone(targetid,Zone,sizeof(Zone));
        format(string,sizeof(string),"%s is at %s",Name,Zone);
        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}

and here somthing can help you
pawn Код:
if(PlayerInfo[playerid][pMaskOn] == 1)
Reply
#2

pawn Код:
CMD:area(playerid,params[])
{
    new Zone[34],Name[24],string[130],targetid;
    if(!IsACop(playerid) && !IsAHSF(playerid) && !IsAFBI(playerid) && !IsAARMY(playerid) && !IsASATF(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not a LAW member.");
    if(sscanf(params, "u", targetid))return SendClientMessage(playerid, -1, "USAGE: /area [playerid]");
    if(targetid == INVALID_PLAYER_ID)return SendClientMessage(playerid, -1, "Invalid player id.");
    if(PlayerInfo[targetid][pMaskOn] == 1) return SendClientMessage(-1, "bla bla"); // Not sure do you want playerid or targetid
    if(GetPlayerInterior(targetid)) return SendClientMessage(playerid, COLOR_GREY, "Player is in an interior.");
    GetPlayerName(targetid,Name,24);
    GetPlayer2DZone(targetid,Zone,sizeof(Zone));
    format(string,sizeof(string),"%s is at %s",Name,Zone);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
    return 1;
}
Don't forget to return 1 at the end of any command.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)