if (strcmp("/nopm", cmdtext, true, 10) == 0||strcmp("/NOPM", cmdtext, true, 10) == 0) { #pragma unused cmdtext if(GetPVarInt(playerid,"NoPM") == 1) { SetPVarInt(playerid,"NoPM",0); SendClientMessage(playerid,0xFFFF00FF,"Pm's on!"); } else { SetPVarInt(playerid,"NoPM",1); SendClientMessage(playerid,0xFFFF00FF,"Pm's off!"); } return 1; } if (strcmp("/pm", cmdtext, true, 10) == 0||strcmp("/PM", cmdtext, true, 10) == 0) { new str[256], str2[256], id, Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME]; if(sscanf(cmdtext[8], "u", id, str2)) return SendClientMessage(playerid, 0xFF0000FF, "Usage: /pm [ID] [MESSAGE]"); if(id == INVALID_PLAYER_ID)return SendClientMessage(playerid, COLOR_RED, "Player No Connected"); if(playerid == id) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You Cannot PM Yourself!"); if(GetPVarInt(id,"NoPM") == 1) return SendClientMessage(playerid,0xFF0000FF,"That player isnt recieving pm's"); GetPlayerName(playerid, Name1, sizeof(Name1)); GetPlayerName(id, Name2, sizeof(Name2)); format(str, sizeof(str), "PM To %s: %s", Name2, id, str2); SendClientMessage(playerid, 0xFF0000FF, str); format(str, sizeof(str), "PM From %s: %s", Name1, playerid, str2); SendClientMessage(id, 0xFF0000FF, str); return 1; }
/pm [ID] [MESSAGE] |
SERVER: Unknown Command |
if(sscanf(cmdtext[8], "us", id, str2))
if (!strcmp("/nopm", cmdtext, true, 5))
{
if (GetPVarInt(playerid,"NoPM"))
{
SetPVarInt(playerid,"NoPM",0);
SendClientMessage(playerid,0xFFFF00FF,"Pm's on!");
}
else
{
SetPVarInt(playerid,"NoPM",1);
SendClientMessage(playerid,0xFFFF00FF,"Pm's off!");
}
return 1;
}
else if (!strcmp("/pm", cmdtext, true, 3))
{
new id, msg[100];
if (sscanf(cmdtext[4], "us[100]", id, msg)) return SendClientMessage(playerid, 0xFF0000FF, "Usage: /pm [ID] [MESSAGE]");
if (id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Player No Connected");
if (playerid == id) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You Cannot PM Yourself!");
if (GetPVarInt(id,"NoPM")) return SendClientMessage(playerid,0xFF0000FF,"That player isnt recieving pm's");
new Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME], str[144];
GetPlayerName(playerid, Name1, sizeof(Name1));
GetPlayerName(id, Name2, sizeof(Name2));
format(str, sizeof(str), "PM To %s: %s", Name2, id, msg);
SendClientMessage(playerid, 0xFF0000FF, str);
format(str, sizeof(str), "PM From %s: %s", Name1, playerid, msg);
SendClientMessage(id, 0xFF0000FF, str);
return 1;
}