Help :o3
#1

Can you help me with a command ?
I want to do a comand that I can see the private messages
/showpm
Help me please ! :-s
I tried but I failed !
Reply
#2

shows us your /pm command first. We are not mind reader.
Reply
#3

We don't really need to see the /pm command, but you need to assign a variable like

PHP код:
new acceptpm
Then in your /showpm command do somthing like
PHP код:
if(acceptpm == 1)
{
     
SendClientMessage(playerid,COLOR_WHITE,"Your pms are enabled.");
}
else if(
acceptpm == 0)
{
     
SendClientMessage(playerid,COLOR_WHITE,"Your pms are disabled.");

Not tested, but I think it'll work.

Ofcourse you'll have to edit that with what you need.
Reply
#4

Oh sorry I forgot !
My /pm command is

//----------------------------------[PM]-----------------------------------------------
if(strcmp(cmd, "/pm", true) == 0 || strcmp(cmd, "/p", true) == 0)
{
if(IsPlayerConnected(playerid))
{
{
ShowPlayerDialog(playerid,8523,DIALOG_STYLE_INPUT, "Private Message System","Enter the receiverґs ID","Done","Cancel");
return 1;
}
}
return 1;
}

I`ve tried to change it 'cause I don't like this type of dialog I wanned simple but it gave me a lot of errors. I've searched, I've found some pm commands but aren't compatible [I think] 'cause it gave me a lot of errors! :-s
Reply
#5

try this

Код:
	}
	if(strcmp(cmd, "/pm", true) == 0 || strcmp(cmd, "/p", 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, "{33CCFF}USAGE:{FFFFFF} (/p)m [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)
					{
						return SendClientMessage(playerid, COLOR_GREY, "   You can`t send private message to yourself.");
					}
					new length = strlen(cmdtext);
					while ((idx < length) && (cmdtext[idx] <= ' '))
					{
						idx++;
					}
					new offset = idx;
					new result[128];
					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, "{33CCFF}USAGE:{FFFFFF} (/p)m [playerid/PartOfName] [text]");
						return 1;
					}
					CheckPM(playerid,(result));
					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), ">>PM from [%d]%s to [%d]%s: %s", playerid,sendername,giveplayerid, giveplayer, (result));
					for(new z=0;z<PLAYERS;z++)
					    if (BigEar[z])
					        SendClientMessage(z,  0x1ED5C7FF, string);
					return 1;
				}
			}
			else
			{
					format(string, sizeof(string), "   %d is not an active player.", giveplayerid);
					SendClientMessage(playerid, COLOR_GRAD1, string);
			}
		}
		return 1;
	}
Reply
#6

If you want a simple PM command then here

PHP код:
CMD:pm(playerid,params[])
{
    new 
targetid,msg[250],str[128],pName[MAX_PLAYER_NAME];
    if(
sscanf(params,"ud",targetid,msg)) return SendClientMessage(playerid,COLOR_WHITE,"FORMAT: /pm [targetid] [message]");
    if(
targetid==INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_GRAY,"Error: Player is not connected.");
    else
    {
        
format(str,sizeof(str),"Message Recieved From %s (%d): %s",pName,playerid,msg);
        
SendClientMessage(targetid,COLOR_YELLOW,string);
        
SendClientMessage(playerid,COLOR_WHITE,"Message Sent");
    }
    return 
1;

I just quickly scripted, very simple PM command with ZCMD and SSCANF.
Reply
#7

I tried that command and it gave me some errors
Reply
#8

Quote:
Originally Posted by Alexandra.
Посмотреть сообщение
I tried that command and it gave me some errors
you using dcmd? or zcmd?
Reply
#9

I am new in scripting sorry I don't know .

and he errors at that command :

C:\Users\Andrei\Desktop\abc\a\EndGame Server Rpg\gamemodes\Teddy23.pwn(50822) : warning 217: loose indentation
C:\Users\Andrei\Desktop\abc\a\EndGame Server Rpg\gamemodes\Teddy23.pwn(50822) : error 029: invalid expression, assumed zero
C:\Users\Andrei\Desktop\abc\a\EndGame Server Rpg\gamemodes\Teddy23.pwn(50822) : error 017: undefined symbol "cmd_pm"
C:\Users\Andrei\Desktop\abc\a\EndGame Server Rpg\gamemodes\Teddy23.pwn(50822) : error 029: invalid expression, assumed zero
C:\Users\Andrei\Desktop\abc\a\EndGame Server Rpg\gamemodes\Teddy23.pwn(50822) : fatal error 107: too many error messages on one line

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


4 Errors.
Reply
#10

Quote:
Originally Posted by Alexandra.
Посмотреть сообщение
I am new in scripting sorry I don't know .

and he errors at that command :

C:\Users\Andrei\Desktop\abc\a\EndGame Server Rpg\gamemodes\Teddy23.pwn(50822) : warning 217: loose indentation
C:\Users\Andrei\Desktop\abc\a\EndGame Server Rpg\gamemodes\Teddy23.pwn(50822) : error 029: invalid expression, assumed zero
C:\Users\Andrei\Desktop\abc\a\EndGame Server Rpg\gamemodes\Teddy23.pwn(50822) : error 017: undefined symbol "cmd_pm"
C:\Users\Andrei\Desktop\abc\a\EndGame Server Rpg\gamemodes\Teddy23.pwn(50822) : error 029: invalid expression, assumed zero
C:\Users\Andrei\Desktop\abc\a\EndGame Server Rpg\gamemodes\Teddy23.pwn(50822) : fatal error 107: too many error messages on one line

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


4 Errors.
if you more help add skype RobinHellman016
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)