SA-MP Forums Archive
bug script help please - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: bug script help please (/showthread.php?tid=82190)



bug script help please - LePtiRoman - 16.06.2009

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


Re: bug script help please - Weirdosport - 16.06.2009

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);
    }
}



Re: bug script help please - LePtiRoman - 16.06.2009

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.




Re: bug script help please - LePtiRoman - 17.06.2009

up?