[FilterScript] Simple PM System
#1

Private Messaging system by MarkNelson(hobo101) including some commands and some features
How it works:
Well, this private messaging system doesn't have /pm only, it has some features like /pm and /re. Also, if you want to PM someone faster you can press on TAB then click on the player's name two times after that a dialog with a blank will appear to you, asking you to put your message into that blank and you have two options "Send" or "Cancel".
Let's talk about the /pm, when you pm someone your message will be colored with orange while when you recieve a message from someone, it will be colored with yellow, and if you want to reply him faster, you can use /re [Message] to reply him faster.

System Commands:
- /pm [playerid] [message] to PM the player
- /re [message] to reply the pm faster and easier
- press on TAB then click on the player's name two times after that a dialog with a blank will appear to you, asking you to put your message into that blank and you have two options "Send" or "Cancel".

Bugs:
There are no bugs, and i already fixed them. If you find any bug, feel free to PM me through the forums

Pastebin:
https://pastebin.com/QWPVz7gG
Reply
#2

This is a good one
Reply
#3

Good job +REP
Reply
#4

The code itself isn't to bad I guess, i couldn't help but notice this.

Код:
CMD:pm(playerid, params[])
{
    new str[175], str2[175], id, Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];
    if(sscanf(params, "us", id, str2))
    {
        SendClientMessage(playerid, COLOR_ORANGE, "Usage: /pm <id> <message>");
        return 1;
    }
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "ERROR: Player not connected");
    if(playerid == id) return SendClientMessage(playerid, COLOR_RED, "ERROR: You cannot pm yourself!");
    { // This isn't needed
        GetPlayerName(playerid, Name1, sizeof(Name1));
        GetPlayerName(id, Name2, sizeof(Name2));
        format(str, sizeof(str), "PM To %s(ID %d): %s", Name2, id, str2);
        SendClientMessage(playerid, COLOR_ORANGE, str);
        PlayerPlaySound(playerid, 1083, 0.0, 0.0, 0.0);
        format(str, sizeof(str), "PM From %s(ID %d): %s", Name1, playerid, str2);
        SendClientMessage(id, COLOR_YELLOW, str);
        PlayerPlaySound(id, 1057, 0.0, 0.0, 0.0);
        printf(str);
        LastPm[id] = playerid;
    } // This isn't needed
    return 1;
}
Reply
#5

Quote:
Originally Posted by Stev
Посмотреть сообщение
The code itself isn't to bad I guess, i couldn't help but notice this.

Код:
CMD:pm(playerid, params[])
{
    new str[175], str2[175], id, Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];
    if(sscanf(params, "us", id, str2))
    {
        SendClientMessage(playerid, COLOR_ORANGE, "Usage: /pm <id> <message>");
        return 1;
    }
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "ERROR: Player not connected");
    if(playerid == id) return SendClientMessage(playerid, COLOR_RED, "ERROR: You cannot pm yourself!");
    { // This isn't needed
        GetPlayerName(playerid, Name1, sizeof(Name1));
        GetPlayerName(id, Name2, sizeof(Name2));
        format(str, sizeof(str), "PM To %s(ID %d): %s", Name2, id, str2);
        SendClientMessage(playerid, COLOR_ORANGE, str);
        PlayerPlaySound(playerid, 1083, 0.0, 0.0, 0.0);
        format(str, sizeof(str), "PM From %s(ID %d): %s", Name1, playerid, str2);
        SendClientMessage(id, COLOR_YELLOW, str);
        PlayerPlaySound(id, 1057, 0.0, 0.0, 0.0);
        printf(str);
        LastPm[id] = playerid;
    } // This isn't needed
    return 1;
}
Oh yes, you're right! lol i didn't notice that.
Well, it works well without any bugs but i'll fix that later. atleast, it works well without bugs atm. thanks mate
Reply
#6

Quote:
Originally Posted by Stev
Посмотреть сообщение
The code itself isn't to bad I guess, i couldn't help but notice this.

Код:
CMD:pm(playerid, params[])
{
    new str[175], str2[175], id, Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];
    if(sscanf(params, "us", id, str2))
    {
        SendClientMessage(playerid, COLOR_ORANGE, "Usage: /pm <id> <message>");
        return 1;
    }
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "ERROR: Player not connected");
    if(playerid == id) return SendClientMessage(playerid, COLOR_RED, "ERROR: You cannot pm yourself!");
    { // This isn't needed
        GetPlayerName(playerid, Name1, sizeof(Name1));
        GetPlayerName(id, Name2, sizeof(Name2));
        format(str, sizeof(str), "PM To %s(ID %d): %s", Name2, id, str2);
        SendClientMessage(playerid, COLOR_ORANGE, str);
        PlayerPlaySound(playerid, 1083, 0.0, 0.0, 0.0);
        format(str, sizeof(str), "PM From %s(ID %d): %s", Name1, playerid, str2);
        SendClientMessage(id, COLOR_YELLOW, str);
        PlayerPlaySound(id, 1057, 0.0, 0.0, 0.0);
        printf(str);
        LastPm[id] = playerid;
    } // This isn't needed
    return 1;
}
How is that needed while hes returning it?
PHP код:
if(playerid == id) return SendClientMessage(playeridCOLOR_RED"ERROR: You cannot pm yourself!"); 



And gj to the creator, keep it up.
Reply
#7

He already returned the value after the statement.

Код:
if (playerid == id)
	return SendClientMessage(playerid, COLOR_ORED, "ERROR: You cannot pm yourself!");

// Continue code..
The brackets there are unnecessary.
Reply
#8

Can't really say its useful, nonetheless, good job.
Reply
#9

Quote:
Originally Posted by Stev
Посмотреть сообщение
He already returned the value after the statement.

Код:
if (playerid == id)
	return SendClientMessage(playerid, COLOR_ORED, "ERROR: You cannot pm yourself!");

// Continue code..
The brackets there are unnecessary.
Ops my bad :/ Thought you said it was needed.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)