%i time...
#3

On top of your gamemode,or wherever before the command:

pawn Код:
new coutn;
new counttimer;

forward JailTime(playerid);
pawn Код:
COMMAND:adminjail(playerid,params[])
{
   if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_RED,"You're not admin");
   else
   {
      new time,playerid2;
      if(sscanf(params("ud",playerid,time)) return SendClientMessage(playerid,COLOR_RED,"USAGE:/adminjail [ID] [Time(in seconds)]");
      coutn=time;
      SetPlayerPos(playerid2,JAIL COORDINATES);
      counttimer=SetTimerEx("JailTime",1000,1,"i",playerid2);
      SendClientMessage(playerid,COLOR_GREEN,"Player has been jailed");
      SendClientMessage(playerid2,COLOR_RED,"You have been jailed by an admin!");
   }
 return 1;
}
After the command:
pawn Код:
public JailTime(playerid)
{
   countn--;
   if(countn<=-1)
   {
      KillTimer(counttimer);
      SetPlayerPos(playerid,OUTSIDEJAIL COORDINATES);
      SendClientMessage(playerid,COLOR_GREEN,"Unjailed!");
   }
 return 1;
}
I typed this in less then 5 mins,so,adapt it to your specifications :P
Reply


Messages In This Thread
%i time... - by Gooday - 06.04.2012, 14:22
Re: %i time... - by MP2 - 06.04.2012, 14:29
Re: %i time... - by Cjgogo - 06.04.2012, 14:29
Re: %i time... - by MP2 - 06.04.2012, 14:31
Re: %i time... - by AndreT - 06.04.2012, 14:38
Re: %i time... - by Gooday - 06.04.2012, 14:39
Re: %i time... - by Cjgogo - 06.04.2012, 14:41
Re: %i time... - by Gooday - 06.04.2012, 15:23
Re: %i time... - by Harish - 07.04.2012, 07:32

Forum Jump:


Users browsing this thread: 1 Guest(s)