what is wrong?
#3

Ok , try this.

Shout:


Код:
	if(strcmp(cmd, "/shout", true) == 0 || strcmp(cmd, "/s", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
            if(PlayerInfo[playerid][pMuted] == 1)
			{
				format(string, sizeof(string), "You can not speak, you have been silenced for %d seconds.",PlayerInfo[playerid][pMuteTime]);
				SendClientMessage(playerid, COLOR_LIGHTRED, string);
				return 1;
			}
	        if(gPlayerLogged[playerid] == 0)
	        {
	            SCM(playerid, COLOR_GREY, "   You havent logged in yet !");
	            return 1;
	        }
			GetPlayerName(playerid, sendername, sizeof(sendername));
			new length = strlen(cmdtext);
			while ((idx < length) && (cmdtext[idx] <= ' '))
			{
				idx++;
			}
			new offset = idx;
			new result[64];
			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			{
				result[idx - offset] = cmdtext[idx];
				idx++;
			}
			if(FindIP(result))
  	        {
	 		    new advertiser[MAX_PLAYER_NAME];
	 		    GetPlayerName(playerid, advertiser, sizeof(advertiser));
	   		    format(string, sizeof(string), "[AdmWarning]: %s[ID: %d] a facut reclama si a primit ban!",advertiser,playerid);
	   		    ABroadCast(COLOR_LIGHTRED,string,1);
	   		    Ban(playerid);
	   		    return 1;
            }
			result[idx - offset] = EOS;
			if(!strlen(result))
			{
				SCM(playerid, COLOR_GRAD2, "USAGE: (/s)hout [local chat]");
				return 1;
			}
			result[0] = toupper(result[0]);
			format(string, sizeof(string), "%s Shouts: %s!!", sendername, result);
			ProxDetector(30.0, playerid, string,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_FADE1,COLOR_FADE2);
			printf("%s", string);
			new y,m,d;
		    new h,mi,s;
  		    getdate(y,m,d);
 	   	 	gettime(h,mi,s);
   		    format(string, sizeof(string), "(%d/%d/%d)[%d:%d:%d][Shout] %s: %s",d,m,y,h,mi,s, sendername, result);
   		    ChatLog(string);
		}
		return 1;
	}
/me

Код:
	if(strcmp(cmd, "/me", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
            if(PlayerInfo[playerid][pMuted] == 1)
			{
				format(string, sizeof(string), "You can not speak, you have been silenced for %d seconds.",PlayerInfo[playerid][pMuteTime]);
				SendClientMessage(playerid, COLOR_LIGHTRED, string);
				return 1;
			}
	        if(gPlayerLogged[playerid] == 0)
	        {
	            SCM(playerid, COLOR_GREY, "   You havent logged in yet !");
	            return 1;
	        }
			GetPlayerName(playerid, sendername, sizeof(sendername));
			new length = strlen(cmdtext);
			while ((idx < length) && (cmdtext[idx] <= ' '))
			{
				idx++;
			}
			new offset = idx;
			new result[64];
			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			{
				result[idx - offset] = cmdtext[idx];
				idx++;
			}
			if(FindIP(result))
  	        {
	 		    new advertiser[MAX_PLAYER_NAME];
	 		    GetPlayerName(playerid, advertiser, sizeof(advertiser));
	   		    format(string, sizeof(string), "[AdmWarning]: %s[ID: %d] a facut reclama si a primit ban!",advertiser,playerid);
	   		    ABroadCast(COLOR_LIGHTRED,string,1);
	   		    Ban(playerid);
	   		    return 1;
            }
			result[idx - offset] = EOS;
			if(!strlen(result))
			{
				SCM(playerid, COLOR_GRAD2, "USAGE: /me [action]");
				return 1;
			}
			result[0] = toupper(result[0]);
			format(string, sizeof(string), "* %s %s", sendername, result);
			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			printf("%s", string);
			new y,m,d;
		    new h,mi,s;
  		    getdate(y,m,d);
 	   	 	gettime(h,mi,s);
   		    format(string, sizeof(string), "(%d/%d/%d)[%d:%d:%d][Me] %s: %s",d,m,y,h,mi,s, sendername, result);
   		    ChatLog(string);
		}
		return 1;
	}
This wil work!
Reply


Messages In This Thread
what is wrong? - by mineralo - 05.01.2012, 11:31
Re: what is wrong? - by mineralo - 05.01.2012, 11:53
Re: what is wrong? - by sTefaNNN - 05.01.2012, 12:07

Forum Jump:


Users browsing this thread: 1 Guest(s)