PM sending ID
#5

pawn Код:
dcmd_pm(playerid,params[])
{
    new id, tmp[20],Index,string[256],pName[MAX_PLAYER_NAME],pName2[MAX_PLAYER_NAME];
    tmp = strtok(params, Index); id = strval(tmp);
    if(strlen(tmp)== 0)
    {
        SendClientMessage(playerid, COLOR_ERROR,"ERROR: /pm [id] [message]");
        return PlayerPlaySound(playerid, 1053, 0.0, 0.0, 0.0);
    }
    if(GetPVarInt(id,"NoPM") == 1)
    {
        SendClientMessage(playerid, COLOR_ERROR,"ERROR: Currently, that player's PM is set to: OFF!");
        return PlayerPlaySound(playerid, 1053, 0.0, 0.0, 0.0);
    }
    GetPlayerName(playerid,pName,sizeof(pName));
    GetPlayerName(id,pName2,sizeof(pName2));
    format(string,sizeof(string),"PM from %s (ID: %d): %s",pName,id,params[strlen(tmp)+1]);
    SendClientMessage(id,0xFFFF00FF,string);
    PlayerPlaySound(id,1085,0.0,0.0,0.0);
    format(string,sizeof(string),"PM sent to %s (ID: %d): %s",pName2,id,params[strlen(tmp)+1]);
    SendClientMessage(playerid,0xF2A337FF,string);
    SetPVarInt(id,"LastID",playerid);
    return 1;
}
And add strtok to your code, if you haven't yet:
https://sampwiki.blast.hk/wiki/Strtok

Cheers!
Reply


Messages In This Thread
PM sending ID - by (_AcE_) - 24.07.2012, 17:18
Re: PM sending ID - by Akira297 - 24.07.2012, 17:23
Re: PM sending ID - by (_AcE_) - 24.07.2012, 17:28
Re: PM sending ID - by leonardo1434 - 24.07.2012, 17:29
Re: PM sending ID - by Jeffry - 24.07.2012, 17:35
Re: PM sending ID - by Champ - 24.07.2012, 17:40
Re: PM sending ID - by Jeffry - 24.07.2012, 17:46
Re: help - by Champ - 24.07.2012, 17:52
Re: PM sending ID - by leonardo1434 - 24.07.2012, 18:02
Re: help - by Champ - 24.07.2012, 18:16

Forum Jump:


Users browsing this thread: 1 Guest(s)