SA-MP Forums Archive
Error 004 - - 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)
+--- Thread: Error 004 - (/showthread.php?tid=629224)



Error 004 - - VixxeN - 22.02.2017

I recive that error:
Код HTML:
forward SendFactionMessage(faction, color, string[]);
I own that code:
Код HTML:
error 004: function "SendFactionMessage" is not implemented
Script:
Код HTML:
CMD:invite(playerid, params[])
{
	new
	pID;

	if(sscanf(params, "ud", pID)) return SendClientMessage(playerid, COLOR_GREY, "[Usage:] /invite [playerid/partofname]");
 	if(!IsPlayerConnected(pID)) return SCM(playerid, COLOR_LIGHTRED,"That player is not connected.");
 	if(PlayerInfo[playerid][fRank] > 2)
 	{
 	    new string[128];
 	    new faction = PlayerInfo[playerid][pFaction];
		format(string, sizeof(string), "You have been invited to join %s. (/acceptinvite)", FactionInfo[faction][fName]);
		SendClientMessage(pID, COLOR_FACTIONCHAT, string);
		format(string, sizeof(string), "You have sent an invitation to %s.", GetName(pID));
		SendClientMessage(playerid, COLOR_FACTIONCHAT, string);
		factionInvited[pID] = true;
		Player_Invited[pID] = playerid;
	}
	return 1;
}



Re: Error 004 - - Unte99 - 22.02.2017

Do you even have SendFactionMessage function created?


Re: Error 004 - - VixxeN - 22.02.2017

Quote:
Originally Posted by Unte99
Посмотреть сообщение
Do you even have SendFactionMessage function created?
Yes...this no?
Код HTML:
forward SendFaction(faction, color, string[]);
If this is a not good function, i can recive a function script?


Re: Error 004 - - VixxeN - 22.02.2017

Anyone plz? :C


Re: Error 004 - - Dayrion - 22.02.2017

Show the whole function of
Код:
forward SendFaction(faction, color, string[]);



Re: Error 004 - - VixxeN - 22.02.2017

Quote:
Originally Posted by Dayrion
Посмотреть сообщение
Show the whole function of
Код:
forward SendFaction(faction, color, string[]);
Код HTML:
stock SendFactionMessage(col, string[])
{
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(PlayerInfo[i][pFaction] > 0)
			SendClientMessage(i, col, string);
	}

	return 1;
}
And i get error at this: stock SendFactionMessage(col, string[])
This error: error 025: function heading differs from prototype


Re: Error 004 - - Unte99 - 22.02.2017

Код:
forward SendFactionMessage(faction, color, string[]);
Код:
stock SendFactionMessage(col, string[])



Re: Error 004 - - VixxeN - 22.02.2017

Quote:
Originally Posted by Unte99
Посмотреть сообщение
Код:
forward SendFactionMessage(faction, color, string[]);
Код:
stock SendFactionMessage(col, string[])
:/
I have that: error 025: function heading differs from prototype

Full CMD:
Код HTML:
stock SendFactionMessage(col, string[])
{
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(PlayerInfo[i][pFaction] > 0)
			SendClientMessage(i, col, string);
	}

	return 1;
}
Problem Line:
Код HTML:
stock SendAdminMessage(col, string[])



Re: Error 004 - - Unte99 - 22.02.2017

Код:
forward SendFactionMessage(faction, color, string[]);
Код:
stock SendFactionMessage( ... , col, string[])
And why do you even need the forward....?


Re: Error 004 - - VixxeN - 22.02.2017

Quote:
Originally Posted by Unte99
Посмотреть сообщение
Код:
forward SendFactionMessage(faction, color, string[]);
Код:
stock SendFactionMessage( ... , col, string[])
No way :C

error 025: function heading differs from prototype

CODE:
Код HTML:
stock SendFactionMessage(faction, col, string[])
{
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(PlayerInfo[i][pFaction] > 0)
			SendClientMessage(i, col, string);
	}

	return 1;
}
Correct way to resolve this?