[FilterScript] Simple PM System
#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


Messages In This Thread
Simple PM System - by MarkNelson - 06.02.2018, 17:38
Re: Simple PM System - by solstice_ - 06.02.2018, 19:07
Re: Simple PM System - by HeroDR22 - 06.02.2018, 19:10
Re: Simple PM System - by Stev - 06.02.2018, 19:39
Re: Simple PM System - by MarkNelson - 06.02.2018, 19:40
Re: Simple PM System - by AlexMSK - 06.02.2018, 20:14
Re: Simple PM System - by Stev - 06.02.2018, 20:24
Re: Simple PM System - by iLearner - 06.02.2018, 20:25
Re: Simple PM System - by AlexMSK - 06.02.2018, 20:28

Forum Jump:


Users browsing this thread: 2 Guest(s)