SA-MP Forums Archive
Holds true? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Holds true? (/showthread.php?tid=390075)



Holds true? - Andrew163 - 04.11.2012

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.");
}



Re: Holds true? - [KHK]Khalid - 04.11.2012

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


Re: Holds true? - HarryPotter - 04.11.2012

Are there any errors etc? Or warnings?


Re: Holds true? - Hiddos - 04.11.2012

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.


Re: Holds true? - bathushan - 04.11.2012

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


Re: Holds true? - Andrew163 - 04.11.2012

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);