CMD:pm(playerid, params[])
{
new str[300], str2[300], id, Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];
new strr[300];
if(sscanf(params, "us", id, str2))
{
SendClientMessage(playerid, -1, "{F70505}Usage: {FFFFFF}/pm <id> <message>");
return 1;
}
new Year, Month, Day, Hour, Minute, Second;
getdate(Year, Month, Day);
gettime(Hour, Minute, Second);
if(PlayerInfo[playerid][pMuted] == 1) return SendClientMessage(playerid,0xFF0000FF,"You are muted, you can't use this command.");
if(PlayerInfo[id][pNopm] == 1) return SendClientMessage(playerid,0xFF0000FF,"This player has /nopm enabled, you can't send him a pm.");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: Player not connected");
if(playerid == id) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You cannot pm yourself!");
if(strlen(params) > 300) return SendClientMessage(playerid,0xFF0000FF, "Your message is too long, reduce it. (Max 128 characters)");
if(GetPVarInt(playerid,"PmTime")>GetTickCount())return SendClientMessage(playerid,0xFF0000FF,"Please wait before sending a pm again.");
GetPlayerName(playerid, Name1, sizeof(Name1));
GetPlayerName(id, Name2, sizeof(Name2));
format(str, sizeof(str), "{F70505}PM SENT TO: {FFFFFF}%s (%d): %s", Name2, id, str2);
SendClientMessage(playerid, -1, str);
format(str, sizeof(str), "{F70505}PM FROM: {FFFFFF}%s (%d): %s", Name1, playerid, str2);
SendClientMessage(id, -1, strr);
new log[300];
new am[300];
format(log, sizeof(log), "PM from %s (%d) to %s (%d): %s - %02d/%02d/%d - %02d:%02d:%02d",Name1,playerid, Name2, id,str2,Day,Month,Year,Hour,Minute,Second);
format(am, sizeof(am), "PM from %s (%d) to %s (%d): %s",Name1,playerid, Name2, id,str2);
PmLog(log);
SendMessageToAdmins(COLOR_YELLOW,am);
new imsg[300];
format(imsg, sizeof(imsg), "10*PM from %s (%d) to %s (%d): %s", Name1,playerid, Name2, id,str2);
IRC_GroupSay(gGroupID, IRC_CHANNEL, imsg);
IRC_GroupSay(gGroupID, IRC_ACHANNEL, imsg);
SetPVarInt(playerid,"PmTime",GetTickCount()+5000);
return 1;
}
CMD:pm(playerid,params[])
{
new player = strval(params);
new text = params[1];
if(sscanf(params,"uc",player,text))return SendClientMessage(playerid,Red,"[Usage]: /pm [playerid] [ Message]");
if(!IsPlayerConnected(player))return SendClientMessage(playerid,Red,"[ERROR]:Player Not Connected");
new string[256];
format(string,sizeof(string),"PM To %s(%d): %s",Playername(player),player,params[1]);
SendClientMessage(playerid,Yellow,string);
format(string,sizeof(string),"PM From %s(%d): %s",Playername(playerid),playerid,params[1]);
SendClientMessage(player,Yellow,string);
return 1;
}
if(sscanf(params, "us", id, str2))
Did you read sscanf plugin topic?
pawn Код:
|
Did you read sscanf plugin topic?
pawn Код:
|
if(sscanf(params, "us[128]", id, str2))