Need Help with Pm command..:-/
#2

Better use sscanf

sscanf here: https://sampforum.blast.hk/showthread.php?tid=120356

and following PM cmd
pawn Код:
CMD:pm(playerid, params[])
{
new str[256], str2[256], id, Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];
if(sscanf(params, "us", id, str2))
{
SendClientMessage(playerid, 0xFF0000FF, "Usage: /pm <id> <message>");
return 1;
}
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: Player not connected");
if(playerid == id) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You cannot pm yourself!");
{
GetPlayerName(playerid, Name1, sizeof(Name1));
GetPlayerName(id, Name2, sizeof(Name2));
format(str, sizeof(str), "PM To %s [ID %d]: %s", Name2, id, str2);
SendClientMessage(playerid, yellow, str);
format(str, sizeof(str), "PM From %s [ID %d]: %s", Name1, playerid, str2);
SendClientMessage(id, yellow, str);
}
return 1;
}
You can edit it according to your script.
Tested | trusted | works
Reply


Messages In This Thread
Need Help with Pm command..:-/ - by Desi_Dude - 26.09.2012, 11:39
Re: Need Help with Pm command..:-/ - by Jarnu - 26.09.2012, 12:00
Re: Need Help with Pm command..:-/ - by Glint - 26.09.2012, 12:06
Re: Need Help with Pm command..:-/ - by Desi_Dude - 26.09.2012, 13:03
Re: Need Help with Pm command..:-/ - by Cxnnor - 26.09.2012, 13:07
Re: Need Help with Pm command..:-/ - by Jarnu - 26.09.2012, 13:19
Re: Need Help with Pm command..:-/ - by Desi_Dude - 12.10.2012, 12:41

Forum Jump:


Users browsing this thread: 1 Guest(s)