CMD:cc(playerid, params[])
{
if(APlayerData[playerid][PlayerLevel] >= 1 || IsPlayerAdmin(playerid))
{
for(new i = 0; i < 100; i++)
{
SendClientMessageToAll(-1, " ");
}
SendClientMessageToAll(0x0079F2FF,"Chat Cleared!");
}
return 1;
}
if(strcmp("/cc",cmdtext,true,3) == 0)
{
if(!IsPlayerAdmin(playerid))
{
for(new i = 0; i < 100; i++)
{
SendClientMessageToAll(-1, " ");
}
SendClientMessageToAll(0x0079F2FF,"Chat Cleared!");
}
return 1;
}
C:\Users\Documents\Gamemode Testing\gamemodes\Gamemode.pwn(480) : error 010: invalid function or declaration C:\Users\Documents\Gamemode Testing\gamemodes\Gamemode.pwn(482) : error 010: invalid function or declaration C:\Users\Documents\Gamemode Testing\gamemodes\Gamemode.pwn(484) : error 010: invalid function or declaration C:\Users\Documents\Gamemode Testing\gamemodes\Gamemode.pwn(490) : error 010: invalid function or declaration Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
if(strcmp("/cc",cmdtext,true,3) == 0)
{
if(!IsPlayerAdmin(playerid))
{
for(new i = 0; i < 100; i++)
SendClientMessageToAll(-1, " ");
SendClientMessageToAll(0x0079F2FF,"Chat Cleared!");
}
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/cc", true)) // no reason to specify a length parameter here IMHO
{
if(IsPlayerAdmin(playerid)) // you need to check IF they are an admin, so IsPlayerAdmin() and NOT !IsPlayerAdmin
{
for(new i = 0; i < 100; i++) SendClientMessageToAll(-1, " "); // no reason for braces surrounding a single piece of code
SendClientMessageToAll(0x0079F2FF,"Chat Cleared!");
}
return 1; // have to return 1 at the end of commands using OnPlayerCommandText
}
return 0; // OnPlayerCommandText returns 0 at the end, not 1.
}
May be true, but he/i dont know how to change it to zcmd when the whole script is strcmp.
--Same errors. |
#include <zcmd>
CMD:cc(playerid, params[])
{
if(!IsPlayerAdmin(playerid))
{
for(new i = 0; i < 100; i++)
SendClientMessageToAll(-1, " ");
SendClientMessageToAll(0x0079F2FF,"Chat Cleared!");
}
return 1;
}
C:\Users\Documents\LVCnR Testing\gamemodes\Gamemode.pwn(471) : error 029: invalid expression, assumed zero C:\Users\Documents\LVCnR Testing\gamemodes\Gamemode.pwn(471) : error 017: undefined symbol "cmd_test" C:\Users\Documents\LVCnR Testing\gamemodes\Gamemode.pwn(471) : error 029: invalid expression, assumed zero C:\Users\Documents\LVCnR Testing\gamemodes\Gamemode.pwn(471) : fatal error 107: too many error messages on one line
#include <zcmd>