Compile Errors for Suspect Command.
#1

C:\Games\Rockstar Games\GTA San Andreas\pawno\arp.pwn(579) : error 012: invalid function call, not a valid address
C:\Games\Rockstar Games\GTA San Andreas\pawno\arp.pwn(579) : warning 215: expression has no effect
C:\Games\Rockstar Games\GTA San Andreas\pawno\arp.pwn(579) : error 001: expected token: ";", but found ")"
C:\Games\Rockstar Games\GTA San Andreas\pawno\arp.pwn(579) : error 029: invalid expression, assumed zero
C:\Games\Rockstar Games\GTA San Andreas\pawno\arp.pwn(579) : fatal error 107: too many error messages on one line


Код:
	if( strcmp("/suspect", cmdtext, true ) == 0 || strcmp("/su", cmdtext, true ) == 0 )
 	{
 	  new param1[256];
 		GetPlayerName (playerid, playername, sizeof(playername));
		if (gTeam[playerid] == TEAM_POLICE)
		{
			new suspect;
			if( !strlen(param1))
			{
				SendClientMessage (playerid, 0xAA3333AA, "Usage: /suspect [player id] [reason (one word only)]" );
				return 1;
			}
			suspect = strval(param1);
			if (suspect == playerid )
			{
				SendClientMessage (playerid, 0xAA3333AA, "You can not suspect yourself!");
				return 1;
			}
			if (IsPlayerConnected (suspect) == 0 )
			{
			  SendClientMessage (playerid, 0xAA3333AA, "You can not suspect people who are not connected!");
			  return 1;
			}
			new client_msg[ 256 ];
			format (client_msg, sizeof( client_msg ), "Player %s suspected of: %s by Officer %s.", playername(suspect), param2, playername(playerid));
			SendClientMessageToAll( 0xF69100AA, client_msg );
			SetPlayerColor( suspect, 0xF69100AA );
			IsSuspect[ suspect ] = 1;
 	 		return 1;
		}
		else
		{
			SendClientMessage( playerid, COLOR_RED, "You must be Law Enforcement to suspect people." );
		}
	}
I am confused beyond measure.

I may be doing the code all wrong, but basically all jobs are TEAM_(job) and civilians are TEAM_CIVILIAN.

Basically, when a cop does /su [id] [reason], it places them on TEAM_WANTED.

I also need a /unsuspect that puts them back onto the team they were on before (their job). But that's another day.

Any ideas?

Line 579:
Код:
format (client_msg, sizeof( client_msg ), "Player %s suspected of: %s by Officer %s.", playername(suspect), param2, playername(playerid));
Reply
#2

No one has a clue? Maybe there's a better suspect command that I could use?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)