írd dcmd-be, az mükszik strcmp-vel egyhuzamban...
script elejére:
[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]
a parancsot callbackon kívülre tehát ha lezártad az onplayercommandtext-et, akkor utána írd:
[pawn]dcmd_feljelent(playerid, params[])
{
if(gTeam[playerid] == ide írd a TEAMID-t)
{
new pid,reason[100],string[150],pName[MAX_PLAYER_NAME],pName2[MAX_PLAYER_NAME];
if(sscanf(params, \"us[100]\",pid,reason)) return SendClientMessage(playerid, COLOR_ORANGE, \"Használat: /feljelent (ID/Név) (Oka)\");
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
GetPlayerName(pid, pName2, MAX_PLAYER_NAME);
SetPlayerWantedLevel(pid, GetPlayerWantedLevel(pid) + 1);
format(string,sizeof(string), \"%s feljelentette %s-t! Oka:%s\",pName,pName2,reason);
SendClientMessageToAll(0xFFFFFFFF, string);
}
else SendClientMessage(playerid, COLOR_RED,\"Nem vagy rendõr!\");
return 1;
}[/pawn]
ne felejtsd el:
[pawn]#include <sscanf2>[/pawn]