Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:g(playerid, params[])
- {
- new string[64];
- if(isnull(params))
- {
- return SendClientMessage(playerid, COLOR_GREY3, "[Usage]: /g [global chat]");
- }
- if(!enabledGlobal && PlayerInfo[playerid][pAdmin] < 2)
- {
- return SendClientMessage(playerid, COLOR_GREY, "The global channel is disabled at the moment.");
- }
- if(PlayerInfo[playerid][pGlobalMuted])
- {
- return SendClientMessage(playerid, COLOR_GREY, "You are muted from speaking in this channel.");
- }
- if(PlayerInfo[playerid][pToggleGlobal])
- {
- return SendClientMessage(playerid, COLOR_GREY, "You can't speak in the global chat as you have it toggled.");
- }
- if(gettime() - PlayerInfo[playerid][pLastGlobal] < 3)
- {
- return SendClientMessageEx(playerid, COLOR_GREY, "You can only speak in this channel every 3 seconds. Please wait %i more seconds.", 3 - (gettime() - PlayerInfo[playerid][pLastGlobal]));
- }
- if(PlayerInfo[playerid][pAdmin] > 1) {
- format(string, sizeof(string), "%s", GetAdminRank(playerid));
- } else if(PlayerInfo[playerid][pHelper] > 0) {
- format(string, sizeof(string), "%s", GetHelperRank(playerid));
- } else if(PlayerInfo[playerid][pVIPPackage] > 0) {
- format(string, sizeof(string), "{A028AD}%s VIP{FFA500}", GetVIPRank(PlayerInfo[playerid][pVIPPackage]));
- } else if(PlayerInfo[playerid][pLevel] >= 2) {
- format(string, sizeof(string), "Level %i Player", PlayerInfo[playerid][pLevel]);
- } else {
- string = "Level 1 Newbie";
- }
- foreach(new i : Player)
- {
- if(!PlayerInfo[i][pToggleGlobal])
- {
- if(strlen(params) > MAX_SPLIT_LENGTH)
- {
- SendClientMessageEx(i, COLOR_GLOBAL, "(( %s %s: %.*s...))", string, GetPlayerRPName(playerid), MAX_SPLIT_LENGTH, params);
- SendClientMessageEx(i, COLOR_GLOBAL, "(( %s %s: ...%s ))", string, GetPlayerRPName(playerid), params[MAX_SPLIT_LENGTH]);
- }
- else
- {
- SendClientMessageEx(i, COLOR_GLOBAL, "(( %s %s: %s ))", string, GetPlayerRPName(playerid), params);
- }
- }
- }
- if(PlayerInfo[playerid][pAdmin] < 2)
- {
- PlayerInfo[playerid][pLastGlobal] = gettime();
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement