Код:
//define top of script
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
//onplayercommand
dcmd(pm,2,cmdtext);
//the command
dcmd_pm(playerid,params[])
{
new string[128];
new ID;
new cmdreason[100];
if(sscanf(params, "us[100]", ID, cmdreason))
{
SendClientMessage(playerid,COLOR_RED,"USAGE: /pm (Player Name/ID) (Message)");
return 1;
}
if(!IsPlayerConnected(ID))
{
format(string, sizeof(string), "The Player ID (%d) is not connected to the server.",ID);
SendClientMessage(playerid,COLOR_RED,string);
return 1;
}
if(playerid == ID)
{
SendClientMessage(playerid,COLOR_RED,"You cannot pm yourself!");
return 1;
}
format(string, sizeof(string), "[Private Message] Sent to: %s(%d): %s",PlayerName(ID),ID,cmdreason);
SendClientMessage(playerid,COLOR_YELLOW,string);
format(string, sizeof(string), "[Private Message] From: %s(%d) %s",PlayerName(playerid),playerid,cmdreason);
SendClientMessage(ID,COLOR_YELLOW,string);
PlayerPlaySound(ID,1085,0.0,0.0,0.0);
return 1;
}
Since yesterday i got this problem.
All my dcmd commands are bugged.
How can i fix this?