[REQ]Scripting Help
#1

I know it's kinda embarrassing for me to ask for help in this area.

I can't seem to find my error' :
Код:
C:\Users\Akira\Desktop\[Server]\gamemodes\MSRP2.pwn(55952) : error 035: argument type mismatch (argument 3)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Код:
CMD:robbank(playerid, params[])

{
	if(PlayerInfo[playerid][pLevel] < 3)

	{
		SendClientMessage(playerid, COLOR_GREY, "You must be a level 3 or higher to be able to rob the bank.");
		return 1;

	}
	if(IsACop(playerid))

	{
		SendClientMessage(playerid, COLOR_GREY, "Law Enforcement Officials cannot rob the bank.");
		return 1;

	}
	if(!IsPlayerInRangeOfPoint(playerid, 3.0, 2388.4727, -1596.8754, 785.6183))

	{
		SendClientMessage(playerid, COLOR_GREY, "You are not at the bank safe.");
		return 1;

	}
	if(TimeAfterBankJob < TIME_BETWEEN_BANKJOBS)

	{
		new bjt;
		new string[128];
		bjt = TIME_BETWEEN_BANKJOBS - TimeAfterBankJob;
		format(string, sizeof(string), "   You must wait %d hours before making the next bank robbery attempt.", bjt);
		SendClientMessage(playerid, COLOR_GREY, string);
		return 1;

	}
	if(BankJobPlayer < 999 && BankJobPlayer != playerid)

	{
		SendClientMessage(playerid, COLOR_GREY, "   Someone is already robbing the bank.");
		return 1;

	}
	if(BankJobPlayer == playerid)

	{
	    new string[128];
		format(string, 256, "   You're already robbing the bank! %d minutes left.", BankJobTime / 2);
		SendClientMessage(playerid, COLOR_GREY, string);
		return 1;

	}
	new Cops = 0;
	for(new i = 0; i < MAX_PLAYERS; i++)

	{
		if(IsACop(i))

		{
			Cops += 1;

		}

	}
	if(!(Cops >= 0))

	{
		SendClientMessage(playerid,COLOR_GREY,"   There must be at least 6 Law Enforcement Officials online.");
		return 1;

	}
	new string[128];
	new giveplayerid;
	format(string, 256, "You have started the robbery, you must stay inside the bank for %d minutes.", BANK_JOB_TIME);
	ABroadCast( COLOR_YELLOW, "{AA3333}AdmWarning{FFFF00}: %s has possibly started robbing the bank without permission.", GetPlayerNameEx(playerid) );
	ABroadCast( COLOR_YELLOW, string, 4 );
	SetPlayerColor(playerid, COLOR_TWRED);
	SetPlayerToTeamColor(playerid);
	SendClientMessage(playerid, COLOR_WHITE, string);
	if(PlayerInfo[MAX_PLAYERS][pWantedLevel] <= 1)

	{
		WantedPoints[giveplayerid] += 6;

	}
	else if(PlayerInfo[MAX_PLAYERS][pWantedLevel] >= 2)

	{
		WantedPoints[giveplayerid] += 6;

	}
	SetPlayerCriminal(playerid, 999, "Bank Robbery");
	format(string, 256, "City Alert: The Bank Is Being Robbed!");
	SendClientMessageToAll(COLOR_LIGHTBLUE, string);
	BankJobTime = BANK_JOB_TIME;
	BankJobPlayer = playerid;
	return 1;

})
Coding, for the CMD:robbank
Is suppose to send a admin warning for the Head Administrator to approve for the player to /robbank. Yet I can only get it to send a admin warning.

Note : When working with NGG I wasn't inside this kind of department I was inside a different area. So this kind of stuff isn't my thing.
Reply
#2

Can you show exactly what line makes the error ?
Reply
#3

Edited the read-^
Reply
#4

Replace 3 lines,before the error line and after,and delete the number(4) as it makes no sense,like this -
pawn Код:
format(string, 256, "You have started the robbery, you must stay inside the bank for %d minutes.", BANK_JOB_TIME);
ABroadCast( COLOR_YELLOW, string);
ABroadCast( COLOR_YELLOW, "{AA3333}AdmWarning{FFFF00}: %s has possibly started robbing the bank without permission.", GetPlayerNameEx(playerid) );
EDIT: seems like you've defined it with SendClientMessageToAll,if it is.
than here -
pawn Код:
new string[128],string2[128];
new giveplayerid;
format(string, sizeof(string2), "You have started the robbery, you must stay inside the bank for %d minutes.", BANK_JOB_TIME);
ABroadCast( COLOR_YELLOW, string);
format(string2,sizeof(string2),"{AA3333}AdmWarning{FFFF00}: %s has possibly started robbing the bank without permission.",GetPlayerNameEx(playerid));
ABroadCast( COLOR_YELLOW, string2);
Reply
#5

Show us your ABroadCast function.

It looks like the second time you used it, you were using an id, or a number, and then the first time, you used a name.

So you used an integer in one, and a string in the other.
Reply
#6

Quote:
Originally Posted by xkirill
Посмотреть сообщение
Replace 3 lines,before the error line and after,and delete the number(4) as it makes no sense,like this -
pawn Код:
format(string, 256, "You have started the robbery, you must stay inside the bank for %d minutes.", BANK_JOB_TIME);
ABroadCast( COLOR_YELLOW, string);
ABroadCast( COLOR_YELLOW, "{AA3333}AdmWarning{FFFF00}: %s has possibly started robbing the bank without permission.", GetPlayerNameEx(playerid) );
EDIT: seems like you've defined it with SendClientMessageToAll,if it is.
than here -
pawn Код:
new string[128],string2[128];
new giveplayerid;
format(string, sizeof(string2), "You have started the robbery, you must stay inside the bank for %d minutes.", BANK_JOB_TIME);
ABroadCast( COLOR_YELLOW, string);
format(string2,sizeof(string2),"{AA3333}AdmWarning{FFFF00}: %s has possibly started robbing the bank without permission.",GetPlayerNameEx(playerid));
ABroadCast( COLOR_YELLOW, string2);
Disappointly, it didn't work nor fix my issue.
Reply
#7

What parameters does your function use?

I noticed the first parameter was the color, the next was the string, and then the next I have no idea what it was. But like I said, you used a string for the third parameter as-well as an integer when you used it again somewhere else.
Reply
#8

Think i've fixed it myself,

Thank you Kindred and Xkirill.

/request/close
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)