Error 017:Undefined Symbol "printf"
#1

This is the error.
Quote:

: warning 235: public function lacks forward declaration (symbol "OnVehicleMod")
: error 017: undefined symbol "printf"
: warning 215: expression has no effect
: error 001: expected token: ";", but found "]"
: error 029: invalid expression, assumed zero
: fatal error 107: too many error messages on one line

I need help on this.

Код:
public OnVehicleMod(playerid, vehicleid, componentid)
{
	printf("[OnVehicleMod]: '%s(%d)' has attached %d on %d", pName[playerid], playerid, componentid, vehicleid);
 	if(BoughtVehicle[playerid] == true)
	{
		if(vehicleid == PlayerVehicle[playerid])
		{
			SavePVComponents(playerid, componentid);
		}
	}
	if(GetPlayerInterior(playerid) == 0)
 	{
  		format(str, sizeof(str), "* ADMIN-MSG: "GREY_E"%s(%i) has attempted to install an invalid vehicle mod.", pName[playerid], playerid);
		SendAdminMessage(COLOR_RED, str);
  		return 0;
    }
	new vehicleide = GetVehicleModel(vehicleid);
    new modok = islegalcarmod(vehicleide, componentid);
    if (!modok)
	{
        printf("[invalid_mod] %s %d %d %d %d %d", pName[playerid], playerid, vehicleid, vehicleide, componentid);
        format(str, sizeof(str), "4Anti-Cheat 4%s(%i) has been kicked for attempting to install an invalid vehicle mod.", pName[playerid], playerid);
		IRC_GroupSay(ircGroup, IRC_CHANNEL, str), IRC_GroupSay(ircGroup, IRC_aCHANNEL, str);
		format(str, sizeof(str), ""GREY_E"Anti-Cheat: "RED_E"%s(%i) has been kicked for attempting to install an invalid vehicle mod.", pName[playerid], playerid);
		SendClientMessageToAll(COLOR_RED, str);
        Kick(playerid);
        return 0;
    }
    return 1;
}
Reply
#2

pawn Код:
public OnVehicleMod(playerid, vehicleid, componentid)
{
    printf("[OnVehicleMod]: '%s(%d)' has attached %d on %d", pName[playerid], playerid, componentid, vehicleid);
    if(BoughtVehicle[playerid] == true)
    {
        if(vehicleid == PlayerVehicle[playerid])
        {
            SavePVComponents(playerid, componentid);
        }
    }
    if(GetPlayerInterior(playerid) == 0)
    {
        format(str, sizeof(str), "* ADMIN-MSG: "GREY_E"%s(%i) has attempted to install an invalid vehicle mod.", pName[playerid], playerid);
        SendAdminMessage(COLOR_RED, str);
        return 0;
    }
    new vehicleide = GetVehicleModel(vehicleid);
    new modok = islegalcarmod(vehicleide, componentid);
    if (!modok)
    {
        printf("[invalid_mod] %s %d %d %d %d", pName[playerid], playerid, vehicleid, vehicleide, componentid);
        format(str, sizeof(str), "4Anti-Cheat 4%s(%i) has been kicked for attempting to install an invalid vehicle mod.", pName[playerid], playerid);
        IRC_GroupSay(ircGroup, IRC_CHANNEL, str), IRC_GroupSay(ircGroup, IRC_aCHANNEL, str);
        format(str, sizeof(str), ""GREY_E"Anti-Cheat: "RED_E"%s(%i) has been kicked for attempting to install an invalid vehicle mod.", pName[playerid], playerid);
        SendClientMessageToAll(COLOR_RED, str);
        Kick(playerid);
        return 0;
    }
    return 1;
}
Reply
#3

Forward the function. The variables have to be declared. Also read here:
forward OnVehicleMod(playerid, vehicleid, componentid);

https://sampforum.blast.hk/showthread.php?tid=152262

And for the other error you should give us at least the lines.

you could also try to find out how to fix that: expected token: ";", but found "]"

by yourself. That's actually a pretty little mistake and it's mostly easy to solve.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)