15.06.2010, 07:45
The lines that are red are the lines that are giving me errors.
Quote:
//----------------------------------[Staff Chat]----------------------------------------------- if(strcmp(cmd, "//", true) == 0 || strcmp(cmd, "/staffchat", true) == 0) { if(IsPlayerConnected(playerid)) { { 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_GRAD2, "USAGE: (//) [text]"); return 1; } if(PlayerInfo[playerid][pAdmin] >= 0) { if(PlayerInfo[playerid][pAdmin] == 1) { format(string, sizeof(string), "[STAFF CHAT] (Admin 1) %s: %s", sendername, result); } else if(PlayerInfo[playerid][pAdmin] == 2) { format(string, sizeof(string), "[STAFF CHAT] (Admin 2) %s: %s", sendername, result); } else if(PlayerInfo[playerid][pAdmin] == 3) { format(string, sizeof(string), "[STAFF CHAT] (Senior Admin) %s: %s", sendername, result); } else if(PlayerInfo[playerid][pAdmin] == 4) { format(string, sizeof(string), "[STAFF CHAT] (Lead Admin) %s: %s", sendername, result); } else if(PlayerInfo[playerid][pAdmin] == 5) { format(string, sizeof(string), "[STAFF CHAT] (Head Admin) %s: %s", sendername, result); } else if(PlayerInfo[playerid][pAdmin] == 6) { format(string, sizeof(string), "[STAFF CHAT] (Owner) %s: %s", sendername, result); } } if(PlayerInfo[playerid][pGM] >= 0) { if(PlayerInfo[playerid][pGM] == 1) { format(string, sizeof(string), "[STAFF CHAT] (Trial GM) %s: %s", sendername, result); } else if(PlayerInfo[playerid][pGM] == 2) { format(string, sizeof(string), "[STAFF CHAT] (GM 1) %s: %s", sendername, result); } else if(PlayerInfo[playerid][pGM] == 3) { format(string, sizeof(string), "[STAFF CHAT] (GM 2) %s: %s", sendername, result); } else if(PlayerInfo[playerid][pGM] == 4) { format(string, sizeof(string), "[STAFF CHAT] (Senior GM) %s: %s", sendername, result); } else if(PlayerInfo[playerid][pGM] == 5) { format(string, sizeof(string), "[STAFF CHAT] (Lead GM) %s: %s", sendername, result); } } SendClientMessageToAll(COLOR_ORANGE, string); } [b]else { SendClientMessage(playerid, COLOR_GRAD2, "You are not authorised to do that!"); } return 1; } } |
Quote:
//----------------------------------[Staff Announcement]----------------------------------------------- if(strcmp(cmd, "/sann", true) == 0) { if(IsPlayerConnected(playerid)) { { 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_GRAD2, "USAGE: (/sann) [text]"); return 1; } SendClientMessageToAll(COLOR_WHITE, "|____________**Staff Announcement**____________|"); if(PlayerInfo[playerid][pAdmin] >= 0) { if(PlayerInfo[playerid][pAdmin] == 1) { format(string, sizeof(string), "(Administrator) %s: %s", sendername, result); } else if(PlayerInfo[playerid][pAdmin] == 2) { format(string, sizeof(string), "(Administrator) %s: %s", sendername, result); } else if(PlayerInfo[playerid][pAdmin] == 3) { format(string, sizeof(string), "(Senior Admin) %s: %s", sendername, result); } else if(PlayerInfo[playerid][pAdmin] == 4) { format(string, sizeof(string), "(Lead Admin) %s: %s", sendername, result); } else if(PlayerInfo[playerid][pAdmin] == 5) { format(string, sizeof(string), "(Head Admin) %s: %s", sendername, result); } else if(PlayerInfo[playerid][pAdmin] == 6) { format(string, sizeof(string), "(Owner) %s: %s", sendername, result); } } if(PlayerInfo[playerid][pGM] >= 3) { if(PlayerInfo[playerid][pGM] == 3) { format(string, sizeof(string), "(Game Master) %s: %s", sendername, result); } else if(PlayerInfo[playerid][pGM] == 4) { format(string, sizeof(string), "(Senior GM) %s: %s", sendername, result); } else if(PlayerInfo[playerid][pGM] == 5) { format(string, sizeof(string), "(Lead GM) %s: %s", sendername, result); } } [b]SendClientMessageToAll(COLOR_OOC2, string); } else { SendClientMessage(playerid, COLOR_GRAD2, "You are authorised to do that!"); } return 1; } } |