how to get the /pm command
#1

hello how can i get the /pm command ? please don't tell me is a pawno default command, because my pawno it doesnt have a /pm command it only have the
pawn Код:
public OnPlayerPrivmsg(playerid, recieverid, text[])
{
    return 1;
}
.. please give me the recommended info + the /command
Reply
#2

samp default
Reply
#3

Taken from base.pwn

pawn Код:
if(strcmp("/pm", cmd, true) == 0)
{
    tmp = strtok(cmdtext,idx);
   
    if(!strlen(tmp) || strlen(tmp) > 5)
    {
        SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"Usage: /pm (id) (message)");
        return 1;
    }
   
    new id = strval(tmp);
    gMessage = strrest(cmdtext,idx);
   
    if(!strlen(gMessage))
    {
        SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"Usage: /pm (id) (message)");
        return 1;
    }

    if(!IsPlayerConnected(id))
    {
        SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"/pm : Bad player ID");
        return 1;
    }

    if(playerid != id)
    {
        GetPlayerName(id,iName,sizeof(iName));
        GetPlayerName(playerid,pName,sizeof(pName));
        format(Message,sizeof(Message),">> %s(%d): %s",iName,id,gMessage);
        SendClientMessage(playerid,PM_OUTGOING_COLOR,Message);
        format(Message,sizeof(Message),"** %s(%d): %s",pName,playerid,gMessage);
        SendClientMessage(id,PM_INCOMING_COLOR,Message);
        PlayerPlaySound(id,1085,0.0,0.0,0.0);
       
        printf("PM: %s",Message);
    }
    else
    {
        SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"You cannot PM yourself");
    }
    return 1;
}
Reply
#4

Quote:
Originally Posted by »ŁegeɾɿĐ«
hello how can i get the /pm command ? please don't tell me is a pawno default command, because my pawno it doesnt have a /pm command it only have the
pawn Код:
public OnPlayerPrivmsg(playerid, recieverid, text[])
{
    return 1;
}
.. please give me the recommended info + the /command
If you're using 0.2x then you have /pm command in by default, OnPlayerPrivmsg callback is there for you to add more code for the command.
Reply
#5

It doesn't matter Don. Within a while 0.2X servers probably will not be able, so everyone must make his/her own PM command.


I suggest you to make your own instead.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)