SA-MP Forums Archive
Command problem, help = +rep - 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: Command problem, help = +rep (/showthread.php?tid=567527)



Command problem, help = +rep - MrCallum - 14.03.2015

Fixed.


Re: Command problem, help = +rep - Evocator - 14.03.2015

You need to look into your code more.
Код:
CMD:c(playerid, params[])
{
	if(PlayerInfo[playerid][pMod] >= 1 || PlayerInfo[playerid][pAdmin] >= 1)
	{
	    if(!isnull(params))
		{
	        new
	            szMessage[128],
				rank[30],
				mrank[50]
			;

			switch (PlayerInfo[playerid][pAdmin])
			{
			    case 1: rank = "Server Moderator";
			    case 2: rank = "Junior Adminstrator";
			    case 3: rank = "General Administrator";
			    case 4: rank = "Supervisor";
			    case 5: rank = "Community Manager";
			    case 6: rank = "Community Operations Manager";
			    case 7: rank = "Community Developer";
			    case 8: rank = "Assistant Executive Director";
			    case 9: rank = "Executive Director";
			    default: rank = "Undefined Staff";
			}
			switch (PlayerInfo[playerid][pMod])
			{
			    case 1: mrank = "Junior Moderator";
			    case 2: mrank = "Community Moderator";
			    case 3: mrank = "Senior Moderator";
			    case 4: mrank = "Acting Supervisor of Moderation";
			    case 5: mrank = "Chief of Moderation";
			}

			format(szMessage, sizeof(szMessage), "[Staff Chat] %s [%s] %s:", GetPlayerNameEx(playerid), mrank, params);
			format(szMessage, sizeof(szMessage), "[Staff Chat] %s[%s]%s:", GetPlayerNameEx(playerid), mrank, params);

			SendAdvisorMessage(COLOR_COMBINEDCHAT, szMessage);
			Log("logs/cchat.log", szMessage);
		}
		else SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: (/c) [staff chat]");
	} 
	else return 0;

	return 1;
}



Re: Command problem, help = +rep - BGTrucker - 14.03.2015

Try this
pawn Код:
CMD:c(playerid, params[])
{
    if(PlayerInfo[playerid][pMod] >= 1 || PlayerInfo[playerid][pAdmin] >= 1)
        if(!isnull(params))
        {
            new szMessage[128], rank[30], mrank[50];
            switch(PlayerInfo[playerid][pAdmin])
            {
                case 1: rank = "Server Moderator";
                case 2: rank = "Junior Adminstrator";
                case 3: rank = "General Administrator";
                case 4: rank = "Supervisor";
                case 5: rank = "Community Manager";
                case 6: rank = "Community Operations Manager";
                case 7: rank = "Community Developer";
                case 8: rank = "Assistant Executive Director";
                case 9: rank = "Executive Director";
                default: rank = "Undefined Staff";
            }
            switch(PlayerInfo[playerid][pMod])
            {
                case 1: mrank = "Junior Moderator";
                case 2: mrank = "Community Moderator";
                case 3: mrank = "Senior Moderator";
                case 4: mrank = "Acting Supervisor of Moderation";
                case 5: mrank = "Chief of Moderation";
            }

            format(szMessage, sizeof(szMessage), "[Staff Chat] %s [%s] %s:", GetPlayerNameEx(playerid), mrank, params);
            format(szMessage, sizeof(szMessage), "[Staff Chat]%s[%s]%s:", GetPlayerNameEx(playerid), mrank, params);

            SendAdvisorMessage(COLOR_COMBINEDCHAT, szMessage);
            Log("logs/cchat.log", szMessage);
        }
        else SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: (/c) [staff chat]");
    return 1;
}