[pawn]#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == \'\\0\') && (dcmd_%1(playerid, \"\"))) || (((%3)[(%2) + 1] == \' \') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1[/pawn]
OnPLayerCommandText:
[pawn]dcmd(r,1,cmdtext);[/pawn]
Mindegy hogy hova,csak ne lógjon bele más callback-be,akár a GM végére is rakhatod:
[pawn]dcmd_r(playerid,params[])
{
if(gTeam[playerid]==TEAM_COP)
{
new uzenet[128];
if(sscanf(params,\"s[128]\",uzenet)) return SendClientMessage(playerid,0xff0000ff,\"Használd: /r (üzenet)\");
new name[24],msg[128];
GetPlayerName(playerid,name,24);
format(msg,128,\"RendõrRádió {ffffff}%s{ff0000}: %s\",name,uzenet);
for(new i; i < MAX_PLAYERS; i++)
{
if(gTeam == TEAM_COP)
{
SendClientMessage(i,0xff0000ff,msg);
}
}
}
else SendClientMessage(playerid,0xff0000ff,\"Nem vagy rendõr!!\");
return 1;
}[/pawn]