Restrict on bots
#1

How i can do so admins cant use commands on npcs

I done this on sethealth command, it works but not in other commands

pawn Код:
if(IsPlayerNPC(pID) == 1) return SendClientMessage(playerid, COLOR_RED, "You Cannot Use This Command On A NPC.");
Reply
#2

Show us one of the command please?
Reply
#3

You don't need == 1

pawn Код:
CMD:somecommand(playerid,params[])
{
    new pid; //pid being the targeted player: EG /kick X
    if(IsPlayerNPC(pid))return SendClientMessage(playerid,-1,"You cannot use commands on NPCs");
    return 1;
}
https://sampwiki.blast.hk/wiki/IsPlayerNPC
Reply
#4

Is it (!IsPlayerNPC(pID)) or (IsPlayerNPC(pID)) ?
Reply
#5

The second one
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)