Does this need a return?
#1

Код:
public FixAllCar()
{
	for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
	{
		if(IsPlayerVipType(playerid,3))
		{
			if(IsPlayerConnected(playerid) && IsPlayerInAnyVehicle(playerid))
		{
			new vehicleid = GetPlayerVehicleID(playerid);// gettin the vehicle id
			SetVehicleHealth(vehicleid,1000.0);// set the vehicle healt
		}
	}
}
If so return 1; or return 0;?

Because im getting this error
Код:
C:\Documents and Settings\Chris\My Documents\My Received Files\FreeRoam(3).pwn(3318) : error 030: compound statement not closed at the end of file (started at line 3307)
Reply
#2

Not unless you return it in another function.

The reason for the error is that you are missing a bracket at the end of the function:
pawn Код:
public FixAllCar()
{
    for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
    {
        if(IsPlayerVipType(playerid,3))
        {
            if(IsPlayerConnected(playerid) && IsPlayerInAnyVehicle(playerid))
        {
            new vehicleid = GetPlayerVehicleID(playerid);// gettin the vehicle id
            SetVehicleHealth(vehicleid,1000.0);// set the vehicle healt
                          }
                    }
    }
}
Reply
#3

pawn Код:
public FixAllCar()
{
    for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
    {
        if(IsPlayerVipType(playerid,3))
        {
            if(IsPlayerConnected(playerid) && IsPlayerInAnyVehicle(playerid))
            {
               new vehicleid = GetPlayerVehicleID(playerid);// gettin the vehicle id
                SetVehicleHealth(vehicleid,1000.0);// set the vehicle healt
            }
        }
    }
    return 1;//You dont need it but you can use it
}
You forgot one } and you dont need return but you can use it
[EDIT]I late
Reply
#4

Thanks Guys :] Really big help xD
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)