SA-MP Forums Archive
making megaphone script makes my script mad? - 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: making megaphone script makes my script mad? (/showthread.php?tid=68005)



making megaphone script makes my script mad? - raido - 06.03.2009

Well right now I got a bunch of errors when I added this script:
Код:
dcmd_m(playerid, params[])
{
	if (gTeam[playerid]==LSPD)
	{
	  if (strlen(params))
	  {
	    new string[256], name[MAX_PLAYER_NAME];
	    GetPlayerName(playerid, name, sizeof(name));
	    format(string, sizeof(string), "[MEGAPHONE]%s : %s",name, params);
	    SendClientMessageToAll(COLOR_BLUE, string);
		}
	 return 1;
	}
this gave me all this :

Код:
C:\Documents and Settings\Raido\Desktop\SAMPPAWNO\Raido\gamemodes\RaidoScrip.pwn(229) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Raido\Desktop\SAMPPAWNO\Raido\gamemodes\RaidoScrip.pwn(229) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Raido\Desktop\SAMPPAWNO\Raido\gamemodes\RaidoScrip.pwn(230) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Raido\Desktop\SAMPPAWNO\Raido\gamemodes\RaidoScrip.pwn(230) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Raido\Desktop\SAMPPAWNO\Raido\gamemodes\RaidoScrip.pwn(339) : warning 217: loose indentation
C:\Documents and Settings\Raido\Desktop\SAMPPAWNO\Raido\gamemodes\RaidoScrip.pwn(342) : warning 217: loose indentation
C:\Documents and Settings\Raido\Desktop\SAMPPAWNO\Raido\gamemodes\RaidoScrip.pwn(342) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Raido\Desktop\SAMPPAWNO\Raido\gamemodes\RaidoScrip.pwn(342) : error 004: function "OnPlayerConnect" is not implemented
C:\Documents and Settings\Raido\Desktop\SAMPPAWNO\Raido\gamemodes\RaidoScrip.pwn(353) : warning 225: unreachable code
C:\Documents and Settings\Raido\Desktop\SAMPPAWNO\Raido\gamemodes\RaidoScrip.pwn(353) : warning 217: loose indentation
C:\Documents and Settings\Raido\Desktop\SAMPPAWNO\Raido\gamemodes\RaidoScrip.pwn(353) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Raido\Desktop\SAMPPAWNO\Raido\gamemodes\RaidoScrip.pwn(353) : error 004: function "OnPlayerDisconnect" is not implemented
C:\Documents and Settings\Raido\Desktop\SAMPPAWNO\Raido\gamemodes\RaidoScrip.pwn(354) : warning 217: loose indentation
C:\Documents and Settings\Raido\Desktop\SAMPPAWNO\Raido\gamemodes\RaidoScrip.pwn(356) : error 017: undefined symbol "reason"
C:\Documents and Settings\Raido\Desktop\SAMPPAWNO\Raido\gamemodes\RaidoScrip.pwn(370) : warning 225: unreachable code
C:\Documents and Settings\Raido\Desktop\SAMPPAWNO\Raido\gamemodes\RaidoScrip.pwn(370) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Raido\Desktop\SAMPPAWNO\Raido\gamemodes\RaidoScrip.pwn(370) : error 004: function "OnPlayerRequestClass" is not implemented
C:\Documents and Settings\Raido\Desktop\SAMPPAWNO\Raido\gamemodes\RaidoScrip.pwn(372) : error 001: expected token: ";", but found "{"
C:\Documents and Settings\Raido\Desktop\SAMPPAWNO\Raido\gamemodes\RaidoScrip.pwn(382) : error 017: undefined symbol "classid"
C:\Documents and Settings\Raido\Desktop\SAMPPAWNO\Raido\gamemodes\RaidoScrip.pwn(416) : warning 225: unreachable code
C:\Documents and Settings\Raido\Desktop\SAMPPAWNO\Raido\gamemodes\RaidoScrip.pwn(416) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Raido\Desktop\SAMPPAWNO\Raido\gamemodes\RaidoScrip.pwn(416) : error 004: function "OnPlayerSpawn" is not implemented
I didn't had any of this before I added megaphone command :S


Re: making megaphone script makes my script mad? - Flo_White - 06.03.2009

there's a } missing


Re: making megaphone script makes my script mad? - raido - 06.03.2009

I fixed that but if I go to server and select Police skin(LSPD) it doesn't do anything like not even UNKNOWN COMMAND...ignores


Re: making megaphone script makes my script mad? - Flo_White - 06.03.2009

Код:
dcmd_m(playerid, params[])
{
	if (gTeam[playerid]==LSPD)
	{
	  if (strlen(params))
	  {
	    new string[256], name[MAX_PLAYER_NAME];
	    GetPlayerName(playerid, name, sizeof(name));
	    format(string, sizeof(string), "[MEGAPHONE]%s : %s",name, params);
	    SendClientMessageToAll(COLOR_BLUE, string);
		}
	}
return 1;
}
doesn't this work?


Re: making megaphone script makes my script mad? - Thebest96 - 16.07.2010

or { or ;


Re: making megaphone script makes my script mad? - [HiC]TheKiller - 16.07.2010

pawn Код:
dcmd_m(playerid, params[])
{
    if (gTeam[playerid]==LSPD)
    {
         if (!strlen(params))
         {
              new string[128], name[MAX_PLAYER_NAME];
              GetPlayerName(playerid, name, sizeof(name));
              format(string, sizeof(string), "[MEGAPHONE]%s : %s",name, params);
              SendClientMessageToAll(COLOR_BLUE, string);
         }
    }
        return 1;
}
That should work.