SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 19/12/2011, 05:14 AM   #1
SomebodyAndMe
Huge Clucker
 
SomebodyAndMe's Avatar
 
Join Date: Feb 2010
Location: 52.511938,6.092434 find it.
Posts: 471
Reputation: 21
Default Error in script (rep+)

I have asked some help with this function, but now it gives me the following error.

Can anyone help me?

Code:
C:\Users\Barbara\Desktop\SAMP Kevin\hoi\pawno\include\PPC_Housing.inc(292) : error 029: invalid expression, assumed zero
C:\Users\Barbara\Desktop\SAMP Kevin\hoi\pawno\include\PPC_Housing.inc(292) : warning 215: expression has no effect
C:\Users\Barbara\Desktop\SAMP Kevin\hoi\pawno\include\PPC_Housing.inc(292) : error 001: expected token: ";", but found ")"
C:\Users\Barbara\Desktop\SAMP Kevin\hoi\pawno\include\PPC_Housing.inc(292) : error 029: invalid expression, assumed zero
C:\Users\Barbara\Desktop\SAMP Kevin\hoi\pawno\include\PPC_Housing.inc(292) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
The script with line 292:
pawn Code:
if(_:AVehicleData[vid][ZaText] != 0)Delete3DTextLabel(AVehicleData[vid][ZaText]);
    vid = House_AddVehicle(HouseID, cModel, cPaint, cComponents, Float:cx, Float:cy, Float:cz, Float:crot, Col1, Col2);///reference this line
    new string[50];format(string, 50, "Owner:{77FF00}%s",AVehicleData[vid][Owner]);
    AVehicleData[vid][ZaText] = Create3DTextLabel(string,0xFF0000FF,cx,cy,cz,40,1);
    Attach3DTextLabelToVehicle(AVehicleData[vid][ZaText],vid,0.0,0.0,+0.4); //line 292
SomebodyAndMe is offline   Reply With Quote
Old 19/12/2011, 05:21 AM   #2
Steven82
High-roller
 
Join Date: Nov 2009
Posts: 2,431
Reputation: 186
Default Re: Error in script (rep+)

pawn Code:
Attach3DTextLabelToVehicle(AVehicleData[vid][ZaText],vid,0.0,0.0,0.4);

Try that. It might be the random little "+" sign you had in there.
__________________
If you read my old posts; I apologize in advance.
Steven82 is offline   Reply With Quote
Old 19/12/2011, 05:22 AM   #3
xxmitsu
Gangsta
 
Join Date: Feb 2009
Posts: 622
Reputation: 36
Default Re: Error in script (rep+)

try this:
pawn Code:
if(_:AVehicleData[vid][ZaText] != 0) Delete3DTextLabel(AVehicleData[vid][ZaText]);
    vid = House_AddVehicle(HouseID, cModel, cPaint, cComponents, cx, cy, cz, crot, Col1, Col2);
    new string[50];
    format(string, 50, "Owner:{77FF00}%s",AVehicleData[vid][Owner]);
    AVehicleData[vid][ZaText] = Create3DTextLabel(string,0xFF0000FF,cx,cy,cz,40,1);
    Attach3DTextLabelToVehicle(AVehicleData[vid][ZaText],vid,0.0,0.0,0.4);
__________________
aka xanto - Retired - Former eGaming.ro technical staff.
xxmitsu is offline   Reply With Quote
Old 19/12/2011, 05:31 AM   #4
SomebodyAndMe
Huge Clucker
 
SomebodyAndMe's Avatar
 
Join Date: Feb 2010
Location: 52.511938,6.092434 find it.
Posts: 471
Reputation: 21
Default Re: Error in script (rep+)

Well now it compiled all well. but now the text doesn't shows up at the car.
SomebodyAndMe is offline   Reply With Quote
Old 19/12/2011, 05:36 AM   #5
xxmitsu
Gangsta
 
Join Date: Feb 2009
Posts: 622
Reputation: 36
Default Re: Error in script (rep+)

Are you sure that your House_AddVehicle function returns the id of the created vehicle?
__________________
aka xanto - Retired - Former eGaming.ro technical staff.
xxmitsu is offline   Reply With Quote
Old 19/12/2011, 05:39 AM   #6
SomebodyAndMe
Huge Clucker
 
SomebodyAndMe's Avatar
 
Join Date: Feb 2010
Location: 52.511938,6.092434 find it.
Posts: 471
Reputation: 21
Default Re: Error in script (rep+)

Yes it does,

pawn Code:
House_AddVehicle(HouseID, cModel, cPaint, cComponents[], Float:cx, Float:cy, Float:cz, Float:crot, Col1, Col2)
{
    // Setup local variables
    new vid, CarSlot;

    // Get a free carslot from the house
    CarSlot = House_GetFreeCarSlot(HouseID);

    // Check if there is a free carslot
    if (CarSlot != -1)
    {
        // Create a new vehicle and get the vehicle-id
        vid = CreateVehicle(cModel, cx, cy, cz, crot, Col1, Col2, 600);
        // Store the vehicle-id in the house's free carslot
        AHouseData[HouseID][VehicleIDs][CarSlot] = vid;

        // Save the model of the vehicle
        AVehicleData[vid][Model] = cModel;
        // Save the paintjob of the vehicle and apply it
        AVehicleData[vid][PaintJob] = cPaint;
        if (cPaint != 0)
            ChangeVehiclePaintjob(vid, cPaint - 1);

        // Also update the car-color
        ChangeVehicleColor(vid, Col1, Col2);
        // Save the colors of the vehicle
        AVehicleData[vid][Color1] = Col1;
        AVehicleData[vid][Color2] = Col2;

        // Save the components of the vehicle and apply them
        for (new i; i < 14; i++)
        {
            AVehicleData[vid][Components][i] = cComponents[i];
            // Check if the componentslot has a valid component-id
            if (AVehicleData[vid][Components][i] != 0)
                AddVehicleComponent(vid, AVehicleData[vid][Components][i]); // Add the component to the vehicle
        }

        // Save the spawn-data of the vehicle
        AVehicleData[vid][SpawnX] = cx;
        AVehicleData[vid][SpawnY] = cy;
        AVehicleData[vid][SpawnZ] = cz;
        AVehicleData[vid][SpawnRot] = crot;
        // Also set the fuel to maximum
        AVehicleData[vid][Fuel] = MaxFuel;
        // Also set the owner
        AVehicleData[vid][Owned] = true;
        format(AVehicleData[vid][Owner], 24, AHouseData[HouseID][Owner]);
        // Save the HouseID for the vehicle
        AVehicleData[vid][BelongsToHouse] = HouseID;
    }
    else // No free carslot was found, return 0
        return 0;

    // Exit the function and return the vehicle-id
    return vid; // Here....
}
SomebodyAndMe is offline   Reply With Quote
Old 19/12/2011, 05:46 AM   #7
SomebodyAndMe
Huge Clucker
 
SomebodyAndMe's Avatar
 
Join Date: Feb 2010
Location: 52.511938,6.092434 find it.
Posts: 471
Reputation: 21
Default Re: Error in script (rep+)

Well found something else interesting, it now shows up only when u /park it..

Strange..
SomebodyAndMe is offline   Reply With Quote
Old 19/12/2011, 05:57 AM   #8
xxmitsu
Gangsta
 
Join Date: Feb 2009
Posts: 622
Reputation: 36
Default Re: Error in script (rep+)

pawn Code:
vid = House_AddVehicle(HouseID, cModel, cPaint, cComponents, cx, cy, cz, crot, Col1, Col2);
    new string[50];
    format(string, 50, "Owner:{77FF00}%s",AVehicleData[vid][Owner]);
    if(_:AVehicleData[vid][ZaText] != 0) Update3DTextLabelText(AVehicleData[vid][ZaText], 0xFFFFFFFF, string);
    else
    {
        AVehicleData[vid][ZaText] = Create3DTextLabel(string,0xFF0000FF,cx,cy,cz,40,1);
        Attach3DTextLabelToVehicle(AVehicleData[vid][ZaText],vid,0.0,0.0,0.4);
    }


?
__________________
aka xanto - Retired - Former eGaming.ro technical staff.
xxmitsu is offline   Reply With Quote
Old 19/12/2011, 05:58 AM   #9
[MG]Dimi
High-roller
 
[MG]Dimi's Avatar
 
Join Date: Mar 2011
Location: Serbia
Posts: 1,239
Reputation: 144
Default Re: Error in script (rep+)

You guys are kidding, right?

C:\Users\Barbara\Desktop\SAMP Kevin\hoi\pawno\include\PPC_Housing.inc(292) : error 029: invalid expression, assumed zero
C:\Users\Barbara\Desktop\SAMP Kevin\hoi\pawno\include\PPC_Housing.inc(292) : warning 215: expression has no effect
C:\Users\Barbara\Desktop\SAMP Kevin\hoi\pawno\include\PPC_Housing.inc(292) : error 001: expected token: ";", but found ")"
C:\Users\Barbara\Desktop\SAMP Kevin\hoi\pawno\include\PPC_Housing.inc(292) : error 029: invalid expression, assumed zero
C:\Users\Barbara\Desktop\SAMP Kevin\hoi\pawno\include\PPC_Housing.inc(292) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.

Give us lines 280-300 of this include. Don't try to compile include!
__________________
Scripting Admin/Account/VIP Systems for $$$ using ZCMD,dcmd, Dini, MySQL and sscanf.Scripting IRC Systems with all possible functions. (Echo channels, Chat channels, Admin channels...)Long time Experience with IRC Systems.For both offers PM me
Mini Games ServerServer IP:178.238.236.62:7777
[MG]Dimi is offline   Reply With Quote
Old 19/12/2011, 06:37 AM   #10
SomebodyAndMe
Huge Clucker
 
SomebodyAndMe's Avatar
 
Join Date: Feb 2010
Location: 52.511938,6.092434 find it.
Posts: 471
Reputation: 21
Default Re: Error in script (rep+)

Function where to label is in:

pawn Code:
House_ReplaceVehicle(HouseID, CarSlot) // 263
{
    // Setup local variables
    new vid, cModel, cPaint, cComponents[14], Float:cx, Float:cy, Float:cz, Float:crot, Col1, Col2, Float:Health, cFuel;
    new panels, doors, lights, tires;

    // Get the data from the already existing vehicle that was parked before
    vid = AHouseData[HouseID][VehicleIDs][CarSlot];
    cModel = AVehicleData[vid][Model];
    cPaint = AVehicleData[vid][PaintJob];
    cFuel = AVehicleData[vid][Fuel];
    for (new i; i < 14; i++)
        cComponents[i] = AVehicleData[vid][Components][i];
    Col1 = AVehicleData[vid][Color1];
    Col2 = AVehicleData[vid][Color2];
    cx = AVehicleData[vid][SpawnX];
    cy = AVehicleData[vid][SpawnY];
    cz = AVehicleData[vid][SpawnZ];
    crot = AVehicleData[vid][SpawnRot];
    GetVehicleHealth(vid, Health);
    GetVehicleDamageStatus(vid, panels, doors, lights, tires);

    // Delete the vehicle and clear the data
    Vehicle_Delete(vid);

    // Create a new vehicle in the same carslot
    if(_:AVehicleData[vid][ZaText] != 0) Delete3DTextLabel(AVehicleData[vid][ZaText]);
    vid = House_AddVehicle(HouseID, cModel, cPaint, cComponents, cx, cy, cz, crot, Col1, Col2);
    new string[50];
    format(string, 50, "Owner: {77FF00}%s",AVehicleData[vid][Owner]);
    AVehicleData[vid][ZaText] = Create3DTextLabel(string,0xFF0000FF,cx,cy,cz,40,1);
    Attach3DTextLabelToVehicle(AVehicleData[vid][ZaText],vid,0.0,0.0,0.4);

    // Update the fuel of the vehicle to the previous setting
    AVehicleData[vid][Fuel] = cFuel;
    // Update the health to what it was before and update the bodywork
    SetVehicleHealth(vid, Health);
    UpdateVehicleDamageStatus(vid, panels, doors, lights, tires);
    return vid;
} //302

Function with House_AddVehicle
pawn Code:
House_AddVehicle(HouseID, cModel, cPaint, cComponents[], Float:cx, Float:cy, Float:cz, Float:crot, Col1, Col2) //203
{
    // Setup local variables
    new vid, CarSlot;

    // Get a free carslot from the house
    CarSlot = House_GetFreeCarSlot(HouseID);

    // Check if there is a free carslot
    if (CarSlot != -1)
    {
        // Create a new vehicle and get the vehicle-id
        vid = CreateVehicle(cModel, cx, cy, cz, crot, Col1, Col2, 600);
        // Store the vehicle-id in the house's free carslot
        AHouseData[HouseID][VehicleIDs][CarSlot] = vid;

        // Save the model of the vehicle
        AVehicleData[vid][Model] = cModel;
        // Save the paintjob of the vehicle and apply it
        AVehicleData[vid][PaintJob] = cPaint;
        if (cPaint != 0)
            ChangeVehiclePaintjob(vid, cPaint - 1);

        // Also update the car-color
        ChangeVehicleColor(vid, Col1, Col2);
        // Save the colors of the vehicle
        AVehicleData[vid][Color1] = Col1;
        AVehicleData[vid][Color2] = Col2;

        // Save the components of the vehicle and apply them
        for (new i; i < 14; i++)
        {
            AVehicleData[vid][Components][i] = cComponents[i];
            // Check if the componentslot has a valid component-id
            if (AVehicleData[vid][Components][i] != 0)
                AddVehicleComponent(vid, AVehicleData[vid][Components][i]); // Add the component to the vehicle
        }

        // Save the spawn-data of the vehicle
        AVehicleData[vid][SpawnX] = cx;
        AVehicleData[vid][SpawnY] = cy;
        AVehicleData[vid][SpawnZ] = cz;
        AVehicleData[vid][SpawnRot] = crot;
        // Also set the fuel to maximum
        AVehicleData[vid][Fuel] = MaxFuel;
        // Also set the owner
        AVehicleData[vid][Owned] = true;
        format(AVehicleData[vid][Owner], 24, AHouseData[HouseID][Owner]);
        // Save the HouseID for the vehicle
        AVehicleData[vid][BelongsToHouse] = HouseID;
       
    }
    else // No free carslot was found, return 0
        return 0;

    // Exit the function and return the vehicle-id
    return vid;
} //260
SomebodyAndMe is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Script Error TheBluec0de Scripting Help 2 12/11/2011 01:04 PM
Error in script? Postalityjr Help Archive 3 23/06/2011 05:53 PM
Error Script Brian_Furious Help Archive 3 23/07/2010 11:37 PM
error script Pawno_Scripter Help Archive 4 05/06/2010 09:08 PM
Why do I get this error with this script? ThePS3Guy Help Archive 2 08/08/2009 04:50 PM


All times are GMT. The time now is 09:07 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.