/ajail
#1

Hey guys, I need help with this /ajail command - I want it so that I can add a reason instead of just putting them in /ajail and also so that everyone on the server can see that the person has been /ajailed and the reason why

Код:
 	if(strcmp(cmd, "/ajail", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[USAGE:] /ajail [playerid] [minutes]");
				return 1;
			}
			new playa;
			new money;
			playa = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			money = strval(tmp);
			if (PlayerInfo[playerid][pAdmin] >= 2)
			{
			  if(IsPlayerConnected(playa))
			  {
			    if(playa != INVALID_PLAYER_ID)
			    {
						format(string, sizeof(string), "You jailed %s.", GetPlayerNameEx(playa));
						SendClientMessage(playerid, COLOR_LIGHTYELLOW2, string);
						format(string, sizeof(string), "You where jailed by %s for %d minutes.", GetPlayerNameEx(playerid),money);
						SendClientMessage(playa, COLOR_LIGHTYELLOW2, string);

						ResetPlayerWeapons(playa);
						WantedPoints[playa] = 0;
						PlayerInfo[playa][pJailed] = 1;
						PlayerInfo[playa][pJailTime] = money*60;
						SetPlayerInterior(playa, 6);
						SetPlayerPos(playa, 264.6288,77.5742,1001.0391);
						SetPlayerVirtualWorld(playerid,2);
					}
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[ERROR:] Your not an administrator.");
			}
		}
		return 1;
	}
Many thanks,
Sam.
Reply


Messages In This Thread
/ajail - by Agent Smith - 08.05.2009, 17:55
Re: /ajail - by Dark_Kostas - 08.05.2009, 17:59
Re: /ajail - by Agent Smith - 08.05.2009, 18:02
Re: /ajail - by Dark_Kostas - 08.05.2009, 18:02
Re: /ajail - by Agent Smith - 08.05.2009, 18:08
Re: /ajail - by hoodline - 08.05.2009, 18:16
Re: /ajail - by Agent Smith - 08.05.2009, 18:22
Re: /ajail - by Dark_Kostas - 08.05.2009, 18:36
Re: /ajail - by Agent Smith - 08.05.2009, 18:39
Re: /ajail - by Dark_Kostas - 08.05.2009, 18:42

Forum Jump:


Users browsing this thread: 1 Guest(s)