26.11.2010, 21:41
This is the code in full when i do it with the warnings
Код:
if(strcmp(cmd, "/government", true) == 0 || strcmp(cmd, "/gov", true) == 0) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pFaction] != 255 && DynamicFactions[PlayerInfo[playerid][pFaction]][fType] == 10,1) { if(PlayerInfo[playerid][pRank] != 1) { SendClientMessage(playerid, COLOR_GREY, "(ERROR) Only the leader can use this"); return 1; } 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_WHITE, "(USAGE) [/gov]ernment [text]"); return 1; } if(CopOnDuty[playerid]) { new faction = PlayerInfo[playerid][pFaction]; SendClientMessageToAll(COLOR_GREEN, "|_________ Government Announcement _________|"); format(string, sizeof(string), "%s %s: %s", DynamicFactions[faction][fRank1],GetPlayerNameEx(playerid), result); SendClientMessageToAll(COLOR_LIGHTRED, string); SendClientMessageToAll(COLOR_GREEN, "|_________ Government Announcement _________|"); } else { SendClientMessage(playerid, COLOR_GREY, "(ERROR) You are not on duty"); } } else { SendClientMessage(playerid, COLOR_GREY, "(ERROR) Invalid faction"); } } return 1; }