makepremium command?
#7

Quote:
Originally Posted by HazardouS
Посмотреть сообщение
Here you go. I've added only the basic stuff, you can format the strings before sending them so you can include the target player name in the message sent to the admin, for example.

Код:
COMMAND:makepremium(playerid, params[])
{
	if(!IsPlayerConnected(playerid)) return 1;
	if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, red, "Error: You must be an Admin to use that command.");
	new targetID;
	if(sscanf(params, "u", targetID)) return SendClientMessage(playerid, red, "Error: Syntax error.");
	if(!IsPlayerConnected(targetID)) return SendClientMessage(playerid, red, "Error: Player not connected.");
	new playerfile[128], pname[MAX_PLAYER_NAME];
	GetPlayerName(targetID, pname, sizeof(pname));
	format(playerfile, sizeof(playerfile), "Premium/Users/%s.ini", pname);
	if(dini_Exists(playerfile)) return dini_IntSet(playerfile, "Level", 1);
	SendClientMessage(playerid, -1, "You have given Premium to a player");
	SendClientMessage(targetID, -1, "You have received Premium from an Admin.");
	return 1;
}
many thx dude! if i would like to do like that? You have received Premium from Admin %s ?
Reply


Messages In This Thread
makepremium command? - by VanillaRain - 05.08.2015, 16:50
Re: makepremium command? - by SpikeSpigel - 05.08.2015, 17:10
Re: makepremium command? - by HazardouS - 05.08.2015, 17:12
Re: makepremium command? - by VanillaRain - 05.08.2015, 17:13
Re: makepremium command? - by VanillaRain - 05.08.2015, 17:18
Re: makepremium command? - by HazardouS - 05.08.2015, 17:25
Re: makepremium command? - by VanillaRain - 05.08.2015, 17:27
Re: makepremium command? - by HazardouS - 05.08.2015, 17:31
Re: makepremium command? - by VanillaRain - 05.08.2015, 17:35
Re: makepremium command? - by HazardouS - 05.08.2015, 17:37

Forum Jump:


Users browsing this thread: 1 Guest(s)