if(strcmp(cmd, "/ooc", true) == 0 || strcmp(cmd, "/o", true) == 0) { if(IsPlayerConnected(playerid)) { if(IsLogged[playerid] == 0) { SendClientMessage(playerid, COLOR_GREY, " You are not logged in yet."); return 1; } if(noooc == 0) { SendClientMessage(playerid, COLOR_GREY, " The OOC channel has been disabled by an admin."); return 1; } GetPlayerName(playerid, sendername, sizeof(sendername)); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[64]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) { SendClientMessage(playerid, COLOR_GREY, " USAGE: (/o)oc [text]"); return 1; } format(string, sizeof(string), "(( [OOC] %s: %s ))", sendername, result); SendClientMessageToAll(COLOR_WHITE,string); } return 1; }
if(strcmp(cmd, "/ooc", true) == 0 || strcmp(cmd, "/o", true) == 0) { if(IsPlayerConnected(playerid)) { if(IsLogged[playerid] == 0) { SendClientMessage(playerid, COLOR_GREY, " You are not logged in yet."); return 1; } if(noooc == 0) { SendClientMessage(playerid, COLOR_GREY, " The OOC channel has been disabled by an admin."); return 1; } GetPlayerName(playerid, sendername, sizeof(sendername)); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[256]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) { SendClientMessage(playerid, COLOR_GREY, " USAGE: (/o)oc [text]"); return 1; } format(string, sizeof(string), "(( [OOC] %s: %s ))", sendername, result); SendClientMessageToAll(COLOR_WHITE,string); } return 1; }
Originally Posted by Eric_
Код:
if(strcmp(cmd, "/ooc", true) == 0 || strcmp(cmd, "/o", true) == 0) { if(IsPlayerConnected(playerid)) { if(IsLogged[playerid] == 0) { SendClientMessage(playerid, COLOR_GREY, " You are not logged in yet."); return 1; } if(noooc == 0) { SendClientMessage(playerid, COLOR_GREY, " The OOC channel has been disabled by an admin."); return 1; } GetPlayerName(playerid, sendername, sizeof(sendername)); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[256]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) { SendClientMessage(playerid, COLOR_GREY, " USAGE: (/o)oc [text]"); return 1; } format(string, sizeof(string), "(( [OOC] %s: %s ))", sendername, result); SendClientMessageToAll(COLOR_WHITE,string); } return 1; } |