Jump to content
  • 0

problema /pm


ionutuidumanu

Question

8 answers to this question

Recommended Posts

if(strcmp("/pm", cmd, true) == 0)

{

tmp = strtok(cmdtext,idx);

if(!strlen(tmp) || strlen(tmp) > 5) {

SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"Usage: /pm (id) (message)");

return 1;

}

        gMessage = strrest(cmdtext,idx);

if(!strlen(gMessage)) {

SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"Usage: /pm (id) (message)");

return 1;

}

if(!IsPlayerConnected(id)) {

SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"/pm : Bad player ID");

return 1;

}

if(playerid != id) {

GetPlayerName(id,iName,sizeof(iName));

GetPlayerName(playerid,pName,sizeof(pName));

format(Message,sizeof(Message),">> %s(%d): %s",iName,id,gMessage);

SendClientMessage(playerid,PM_OUTGOING_COLOR,Message);

format(Message,sizeof(Message),"** %s(%d): %s",pName,playerid,gMessage);

SendClientMessage(id,PM_INCOMING_COLOR,Message);

PlayerPlaySound(id,1085,0.0,0.0,0.0);

printf("PM: %s",Message);

}

else {

SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"You cannot PM yourself");

}

return 1;

    }

The Legend

Link to comment
Share on other sites

Ce e cu comanda aia :))

Foloseste-o pe asta

	if(strcmp(cmd, "/pm", true) == 0 || strcmp(cmd, "/pme", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	        if(gPlayerLogged[playerid] == 0)
	        {
	            SendClientMessage(playerid, COLOR_GREY, "   You havent logged in yet!");
	            return 1;
	        }
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/p)me [playerid/PartOfName] [text]");
				return 1;
			}
			giveplayerid = ReturnUser(tmp);
			if (IsPlayerConnected(giveplayerid))
			{
			    if(giveplayerid != INVALID_PLAYER_ID)
			    {
			        if(HidePM[giveplayerid] > 0)
			        {
			            SendClientMessage(playerid, COLOR_GREY, "   That player is blocking messages!");
			            return 1;
			        }
					GetPlayerName(playerid, sendername, sizeof(sendername));
					GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
					if(giveplayerid == playerid)
					{
						format(string, sizeof(string), "* %s mutters something to himself.", sendername);
						ProxDetector(5.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
					}
					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++;
					}
					result[idx - offset] = EOS;
					if(!strlen(result))
					{
						SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/p)me [playerid/PartOfName] [text]");
						return 1;
					}
					if(FindIP(result)) ///
	{
	   new advertiser[MAX_PLAYER_NAME];
	   GetPlayerName(playerid, advertiser, sizeof(advertiser));
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   SendClientMessageToAll(COLOR_LIGHTGREEN, " ");
	   format(string, sizeof(string), "[Warning]: %s face reclama ",advertiser);
	   ABroadCast(COLOR_LIGHTRED,string,1);
	   return 0;
	}
					format(string, sizeof(string), "[ID:%d] %s pm: %s", playerid, sendername, (result));
					SendClientMessage(giveplayerid, 0xBBA033AA, string);
					format(string, sizeof(string), "PM sent to [ID:%d]%s: %s", giveplayerid, giveplayer, (result));
					SendClientMessage(playerid,  0xE5C43EAA, string);
					format(string, sizeof(string), "%s pm to %s: %s", sendername, giveplayer, (result));
					PmLog(string);
					return 1;
				}
			}
			else
			{
					format(string, sizeof(string), "   %d is not an active player.", giveplayerid);
					SendClientMessage(playerid, COLOR_GRAD1, string);
			}
		}
		return 1;
	}

Link to comment
Share on other sites

am bagat comanda cand dau copile imi da 4 erori:

D:\Imagini\New Folder\La\gamemodes\La.pwn(3810) : error 017: undefined symbol "gPlayerLogged"

D:\Imagini\New Folder\La\gamemodes\La.pwn(3810) : warning 215: expression has no effect

D:\Imagini\New Folder\La\gamemodes\La.pwn(3810) : error 001: expected token: ";", but found "]"

D:\Imagini\New Folder\La\gamemodes\La.pwn(3810) : error 029: invalid expression, assumed zero

D:\Imagini\New Folder\La\gamemodes\La.pwn(3810) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

4 Errors.

The Legend

Link to comment
Share on other sites

Am pus aia Spedy dar acum imi da 6 erori

D:\Imagini\ia\gamemodes\ia.pwn(3819) : error 017: undefined symbol "COLOR_GRAD2"

D:\Imagini\ia\gamemodes\ia.pwn(3822) : error 017: undefined symbol "ReturnUser"

D:\Imagini\ia\gamemodes\ia.pwn(3827) : error 017: undefined symbol "HidePM"

D:\Imagini\ia\gamemodes\ia.pwn(3827) : warning 215: expression has no effect

D:\Imagini\ia\gamemodes\ia.pwn(3827) : error 001: expected token: ";", but found "]"

D:\Imagini\ia\gamemodes\ia.pwn(3827) : error 029: invalid expression, assumed zero

D:\Imagini\ia\gamemodes\ia.pwn(3827) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

6 Errors.

The Legend

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.