Help fix /jail
#1

When using the / jail says the nickname is not the player that I chasten.
On the server, played three players ID: 0,1,2
I am a player under the jail ID-2, and wrote that I put the player under the ID-1, help fix it.

Код:
COMMAND:jail(playerid,params[])
{
	new id,name1[30],name2[30],time,timef,reason[50],text[128];
	if(Player[playerid][pAdminLevel] >= 2){
	if(sscanf(params,"uis",id,time,reason))
	return SendClientMessage(playerid,COLOR_RED,"Используйте: /jail [id] [время (в минутах)] [причина].");
	if(IsPlayerConnected(id)) {
	if(Player[id][pAdminLevel] <= Player[playerid][pAdminLevel]) {
	if(Player[playerid][pJailed] == 0) {
	GetPlayerName(playerid,name1,sizeof(name1));
	GetPlayerName(id,name2,sizeof(name2));
	format(text,sizeof(text),"Администратор %s посадил игрока %s в тюрьму на %i минут(ы). [Причина: %s].",name1,name2,time,reason);
	SendClientMessageToAll(COLOR_RED,text);
	CMDMessageToAdmins(playerid,"JAIL");
	timef = time * 60000;
	Player[id][pJailed] = 1;
	SetPlayerPos(playerid,-2816.9324,-1522.2413,140.8438);
	Player[playerid][pJailed] = 1;
	SetPlayerInterior(playerid,0);
	ResetPlayerWeapons(playerid);
	TogglePlayerControllable(playerid,false);
	SetTimerEx("UnJail",timef,false,"i",id);
	}else{
	return SendClientMessage(playerid,COLOR_RED,"Этот игрок уже сидит в тюрьме.");}
	} else {
	return SendClientMessage(playerid,COLOR_RED,"Вы не администратор!");}
	} else {
	return SendClientMessage(playerid,COLOR_RED,"Неверный ID игрока.");}
	} else {
	return SendClientMessage(playerid,COLOR_RED,"Только администратору 2 уровня доступно использовать эту комманду!");
	}
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)