26.05.2014, 17:08
I want To make An Admin Tag Like [ADMIN] In Chat !! Can Someone Help Me ??
new pName[16], string[126];
GetPlayersName(playerid, pName);
format(string, sizeof(string), "[ADMIN]%s", pName);
SetPlayerName(playerid, string);
CMD:name(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 9999) { new giveplayerid, result[21]; new sendername[MAX_PLAYER_NAME]; new tmp[MAX_PLAYER_NAME]; if(!sscanf(params, "us[21]", giveplayerid, result)) { format(PlayerInfo[giveplayerid][pAdminName], 21, "%s", result); strcat(sendername, PlayerName(playerid)); new string[128]; new escstr[MAX_PLAYER_NAME]; mysql_real_escape_string(tmp,escstr); format(string, sizeof(string), "UPDATE `userinfo` SET `AdminName`='%s' WHERE `id`=%d ;", escstr, PlayerInfo[playerid][pSQLID]); format(string, sizeof(string), "Envision-Bot: %s has set your AdminName to %s.", sendername, tmp, PlayerInfo[giveplayerid][pAdminName]); SendClientMessage(playerid, COLOR_ORANGE, string); format(string, sizeof(string), "Envision-Bot: %s has set %s's Admin Name to: %s.", PlayerName(playerid), PlayerName(giveplayerid), PlayerInfo[giveplayerid][pAdminName]); ABroadCast(COLOR_YELLOW2, string, 1); } else { SendClientMessage(playerid, COLOR_GREY, "Invalid player!"); } } else { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /Name [PlayerID/PartOfName] [Admin Name]"); SendClientMessage(playerid, COLOR_LIGHTBLUE, "Set's the players Admin Name."); } return 1; } CMD:title(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 9999) { new giveplayerid, result[21]; new sendername[MAX_PLAYER_NAME]; new tmp[MAX_PLAYER_NAME]; if(!sscanf(params, "us[21]", giveplayerid, result)) { format(PlayerInfo[giveplayerid][pAdminTitle], 21, "%s", result); strcat(sendername, PlayerName(playerid)); new string[128]; new escstr[MAX_PLAYER_NAME]; mysql_real_escape_string(tmp,escstr); format(string, sizeof(string), "UPDATE `userinfo` SET `AdminTitle`='%s' WHERE `id`=%d ;", escstr, PlayerInfo[playerid][pSQLID]); format(string, sizeof(string), "Envision-Bot: %s has change your AdminTitle to %s.", sendername, tmp, PlayerInfo[giveplayerid][pAdminTitle]); SendClientMessage(giveplayerid, COLOR_ORANGE, string); format(string, sizeof(string), "Envision-Bot: %s has set %s's Admin Title to: %s.", PlayerName(playerid), PlayerName(giveplayerid), PlayerInfo[giveplayerid][pAdminTitle]); ABroadCast(COLOR_YELLOW2, string, 1); } else { SendClientMessage(playerid, COLOR_GREY, "Invalid player specified."); } } else { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /SetAdminTitle [PlayerID/PartOfName] [Admin Title]"); SendClientMessage(playerid, COLOR_LIGHTBLUE, "Set's the players Admin title."); } return 1; }