10.06.2009, 11:41
Код:
if(strcmp(cmd,"/regp",true) == 0) { tmp = strtok(cmdtext,idx); if(IsPlayerConnected(playerid)) { if(PlayerData[playerid][AdminLevel] >= 3) { new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[128]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(tmp)) { SendClientMessage(playerid, 0xE6E6E6E6, "SERVER: /regp [password] [name]"); } else { } else { format(string, sizeof(string), "SERVER: %s is already registered.", result); SendClientMessage(playerid, 0x9ACD32AA, string); } } } } else { format(string, sizeof(string), "SERVER: You are not connected, or you are not an admin !"); SendClientMessage(playerid, 0xE6E6E6E6, string); } return 1; }