bug script help please
#1

hello, and sorry for my bad english, ...

i Want a script when if an Admin use a cmd, my script send a message just to admin, but i've bug .

what the bug please?

forward MessageToAdmins(color,const string[]);
public MessageToAdmins(color,const string[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) == 1) if (PlayerInfo[i][Level] >= 1) SendClientMessage(i, color, string);
}
return 1;
}
Код:
stock CMDMessageToAdmins(playerid,command[])
{
	if(ServerInfo[AdminCmdMsg] == 0) return 1;
	new string[128]; GetPlayerName(playerid,string,sizeof(string));
	format(string,sizeof(string),"[ADMIN] %s has used the command %s",string,command);
	return MessageToAdmins(blue,string);
}
and the error is
Quote:

C:\Program Files\Rockstar Games\GTA San Andreas\le ptiroman\gamemodes\LePtiRomand.pwn(16343) : warning 217: loose indentation
C:\Program Files\Rockstar Games\GTA San Andreas\le ptiroman\gamemodes\LePtiRomand.pwn(16343) : error 029: invalid expression, assumed zero
C:\Program Files\Rockstar Games\GTA San Andreas\le ptiroman\gamemodes\LePtiRomand.pwn(16343) : error 017: undefined symbol "MessageToAdmins"
C:\Program Files\Rockstar Games\GTA San Andreas\le ptiroman\gamemodes\LePtiRomand.pwn(16343) : error 029: invalid expression, assumed zero
C:\Program Files\Rockstar Games\GTA San Andreas\le ptiroman\gamemodes\LePtiRomand.pwn(16343) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

HELP ME PLEASE
Reply
#2

Errr, which script are you talking about, you posted 2?

I think setting them out properly would help...

pawn Код:
forward MessageToAdmins(color,const string[]);
public MessageToAdmins(color,const string[])
{
  for(new i = 0; i < MAX_PLAYERS; i++)
  {
   if(IsPlayerConnected(i))
   {
     if (PlayerInfo[i][Level] >= 1)
     {
       SendClientMessage(i, color, string);
     }
   }
  }
  return 1;
}
pawn Код:
stock CMDMessageToAdmins(playerid,command[])
{
    if(!ServerInfo[AdminCmdMsg])
    {
        return 1;
    }
    else
    {
        new string[128];
        GetPlayerName(playerid,string,sizeof(string));
        format(string,sizeof(string),"[ADMIN] %s has used the command %s",string,command);
        return MessageToAdmins(blue,string);
    }
}
Reply
#3

if a take

Код:
stock CMDMessageToAdmins(playerid,command[])
{
	if(!ServerInfo[AdminCmdMsg])
	{
		return 1;
	}
	else
	{
		new string[128];
		GetPlayerName(playerid,string,sizeof(string));
		format(string,sizeof(string),"[ADMIN] %s has used the command %s",string,command);
		return MessageToAdmins(blue,string);
	}
}


i've

Quote:

C:\Program Files\Rockstar Games\GTA San Andreas\le ptiroman\gamemodes\LePtiRomand.pwn(1630 : warning 217: loose indentation
C:\Program Files\Rockstar Games\GTA San Andreas\le ptiroman\gamemodes\LePtiRomand.pwn(1630 : error 029: invalid expression, assumed zero
C:\Program Files\Rockstar Games\GTA San Andreas\le ptiroman\gamemodes\LePtiRomand.pwn(1630 : error 017: undefined symbol "CMDMessageToAdmins"
C:\Program Files\Rockstar Games\GTA San Andreas\le ptiroman\gamemodes\LePtiRomand.pwn(16310) : error 017: undefined symbol "ServerInfo"
C:\Program Files\Rockstar Games\GTA San Andreas\le ptiroman\gamemodes\LePtiRomand.pwn(16310) : error 017: undefined symbol "AdminCmdMsg"
C:\Program Files\Rockstar Games\GTA San Andreas\le ptiroman\gamemodes\LePtiRomand.pwn(16310) : error 029: invalid expression, assumed zero
C:\Program Files\Rockstar Games\GTA San Andreas\le ptiroman\gamemodes\LePtiRomand.pwn(16310) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


6 Errors.

Reply
#4

up?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)