making megaphone script makes my script mad?
#1

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
Reply
#2

there's a } missing
Reply
#3

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
Reply
#4

Код:
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?
Reply
#5

or { or ;
Reply
#6

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)