PM script help
#1

Hi, i have this, sript, but i want to write that the PM message will only be able for admins
Код:
CMD:pm(playerid, params[])
{
    
	new gid, szovege[128];
	if(sscanf(params, "us[128]", gid, szovege)) return SCM(playerid, COLOR_GREY, "Hasznбlat: /pm [ID] [ьzenet]");
	if(nopm[playerid] == true  && pInfo[playerid][admin] == 0)
	{
 		Malibu(playerid, "Kikapcsoltad a privбt ьzenet kьldйst!");
	    return 1;
	}
	if(nopm[gid] == true && pInfo[playerid][admin] == 0)
	{
 		Malibu(playerid, "A jбtйkos kikapcsolta a privбt ьzenetek fogadбsбt.");
	    return 1;
	}
	if(pInfo[gid][admin] > 0 && pmwarnolva[playerid] == false)
	{
	    ShowPlayerDialog(playerid, pmwarn, DIALOG_STYLE_MSGBOX,
		"{ff0000}FIGYELEM!",
		"{ffffff}Йpp PM-et kьldessz egy {ff0000}adminisztrбtornak.\n{ff0000}TILOS {ffffff}szerverrel kapcsolatos kйrdйst feltenni.\nAmennyiben a fentit szeretnйd, hasznбld a {ffc400}/report{ffffff} parancsot.\nAmennyiben mйgis admint zaklatsz, bьntetйsben rйszesьlhetsz.",
		"OK", "");
		pmwarnolva[playerid] = true;
	    return 1;
	}
	if(pInfo[gid][admin] < 1)
	{

	}
	else
	{
		format(stra, 256, "{de2a2a}[PM]{d4b0b0} %s -> %s: {bfbfbf}%s", pName(playerid), pName(gid), szovege);
		SCM(gid, -1, stra);
		SCM(playerid, -1, stra);
		//format(stra, 256, ">> %s {de2a2a}[JБTЙKOS PM] {d4b0b0}%s: {bfbfbf}%s", pName(gid), pName(playerid), szovege);
		for(new i;i<MAX_PLAYERS;i++)
		{
		    if(IsPlayerConnected(i))
		    {
			    if(pInfo[i][admin] > 0 && pmbe[i] == 1 && i != playerid)
			    {
					SCM(i, -1, stra);
			    }
			}
	}
	return 1;
	}
	return 1;
}
Reply
#2

just add:
Код:
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"[Error]: You Are Not An Admin!");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)