how to get the /pm command - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: how to get the /pm command (
/showthread.php?tid=100147)
how to get the /pm command -
cubaton3 - 03.10.2009
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
Re: how to get the /pm command -
dice7 - 03.10.2009
samp default
Re: how to get the /pm command -
MadeMan - 03.10.2009
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;
}
Re: how to get the /pm command -
Correlli - 03.10.2009
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.
Re: how to get the /pm command -
MenaceX^ - 03.10.2009
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.