Help with a command - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help with a command (
/showthread.php?tid=545903)
Help with a command -
Rabea - 11.11.2014
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)
Re: Help with a command -
dominik523 - 11.11.2014
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.