Posts: 1
Threads: 0
Joined: Oct 2011
Reputation:
0
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
Posts: 1,208
Threads: 36
Joined: Apr 2015
look xD
Код:
CMD:cc(pid, params[])
}
#pragma unused params
for(new cc = 0; cc < 250; cc++) SCMToAll(COLOR_WHITE," ");
format(string, sizeof(string), " The chat has been cleared by {FF0000}%s, name);
SCMToAll(COLOR_WHITE, string);
}
Posts: 1,767
Threads: 124
Joined: Mar 2010
Why not keep it simple?
Код:
CMD:cc(pid, params[])
{
#pragma unused params
for(new cc = 0; cc < 250; cc++)
{
SCMToAll(COLOR_WHITE, " ");
}
new name[MAX_PLAYER_NAME + 1];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "The chat has been cleared by {FF0000}%s", name);
SCMToAll(COLOR_WHITE, string);
}
You were using first bracket wrong way around and you've missed quote mark after string formatting.
Posts: 156
Threads: 25
Joined: May 2016
Quote:
Originally Posted by JXF
thanks.
How do I make it so pAdmin >= 3 does not get their chat cleared?
also this command to be available from pAdmin >= 1
|
If(playerinfo[pAdmin] < 1) return SCM(-1, playerid, " A1+ Only");
Add that after pragma code / underneath CMD:clearchat
Posts: 1,266
Threads: 6
Joined: Oct 2014
PHP код:
CMD:cc(pid, params[])
{
#pragma unused params
for(new i = 0; i < MAX_PLAYERS; i++) {
if(!IsPlayerConnected(i) || IsPlayerAdmin(i)) continue;
for(new cc = 0; cc < 250; cc++)
{
SendClientMessage(i, COLOR_WHITE, " ");
}
}
new name[MAX_PLAYER_NAME + 1];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "The chat has been cleared by {FF0000}%s", name);
SCMToAll(COLOR_WHITE, string);
}
change IsPlayerAdmin With your admin check, example : pInfo[i][Admin] >= 3
Posts: 694
Threads: 2
Joined: Oct 2012
Reputation:
0
Just a question, which "string" are you formatting? please tell me it's not global cuz that would make so many many problems for you. I recommend using local variables when not needed like this string.