I need a "/prison [Id] [Minutes] [Reason]" command
#6

Код:
		if(!strcmp(cmdtext, "/prison", true,5))
		{
 			new vardas[MAX_PLAYER_NAME],prz[128];
			strmid(vardas,GetArgument(1, cmdtext,0),0,MAX_PLAYER_NAME);
			if(!strcmp(vardas, "0", true) ){SendClientMessage(playerid, 0xD9E916FF, "* Move player to prison: /prison [name] [seconds]"); return 1;}
			new id = GetPlayeridMid(vardas);
			if (id == INVALID_PLAYER_ID){ SendClientMessage(playerid, 0xD9E916FF, "* Invalid name"); return 1;}
			if (playerDB[id][admin]){ SendClientMessage(playerid, 0xD9E916FF, "* You cant move administrator to prison."); return 1;}

      strmid(prz,GetArgument(2, cmdtext,true),0,128);
			if(!IsNumeric(prz)){SendClientMessage(playerid, 0xD9E916FF, "*Wrong time."); return 1;}
			new laikas = StringToInt(prz);

      new msg[128];
	  	GetPlayerName(id,vardas,sizeof(vardas));
      JailPlayer(id,227.3138,108.9786,999.0156,0,laikas*1000,10,-1597.6338,716.4904,11.7759,341.3682,0,true);
    	format(msg,sizeof(msg),"[prison] You jailed %s (%is).",vardas,laikas);
    	SendClientMessage(id,0xD9E916FF,"* You have jailed by administrator.");
			SendClientMessage(playerid,0xD9E916FF,msg);
			return 1;
		}
Im not sure is it good script but lets try
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)