Log error
#1

Код:
C:\Documents and Settings\Mikjo\Desktop\Roleplay\gamemodes\rp.pwn(13988) : error 017: undefined symbol "Log"
I start gm from 0 and i make forward and public for log and add in this command
Код:
CMD:fine(playerid, params[])
{
	new string[128], giveplayerid, amount, reason[64];
	if(sscanf(params, "uds", giveplayerid, amount, reason)) return SendClientMessage(playerid, COLOR_WHITE, "Koristi: /fine [playerid] [suma] [pricina]");

	if (PlayerInfo[playerid][pAdmin] >= 1)
	{
		if(IsPlayerConnected(giveplayerid))
		{
			if (amount > 50000)
			{
				SendClientMessage(playerid, COLOR_GRAD2, "Sumata nesmee da bide pogolema od 50000 $");
				return 1;
			}
			new year, month,day;
			getdate(year, month, day);
			format(string, sizeof(string), "LG Security: %s e kaznet so $% od administrator %s, pricina: %s(%d-%d-%d)", GetPlayerName(giveplayerid), amount, GetPlayerName(playerid), reason, month, day, year);
			Log("logovi/adminlog.log", string);
			format(string, sizeof(string), "LG: %s e kaznet so $% od administator %s, pricina: %s", GetPlayerName(giveplayerid), amount, GetPlayerName(playerid), reason);
			SendClientMessageToAll(COLOR_LIGHTRED, string);
			GivePlayerCash(giveplayerid, -amount);
			return 1;
		}
		else SendClientMessage(playerid, COLOR_GRAD1, "Pogresen id na igrac.");
	}
	else
	{
		SendClientMessage(playerid, COLOR_WHITE, "Nemate ovlastuvanje za koristenje na ovaa komanda.");
	}
	return 1;
}
And give me error.
How to fix this
Reply
#2

Sorry for BUMP can someone help me ??
Reply
#3

Basically, it cannot find the function 'Log' anywhere.

pawn Код:
stock Log(file[], info[])
{
    if(fexist(file))
    {
        new finalContent[200];
       
        strcat(finalContent, info);
        strcat(finalContent, "\r\n");

        new File:handle = fopen(file, io_append);

        fwrite(handle, finalContent);
        fclose(handle);
    }
    return 1;
}
I made that function quickly, add to the bottom of your script, please tell me if it gives any errors.
Reply
#4

It says you've not defined the function. They are case sensitive so "log" and "Log" will not be the same thing.
Be sure that you defined Log, and if it still doesn't work, try turning it into a stock.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)