Problem
#1

I got this error:

D:\Edvinas\Server\LG\gamemodes\RPG.pwn(310) : error 010: invalid function or declaration

On this line:

Код:
stock SiustiZinuteAdministratoriams(SPALVA,text[])

All code: stock SiustiZinuteAdministratoriams(SPALVA,text[])
{
	for(new i=0; i<MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
			if(PareigosDB[i][Administratorius] > 1)
			{
				SendClientMessage(i,0xFFFFFFAA,text);
			}
		}
	}
}
Код:
	if(listitem == 4)
{
	new A1ZINUTE[512];
    new Vardas[MAX_PLAYER_NAME];
    GetPlayerName(playerid,Vardas,MAX_PLAYER_NAME);
    format(A1ZINUTE,sizeof A1ZINUTE,"{FFFFFF}Administratorius {FF8000}%s {99FF33}I {FFFFFF}lygio pasieme ginklus.",Vardas);
	SiustiZinuteAdministratoriams(SPALVA,A1ZINUTE);
}
	return 1;
}
Код:
#define SPALVA 0xFFFFFFAA
Reply
#2

Change this
pawn Код:
stock SiustiZinuteAdministratoriams(SPALVA,text[]) //SPALVA = that parametar can't be named the same as #define
to
pawn Код:
stock SiustiZinuteAdministratoriams(Color,text[]) // so change it to something else, i used "Color"
The complete code:
pawn Код:
#define SPALVA 0xFFFFFFAA

stock SiustiZinuteAdministratoriams(Color,text[])
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(PareigosDB[i][Administratorius] > 1)
            {
                SendClientMessage(i,Color,text);
            }
        }
    }
}

//-----------
if(listitem == 4)
{
    new A1ZINUTE[80]; // This string does not need to be this big, 80 should be enough.
    new Vardas[MAX_PLAYER_NAME];
    GetPlayerName(playerid,Vardas,MAX_PLAYER_NAME);
    format(A1ZINUTE,sizeof A1ZINUTE,"{FFFFFF}Administratorius {FF8000}%s {99FF33}I {FFFFFF}lygio pasieme ginklus.",Vardas);
    SiustiZinuteAdministratoriams(SPALVA,A1ZINUTE);
}
Reply
#3

Quote:
Originally Posted by Antonio144
Посмотреть сообщение
Change this
pawn Код:
stock SiustiZinuteAdministratoriams(SPALVA,text[]) //SPALVA = that parametar can't be named the same as #define
to
pawn Код:
stock SiustiZinuteAdministratoriams(Color,text[]) // so change it to something else, i used "Color"
The complete code:
pawn Код:
#define SPALVA 0xFFFFFFAA

stock SiustiZinuteAdministratoriams(Color,text[])
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(PareigosDB[i][Administratorius] > 1)
            {
                SendClientMessage(i,Color,text);
            }
        }
    }
}

//-----------
if(listitem == 4)
{
    new A1ZINUTE[80]; // This string does not need to be this big, 80 should be enough.
    new Vardas[MAX_PLAYER_NAME];
    GetPlayerName(playerid,Vardas,MAX_PLAYER_NAME);
    format(A1ZINUTE,sizeof A1ZINUTE,"{FFFFFF}Administratorius {FF8000}%s {99FF33}I {FFFFFF}lygio pasieme ginklus.",Vardas);
    SiustiZinuteAdministratoriams(SPALVA,A1ZINUTE);
}
Thanks for helping
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)