pawn Код:
new recieverid;
new h, mi, s;
new y1, m, d;
gettime(h,mi,s);
getdate(y1, m, d);
new string[128];
new string5[128];
new cmd[128];
new tmp[128];
new Message[128];
new gMessage[128];
new pName[70];
new temp[128];
new iName[70];
new idx;
cmd = strtok(cmdtext, idx);
if(strcmp("/pm", cmd, true) == 0)
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp) || strlen(tmp) > 5) {
SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"Usage: /pm (id) (mensagem)");
return 1;
}
new id = strval(tmp);
gMessage = strrest(cmdtext,idx);
if(!strlen(gMessage)) return SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"Usage: /pm (id) (mensagem)");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"/pm : ID Errado");
if(PMBlocked[id] == 1) return SendClientMessage(playerid, 0x00FFFFFF, "[ERRO]: Este player nгo estб querendo receber PM'S no momento!");
{
if(playerid != id) {
GetPlayerName(id,iName,sizeof(iName));
GetPlayerName(playerid,pName,sizeof(pName));
format(Message,sizeof(Message),"PM enviado para %s(%d): %s",iName,id,gMessage);
GameTextForPlayer(id, "~w~MENSAGEM ENVIADA", 5000, 5);
SendClientMessage(playerid,PM_OUTGOING_COLOR,Message);
format(Message,sizeof(Message),"PM recebido de %s(%d): %s",pName,playerid,gMessage);
GameTextForPlayer(id, "~w~MENSAGEM RECEBIDA", 5000, 5);
SendClientMessage(id,PM_INCOMING_COLOR,Message);
TextDrawHideForPlayer(recieverid, OtrzymalesPM);
TextDrawShowForPlayer(recieverid, OtrzymalesPM);
SetTimerEx("HideTDFromPlayer", 5000, 0, "di", recieverid, _:OtrzymalesPM);
PlayerPlaySound(id,1085,0.0,0.0,0.0);
format(string5, sizeof(string5), "[Data:%d/%d/%d] [Hora:%d:%d:%d] PM de %s para %s: %s",d,m,y1,h,mi,s, pName,iName, gMessage);
PMLog(string5);
format(string5, sizeof(string5), "PM de %s(ID:%d) para %s(ID:%d): %s" , pName, playerid,iName, id, gMessage);
SendPMToAdmins(0x00ffaaFF, string5, 6);
printf("PM: %s",Message);
}
else {
SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"[ERRO]: Vocк nгo pode mandar pm pra vocк mesmo.");
}
return 1;
}