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); }
C:\Users\Marius\Desktop\GM\gamemodes\GM.pwn(125) : error 029: invalid expression, assumed zero C:\Users\Marius\Desktop\GM\gamemodes\GM.pwn(125 -- 127) : warning 215: expression has no effect C:\Users\Marius\Desktop\GM\gamemodes\GM.pwn(127) : error 001: expected token: ";", but found "for" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Errors.
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); }
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); }
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); } |
thanks.
How do I make it so pAdmin >= 3 does not get their chat cleared? also this command to be available from pAdmin >= 1 |
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);
}
CMD:cc(pid, params[]) { #pragma unused params if(Playerinfo[pAdmin] == 0) return SCM(playerid,-1,"Only admins with level 1 or higher can use this command."); if(Playerinfo[pAdmin] < 3) { 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); } }
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.
|