SA-MP Forums Archive
Restrict Class - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Restrict Class (/showthread.php?tid=154129)



Restrict Class - Timmmy - 12.06.2010

So I'm running a small TDM server and I'm wanting to restrict a class to admin only, then one for donators/vips. Can someone tell me how I would go about doing this? Thanks.


Re: Restrict Class - Calgon - 12.06.2010

https://sampwiki.blast.hk/wiki/OnPlayerRequestClass

You can detect which class is being requested, if the class is something you wish to restrict, you can simply place a conditional block of code to deny them from getting the skin if they don't meet the requisites.

For example (wiki page):

pawn Код:
public OnPlayerRequestClass(playerid,classid)
{
  if(classid == 3 && !IsPlayerAdmin(playerid))
  {
    SendClientMessage(playerid,COLOR_GREEN,"This skin is only for admins!");
  }
  return 1;
}
Only RCON administrators can use class 3.