PM message is sending the Sender's ID
#5

here's a SSCANF version.
pawn Код:
dcmd_pm(playerid,params[])
{
    new id,string[256],pName[MAX_PLAYER_NAME],pName2[MAX_PLAYER_NAME], sendmessage[64];
    if(!sscanf(params, "us[64]", id, params[2]);
    {
        if(GetPVarInt(id,"NoPM") == 1)
        {
            SendClientMessage(playerid, COLOR_ERROR,"ERROR: Currently, that player's PM is set to: OFF!");
            PlayerPlaySound(playerid, 1053, 0.0, 0.0, 0.0);
            return 1;
        }
        if(!IsPlayerConnected(id)
        {
            SendClientMessage(playerid, COLOR_ERROR,"ERROR: That ID is not connected.");
            return 1;
        }
        GetPlayerName(playerid ,pName, sizeof(pName));
        GetPlayerName(id, pName2, sizeof(pName2));
        format(string, sizeof(string), "PM from %s: %s", pName, params[2]);
        SendClientMessage(id, 0xFFFF00FF, string);
        PlayerPlaySound(playerid,1085,0.0,0.0,0.0);
        format(string, sizeof(string), "PM sent to %s: %s", pName2, params[2]);
        SendClientMessage(playerid, 0xF2A337FF, string);
        SetPVarInt(id, "LastID", playerid);
    }
    else
    {
        SendClientMessage(playerid, -1, "USAGE: /PM [PlayerID/PartOfName] [Message]");
    }
    return 1;
}
Not tested... - May or May not work.
Reply


Messages In This Thread
PM message is sending the Sender's ID - by (_AcE_) - 27.07.2012, 19:41
Re: PM message is sending the Sender's ID - by Vince - 27.07.2012, 19:46
Re: PM message is sending the Sender's ID - by (_AcE_) - 27.07.2012, 20:25
Re: PM message is sending the Sender's ID - by Kakioshe22 - 27.07.2012, 21:53
Re: PM message is sending the Sender's ID - by Dubya - 27.07.2012, 22:13
Re: PM message is sending the Sender's ID - by Kakioshe22 - 27.07.2012, 22:17

Forum Jump:


Users browsing this thread: 2 Guest(s)