Problem with TOGPM command
#1

how to make that I don't need relog to access Private Messages ...

enum
Код:
NoPM
Код:
CMD:togpm(playerid, params[])
{
        if(PlayerInfo[playerid][VIP] == 1)
        {
            PlayerInfo[playerid][NoPM] = 1;
            SendClientMessage(playerid, COLOR_GREEN, "[SERVER]You are no longer accepting private messages");
        }
        else
        {
            PlayerInfo[playerid][NoPM] = 0;
            SendClientMessage(playerid, COLOR_GREEN, "[SERVER]You are now accepting private messages");
        }
        return 1;
}
Reply
#2

Show /pm command
Reply
#3

Код:
CMD:pm(playerid, params[])
{
    new id, text[128], string[128];
    if(sscanf(params, "us", id, text)) return SendClientMessage(playerid, COLOR_RED, "[USAGE] /pm <playerid/part of name> <message>");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "Player is not connected.");
    if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "You cannot PM yourself.");
    format(string, sizeof(string), "%s (%d) is not accepting private messages at the moment.", PlayerName(id), id);
    if(PlayerInfo[id][NoPM] == 1) return SendClientMessage(playerid, COLOR_RED, string);
    format(string, sizeof(string), "PM to %s: %s", PlayerName(id), text);
    SendClientMessage(playerid, COLOR_YELLOW, string);
    format(string, sizeof(string), "PM from %s: %s", PlayerName(playerid), text);
    SendClientMessage(id, COLOR_WHITE, string);
    format(string, sizeof(string), "PM | %s (%d) => %s (%d): %s", PlayerName(playerid), playerid, PlayerName(id), id, text);
	SendAdminMessage(1, COLOR_BLUE, string);
    return 1;
}
Reply
#4

Код:
CMD:togpm(playerid, params[])
{
        if(PlayerInfo[playerid][VIP] == 1)
        {
		if(PlayerInfo[playerid][NoPM] == 0)
        	{
            		PlayerInfo[playerid][NoPM] = 1;
            		SendClientMessage(playerid, COLOR_GREEN, "[SERVER]You are no longer accepting private messages");
		} else {
            		PlayerInfo[playerid][NoPM] = 0;
            		SendClientMessage(playerid, COLOR_GREEN, "[SERVER]You are now accepting private messages");
        	}
	} else {
		SendClientMessage(playerid, COLOR_GREEN, "You aren't VIP!");
	}
        return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)