SA-MP Forums Archive
Restrict on bots - 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: Restrict on bots (/showthread.php?tid=508809)



Restrict on bots - Ananisiki - 23.04.2014

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.");



Re: Restrict on bots - Affan - 24.04.2014

Show us one of the command please?


Re: Restrict on bots - DobbysGamertag - 24.04.2014

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


Re: Restrict on bots - Ananisiki - 24.04.2014

Is it (!IsPlayerNPC(pID)) or (IsPlayerNPC(pID)) ?


Re: Restrict on bots - DobbysGamertag - 24.04.2014

The second one