Underfined symbol
#1

Hello, I have added something from another script but I got errors

Код:
./includes/functions.pwn(17710) : error 017: undefined symbol "GetGVarInt"
./includes/functions.pwn(17712) : error 017: undefined symbol "GetGVarInt"
./includes/functions.pwn(17713) : error 017: undefined symbol "DeleteGVar"
./includes/functions.pwn(17715) : error 017: undefined symbol "GetGVarInt"
./includes/functions.pwn(17717) : error 017: undefined symbol "GetGVarInt"
./includes/functions.pwn(17718) : error 017: undefined symbol "DeleteGVar"
./includes/functions.pwn(17729) : error 017: undefined symbol "SetGVarInt"
./includes/functions.pwn(17735) : error 017: undefined symbol "SetGVarInt"
./includes/functions.pwn(17741) : error 017: undefined symbol "SetGVarInt"
./includes/functions.pwn(17747) : error 017: undefined symbol "SetGVarInt"
./includes/functions.pwn(17755) : error 017: undefined symbol "SetGVarInt"
./includes/functions.pwn(17756) : error 017: undefined symbol "SetGVarInt"
./includes/functions.pwn(17762) : error 017: undefined symbol "SetGVarInt"
about this:

PHP код:
stock ToggleSiren(vehidiTogState)
{
    if(
iTogState == 1)
    {
        if(
GetGVarInt("VehSiren"vehid) != INVALID_OBJECT_ID)
        {
            
DestroyDynamicObject(GetGVarInt("VehSiren"vehid));
            
DeleteGVar("VehSiren"vehid);
        }
        if(
GetGVarInt("VehSiren2"vehid) != INVALID_OBJECT_ID)
        {
            
DestroyDynamicObject(GetGVarInt("VehSiren2"vehid));
            
DeleteGVar("VehSiren2"vehid);
        }
    }
    else
    {
        switch(
GetVehicleModel(vehid))
        {
            case 
402:
            {
                new 
iTempObj CreateDynamicObject(186460.00.00.00.00.00.0, -1, -1, -1200.0);
                
AttachDynamicObjectToVehicle(iTempObjvehid, -0.200.50.40.00.00.0);
                
SetGVarInt("VehSiren"iTempObjvehid);
            }
            case 
411541:
            {
                new 
iTempObj CreateDynamicObject(186460.00.00.00.00.00.0, -1, -1, -1200.0);
                
AttachDynamicObjectToVehicle(iTempObjvehid0.00.20.40.00.00.0);
                
SetGVarInt("VehSiren"iTempObjvehid);
            }
            case 
415:
            {
                new 
iTempObj CreateDynamicObject(186460.00.00.00.00.00.0, -1, -1, -1200.0);
                
AttachDynamicObjectToVehicle(iTempObjvehid, -0.200.300.30.00.00.0);
                
SetGVarInt("VehSiren"iTempObjvehid);
            }
            case 
451:
            {
                new 
iTempObj CreateDynamicObject(186460.00.00.00.00.00.0, -1, -1, -1200.0);
                
AttachDynamicObjectToVehicle(iTempObjvehid, -0.300.40.60.00.00.0);
                
SetGVarInt("VehSiren"iTempObjvehid);
            }
            case 
525:
            {
                new 
iTempObj2 CreateDynamicObject(192940.00.00.00.00.00.0, -1, -1, -1200.0);
                new 
iTempObj3 CreateDynamicObject(192940.00.00.00.00.00.0, -1, -1, -1200.0);
                
AttachDynamicObjectToVehicle(iTempObj2vehid0.55, -0.51.50.00.00.0);
                
AttachDynamicObjectToVehicle(iTempObj3vehid, -0.55, -0.51.50.00.00.0);
                
SetGVarInt("VehSiren"iTempObj2vehid);
                
SetGVarInt("VehSiren2"iTempObj3vehid);
            }
            default:
            {
                new 
iTempObj CreateDynamicObject(186460.00.00.00.00.00.0, -1, -1, -1200.0);
                
AttachDynamicObjectToVehicle(iTempObjvehid, -0.300.40.40.00.00.0);
                
SetGVarInt("VehSiren"iTempObjvehid);
            }
        }
    }
    return 
1;
}
hook OnVehicleSpawn(vehicleid)
{
    if(
GetGVarType("VehSiren"vehicleid)) ToggleSiren(vehicleid1);
}
public 
OnVehicleSirenStateChange(playeridvehicleidnewstate)
{
    if(
DynVeh[vehicleid] != -1)
    {
        for(new 
0!= MAX_DV_OBJECTSi++)
        {
            
ToggleDVSiren(DynVeh[vehicleid], inewstate);
        }
    }
    switch(
newstate)
    {
        case 
0ToggleSiren(vehicleid1);
        case 
1:
        {
            if(!
GetGVarType("VehSiren"vehicleid)) ToggleSiren(vehicleid0);
        }
    }
    return 
1;

How to define this and or is it a plugin/include ?
Reply
#2

There's original plugin: https://sampforum.blast.hk/showthread.php?tid=151076
And pluginless implementation: https://sampforum.blast.hk/showthread.php?tid=370852
Reply
#3

Quote:
Originally Posted by Misiur
Посмотреть сообщение
On this line:
PHP код:
stock ToggleDVSiren(iDvSlotIDiSlotiTogState 0)
{
    switch(
DynVehicleInfo[iDvSlotID][iSlot][gv_iAttachedObjectModel]);
    {
        case 
1899:
        {
            if(!
iTogState) return 0;
            
DynVehicleInfo[iDvSlotID][iSlot][gv_iAttachedObjectModel] = 19294;
            
Streamer_SetIntData(STREAMER_TYPE_OBJECTDynVehicleInfo[iDvSlotID][iSlot][gv_iAttachedObjectID], E_STREAMER_MODEL_ID19294);
            
AttachDynamicObjectToVehicle(DynVehicleInfo[iDvSlotID][iSlot][gv_iAttachedObjectID], DynVehicleInfo[iDvSlotID][gv_iSpawnedID], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectX], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectY], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectZ], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectRX], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectRY], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectRZ]);
        }
        case 
18646:
        {
            if(
iTogState) return 0;
            
DynVehicleInfo[iDvSlotID][iSlot][gv_iAttachedObjectModel] = 19300;
            
Streamer_SetIntData(STREAMER_TYPE_OBJECTDynVehicleInfo[iDvSlotID][iSlot][gv_iAttachedObjectID], E_STREAMER_MODEL_ID19300);
            
AttachDynamicObjectToVehicle(DynVehicleInfo[iDvSlotID][iSlot][gv_iAttachedObjectID], DynVehicleInfo[iDvSlotID][gv_iSpawnedID], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectX], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectY], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectZ], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectRX], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectRY], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectRZ]);
        }
        case 
19294:
        {
            if(
iTogState) return 0;
            
DynVehicleInfo[iDvSlotID][iSlot][gv_iAttachedObjectModel] = 1899;
            
Streamer_SetIntData(STREAMER_TYPE_OBJECTDynVehicleInfo[iDvSlotID][iSlot][gv_iAttachedObjectID], E_STREAMER_MODEL_ID1899);
            
AttachDynamicObjectToVehicle(DynVehicleInfo[iDvSlotID][iSlot][gv_iAttachedObjectID], DynVehicleInfo[iDvSlotID][gv_iSpawnedID], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectX], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectY], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectZ], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectRX], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectRY], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectRZ]);
        }
        case 
19300:
        {
            if(!
iTogState) return 0;
            
DynVehicleInfo[iDvSlotID][iSlot][gv_iAttachedObjectModel] = 18646;
            
Streamer_SetIntData(STREAMER_TYPE_OBJECTDynVehicleInfo[iDvSlotID][iSlot][gv_iAttachedObjectID], E_STREAMER_MODEL_ID18646);
            
AttachDynamicObjectToVehicle(DynVehicleInfo[iDvSlotID][iSlot][gv_iAttachedObjectID], DynVehicleInfo[iDvSlotID][gv_iSpawnedID], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectX], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectY], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectZ], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectRX], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectRY], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectRZ]);
        }
        case 
19419:
        {
            if(
iTogState) return 0;
            
DynVehicleInfo[iDvSlotID][iSlot][gv_iAttachedObjectModel] = 19420;
            
Streamer_SetIntData(STREAMER_TYPE_OBJECTDynVehicleInfo[iDvSlotID][iSlot][gv_iAttachedObjectID], E_STREAMER_MODEL_ID19420);
            
AttachDynamicObjectToVehicle(DynVehicleInfo[iDvSlotID][iSlot][gv_iAttachedObjectID], DynVehicleInfo[iDvSlotID][gv_iSpawnedID], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectX], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectY], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectZ], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectRX], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectRY], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectRZ]);
        }
        case 
19420:
        {
            if(!
iTogState) return 0;
            
DynVehicleInfo[iDvSlotID][iSlot][gv_iAttachedObjectModel] = 19419;
            
Streamer_SetIntData(STREAMER_TYPE_OBJECTDynVehicleInfo[iDvSlotID][iSlot][gv_iAttachedObjectID], E_STREAMER_MODEL_ID19419);
            
AttachDynamicObjectToVehicle(DynVehicleInfo[iDvSlotID][iSlot][gv_iAttachedObjectID], DynVehicleInfo[iDvSlotID][gv_iSpawnedID], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectX], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectY], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectZ], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectRX], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectRY], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectRZ]);
        }
    }
    return 
1;



Код:
/includes/functions.pwn(17708) : warning 213: tag mismatch
./includes/functions.pwn(17708) : error 001: expected token: ")", but found "["
./includes/functions.pwn(17708) : warning 215: expression has no effect
./includes/functions.pwn(17708) : error 001: expected token: ";", but found "]"
./includes/functions.pwn(17708) : error 029: invalid expression, assumed zero
./includes/functions.pwn(17708) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#4

can u mark the error line?
Reply
#5

I don't recomand to use SetGVarInt, GetGVarInt, etc... This is more slow then storing value intro a simple variable ( new VehSiren[MAX_VEHICLES]; )
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)