Holds true?
#1

Please correct if wrong.

Код:
YCMD:setlevel(playerid, params[], help)
{
	new id;
	new pAdminLevel2;
	new string[64];
	if(IsPlayerConnected(id))
{
	if(PlayerInfo[playerid][pAdmin] == 5)
{
	if(!sscanf(params, "ui", id, pAdminLevel2))
{
	if((pAdminLevel2 >= 1 && pAdminLevel2 <= 5) || pAdminLevel2 == 0)
{
	new name[MAX_PLAYER_NAME], PlrName[MAX_PLAYER_NAME];
	GetPlayerName(playerid, name, sizeof(name));
	GetPlayerName(id, PlrName, sizeof(PlrName));
	format(string, sizeof(string), "Админисратор %s дал Вам %d уровень администратора.", name, pAdminLevel2);
	SendClientMessage(id, COLOR_GREEN, string);
	format(string, sizeof(string), "Вы дали %d уровень администратора игроку %s.", pAdminLevel2, PlrName);
	SendClientMessage(playerid, COLOR_GREEN, string);
	PlayerInfo[id][pAdmin] = pAdminLevel2;
   	GetPlayerName(playerid, PlrName, sizeof(PlrName));
	format(string, sizeof(string), "Users/%s.ini", PlrName);
	new INI:File = INI_Open(UserPath(playerid)); //Откроет файл
	INI_WriteInt(File,"Admin Level",PlayerInfo[playerid][pAdmin]);
	INI_Close(File);
	return 1;
}
	else return SendClientMessage(playerid, 0xD8D8D8FF, "Максимум уровней 5.");
}
	else return SendClientMessage(playerid, 0xD8D8D8FF, "Используйте: /setlevel [ID игрока] [уровень].");
}
	else return SendClientMessage(playerid, 0xD8D8D8FF, "Вы не администратор.");
}
	else return SendClientMessage(playerid, 0xD8D8D8FF, "Неверный ID.");
}
Reply
#2

Why do you think there's something wrong? For me, it looks fine.
Reply
#3

Are there any errors etc? Or warnings?
Reply
#4

Quote:
Originally Posted by Andrew163
Посмотреть сообщение
Please correct if wrong.
We are not a personal correction service, if you're expecting any help then the least thing you could do is explain what your issue is.
Reply
#5

Quote:
Originally Posted by Andrew163
Посмотреть сообщение
Please correct if wrong.

Код:
YCMD:setlevel(playerid, params[], help)
{
	new id;
	new pAdminLevel2;
	new string[64];
	if(IsPlayerConnected(id))
{
	if(PlayerInfo[playerid][pAdmin] == 5)
{
	if(!sscanf(params, "ui", id, pAdminLevel2))
{
	if((pAdminLevel2 >= 1 && pAdminLevel2 <= 5) || pAdminLevel2 == 0)
{
	new name[MAX_PLAYER_NAME], PlrName[MAX_PLAYER_NAME];
	GetPlayerName(playerid, name, sizeof(name));
	GetPlayerName(id, PlrName, sizeof(PlrName));
	format(string, sizeof(string), "Админисратор %s дал Вам %d уровень администратора.", name, pAdminLevel2);
	SendClientMessage(id, COLOR_GREEN, string);
	format(string, sizeof(string), "Вы дали %d уровень администратора игроку %s.", pAdminLevel2, PlrName);
	SendClientMessage(playerid, COLOR_GREEN, string);
	PlayerInfo[id][pAdmin] = pAdminLevel2;
   	GetPlayerName(playerid, PlrName, sizeof(PlrName));
	format(string, sizeof(string), "Users/%s.ini", PlrName);
	new INI:File = INI_Open(UserPath(playerid)); //Откроет файл
	INI_WriteInt(File,"Admin Level",PlayerInfo[playerid][pAdmin]);
	INI_Close(File);
	return 1;
}
	else return SendClientMessage(playerid, 0xD8D8D8FF, "Максимум уровней 5.");
}
	else return SendClientMessage(playerid, 0xD8D8D8FF, "Используйте: /setlevel [ID игрока] [уровень].");
}
	else return SendClientMessage(playerid, 0xD8D8D8FF, "Вы не администратор.");
}
	else return SendClientMessage(playerid, 0xD8D8D8FF, "Неверный ID.");
}
When you run this. Do you get any Error?
Or What type of help you looks for ?
We can Correct only if there any Error or any problame. we can't Correct properly working Script/CMD
Reply
#6

I first use YCMD. I thought I had made a mistake.

This is also true?:
Код:
new INI:File = INI_Open(UserPath(playerid)); //Откроет файл
INI_WriteInt(File,"Admin Level",PlayerInfo[playerid][pAdmin]);
INI_Close(File);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)