Need Help!! [ASAP]
#1

Hello,
I was trying to combine the /lock sys and autoflip script together.
When i do i get this error i cant seem to fix. Sorry im noob im trying to learn
Mind if you help?
Code:
public AutoRepair()
{
	for(new playerid=0; playerid<MAX_PLAYERS; playerid++)
	{
	    if (AutoRepairTrigger[playerid] == 1) return 1;
	    if (IsPlayerInAnyVehicle(playerid))
	    {
			if (AutoRepairUsed[playerid] == 3)
			{
				SetVehicleZAngle(GetPlayerVehicleID(playerid), 0.0);
				AutoRepairUsed[playerid] = 0;
			}
			new Float:CarHP;
			GetVehicleHealth(GetPlayerVehicleID(playerid), CarHP);
            if (CarHP < 350)
            {
                new Float:X, Float:Y, Float:Z;
				RepairVehicle(GetPlayerVehicleID(playerid));
                GameTextForPlayer(playerid, "~y~Vehicle ~r~Auto ~y~Repaired!",2000,5);
                PlayerPlaySound(playerid, 1133, X, Y, Z);
                AutoRepairUsed[playerid] = AutoRepairUsed[playerid] +1;
			}
		}
	}
	return 1;
}

public AutoFlipReset()
{
	for(new playerid=0; playerid<MAX_PLAYERS; playerid++)
	{
	    AutoRepairUsed[playerid] = 0;
	}
	return 1;
}

dcmd_ar(playerid, params[])
{
	#pragma unused params
	if (AutoRepairTrigger[playerid] == 0)
	{
	    AutoRepairTrigger[playerid] = 1;
	    SendClientMessage(playerid, 0x99FFFFAA, "[AutoRepair/Flip] Disabled, Use ''/ar'', or ''/autorepair'' To Enable It Again!");
	    return 1;
	}
	else if (AutoRepairTrigger[playerid] == 1)
	{
	    AutoRepairTrigger[playerid] = 0;
	    SendClientMessage(playerid, 0x99FFFFAA, "[AutoRepair/Flip] Enabled");
	    return 1;
	}
	return 1;
}

dcmd_autorepair(playerid, params[])
{
	return dcmd_ar(playerid, params);
}
Reply
#2

whats the error?
Reply
#3

This is the error.
Code:
C:\Documents and Settings\- - Original - -\Desktop\REPAIRLOCK.pwn(107) : warning 235: public function lacks forward declaration (symbol "OnPlayerPrivmsg")
C:\Documents and Settings\- - Original - -\Desktop\REPAIRLOCK.pwn(169) : warning 217: loose indentation
C:\Documents and Settings\- - Original - -\Desktop\REPAIRLOCK.pwn(170) : warning 217: loose indentation
C:\Documents and Settings\- - Original - -\Desktop\REPAIRLOCK.pwn(174) : error 010: invalid function or declaration
C:\Documents and Settings\- - Original - -\Desktop\REPAIRLOCK.pwn(177) : warning 235: public function lacks forward declaration (symbol "OnPlayerInfoChange")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#4

okay OnPlayerPrivmsg and OnPlayerInfoChange need to be forward as they are public functions

pawn Code:
forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{

}
this is an example..

youll need to find the functions and copy them with the arguments and make the forward above them



and can you tell me what code is on line (174)
Reply
#5

Ughhm, Im very noob at this may someone just make it work.
This is the error line.
Code:
            if(IsPlayerInAnyVehicle(playerid))
            {
                    new State=GetPlayerState(playerid);
                    if(State!=PLAYER_STATE_DRIVER)
                    {
                            SendClientMessage(playerid,0xFF004040,"You can only unlock the doors as the driver.");
                            return 1;
                    }
                    new i;
                    for(i=0;i<MAX_PLAYERS;i++)
                    {
                            SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 0);
                    }
                    SendClientMessage(playerid, 0x33AA33AA, "Vehicle unlocked!");
                    new Float:pX, Float:pY, Float:pZ;
                    GetPlayerPos(playerid,pX,pY,pZ);
                    PlayerPlaySound(playerid,1057,pX,pY,pZ);
            }
            else
            {
            SendClientMessage(playerid, 0xFF004040, "You're not in a vehicle!");
            }
            return 1;
    }
        dcmd(ar, 2, cmdtext);
	dcmd(autorepair, 10, cmdtext);
	return 0;

	}
            return 1;      <=========== THAT IS LINE 175 / MAYBE SOMETHING UP THERE IS WRONG?
    }
Reply
#6

PlayerPlaySound?! You sure you defined and all the other stuff?
Reply
#7

I have no clue....................................
Reply
#8

the problem is the errors from what i can tell don't match the code.

OnPlayerInfoChange i don't see this anywhere in the code you show
According to the wiki OnPlayerPrivmsg was removed in in SA-MP 0.3
and i also don't see this being used in the code you posted
Reply
#9

Loose indentation is missing brackets or brackets that are missed placed, so fix them first
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)