12.07.2011, 07:40
@WoodPecker
okay but i don't know where to put it exactly in OnPlayerCommandText.
@[MG]Dimi
idk what you mean because when i put baseaf in filterscript line it doesn't make any difference
okay but i don't know where to put it exactly in OnPlayerCommandText.
Код:
public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/mycommand", cmdtext, true, 10) == 0) { // do something here return 1; } if(strcmp("/report", cmdtext,true, 10) == 0) { if(IsPlayerConnected(playerid)) { GetPlayerName(playerid, sendername, sizeof(sendername)); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[96]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /report [text]"); format(string, sizeof(string), "Report from [%d]%s: %s",playerid, sendername, (result)); ABroadCast(COLOR_LIGHTYELLOW,string,1); SendClientMessage(playerid, COLOR_YELLOW, "Your report message was sent to online administrators, thank you."); } return 1; } return 0; }
idk what you mean because when i put baseaf in filterscript line it doesn't make any difference