[ERRO]PQ? em FS
#1

AKI esta ocorendo varios erros pq
Topico original aki https://sampforum.blast.hk/showthread.php?tid=179513
PHP код:
/*------------------------------------------------------------------------------
Thanks for downloading the SA-MP Light Control FS by Pghpunkid. Please feel free
to modify as you need. Also, please do not redistribute without my authorization
first. And if you do (with or without my permission) Please leave this header
section. To make this work, simply delete the "//" before "#include" on line 16
then recompile! By doing this, you agree to the above requirements and are going
to follow these few rules of using this free code.
Thanks and enjoy!
-Pghpunkid
------------------------------------------------------------------------------*/
//#include <a_samp>
new LightPwr[MAX_VEHICLES];
new 
Flasher[MAX_VEHICLES];
new 
FlasherState[MAX_VEHICLES];
new 
FlashTimer;
public 
OnFilterScriptInit()
{
    print(
"\n-----------------------------------");
    print(
"   Light Control FS by Pghpunkid");
    print(
"-----------------------------------\n");
    for (new 
x=0x<MAX_VEHICLESx++)
    {
        
LightPwr[x]=1;
        
Flasher[x]=0;
        
FlasherState[x]=0;
    }
    
FlashTimer SetTimer("FlasherFunc",100,1);
    return 
1;
}
public 
OnFilterScriptExit()
{
    print(
"\n-----------------------------------");
    print(
"     Light Control FS Unloaded");
    print(
"-----------------------------------\n");
    
KillTimer(FlashTimer);
    return 
1;
}
public 
OnPlayerCommandText(playeridcmdtext[])
{
    new 
cmd[256], idx;
    
cmd strtok(cmdtextidx);
    new 
vehicleid,panels,doors,lights,tires;
    if (
strcmp("/lightsoff"cmdtrue) == 0)
    {
        
vehicleid GetPlayerVehicleID(playerid);
        
GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
        
UpdateVehicleDamageStatus(vehicleidpanelsdoors5tires);
        
LightPwr[vehicleid] = 0;
        
Flasher[vehicleid] = 0;
        return 
1;
    }
    if (
strcmp("/lightswat"cmdtrue) == 0)
    {
        
vehicleid GetPlayerVehicleID(playerid);
        
GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
        
UpdateVehicleDamageStatus(vehicleidpanelsdoors3tires);
        
LightPwr[vehicleid] = 1;
        
Flasher[vehicleid] = 0;
        return 
1;
    }
    if (
strcmp("/lightson"cmdtrue) == 0)
    {
        
vehicleid GetPlayerVehicleID(playerid);
        
GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
        
UpdateVehicleDamageStatus(vehicleidpanelsdoors0tires);
        
LightPwr[vehicleid] = 1;
        
Flasher[vehicleid] = 0;
        return 
1;
    }
    if (
strcmp("/lightsflash"cmdtrue) == 0)
    {
        
vehicleid GetPlayerVehicleID(playerid);
        
GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
        
Flasher[vehicleid] = 1;
        return 
1;
    }
    if (
strcmp("/lightsflashoff"cmdtrue) == 0)
    {
        
vehicleid GetPlayerVehicleID(playerid);
        
GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
        if (
LightPwr[vehicleid] == 1)
            
UpdateVehicleDamageStatus(vehicleidpanelsdoors0tires);
        else
            
UpdateVehicleDamageStatus(vehicleidpanelsdoors5tires);
        
Flasher[vehicleid] = 0;
        return 
1;
    }
    return 
0;
}
public 
OnPlayerEnterVehicle(playeridvehicleidispassenger)
{
    if (
LightPwr[vehicleid] == 0)
    {
        new 
panels,doors,lights,tires;
        
GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
        
UpdateVehicleDamageStatus(vehicleidpanelsdoors5tires);
    }
    else
    {
        new 
panels,doors,lights,tires;
        
GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
        
UpdateVehicleDamageStatus(vehicleidpanelsdoors0tires);
    }
    return 
1;
}
public 
OnPlayerExitVehicle(playeridvehicleid)
{
    
Flasher[vehicleid] = 0;
    if (
LightPwr[vehicleid] == 0)
    {
        new 
panels,doors,lights,tires;
        
GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
        
UpdateVehicleDamageStatus(vehicleidpanelsdoors5tires);
    }
    else
    {
        new 
panels,doors,lights,tires;
        
GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
        
UpdateVehicleDamageStatus(vehicleidpanelsdoors0tires);
    }
    return 
1;
}
public 
OnVehicleMod(playeridvehicleidcomponentid)
{
    return 
1;
}
public 
OnVehiclePaintjob(playeridvehicleidpaintjobid)
{
    if (
LightPwr[vehicleid] == 0)
    {
        new 
panels,doors,lights,tires;
        
GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
        
UpdateVehicleDamageStatus(vehicleidpanelsdoors5tires);
    }
    return 
1;
}
public 
OnVehicleRespray(playeridvehicleidcolor1color2)
{
    if (
LightPwr[vehicleid] == 0)
    {
        new 
panels,doors,lights,tires;
        
GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
        
UpdateVehicleDamageStatus(vehicleidpanelsdoors5tires);
    }
    return 
1;
}
public 
OnPlayerStreamIn(playeridforplayerid)
{
    return 
1;
}
public 
OnPlayerStreamOut(playeridforplayerid)
{
    return 
1;
}
public 
OnVehicleStreamIn(vehicleidforplayerid)
{
    if (
LightPwr[vehicleid] == 0)
    {
        new 
panels,doors,lights,tires;
        
GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
        
UpdateVehicleDamageStatus(vehicleidpanelsdoors5tires);
    }
    return 
1;
}
public 
OnVehicleStreamOut(vehicleidforplayerid)
{
    return 
1;
}
//Option A
/*
public OnPlayerUpdate(playerid)
{
    if (IsPlayerInAnyVehicle(playerid))
    {
        new id;
        id = GetPlayerVehicleID(playerid);
        if (Flasher[id] == 1)
        {
            if (FlasherState[id] == 1)
            {
                new panels,doors,lights,tires;
                GetVehicleDamageStatus(id,panels,doors,lights,tires);
                UpdateVehicleDamageStatus(id, panels, doors, 4, tires);
                FlasherState[id] = 0;
            }
            else {
                new panels,doors,lights,tires;
                GetVehicleDamageStatus(id,panels,doors,lights,tires);
                UpdateVehicleDamageStatus(id, panels, doors, 1, tires);
                FlasherState[id] = 1;
            }
        }
    }
    return 1;
}
*/
//Option B
forward FlasherFunc();
public 
FlasherFunc() {
    for (new 
p=0p<MAX_PLAYERSp++)
    {
        if (
IsPlayerInAnyVehicle(p) && IsPlayerConnected(p) && !IsPlayerNPC(p))
        {
            new 
id;
               new 
panelsx,doorsx,lightsx,tiresx;
            
id GetPlayerVehicleID(p);
            if (
Flasher[id] == 1)
            {
                if (
FlasherState[id] == 1)
                {
                    
GetVehicleDamageStatus(id,panelsx,doorsx,lightsx,tiresx);
                    
UpdateVehicleDamageStatus(idpanelsxdoorsx4tiresx);
                    
FlasherState[id] = 0;
                }
                else {
                    
GetVehicleDamageStatus(id,panelsx,doorsx,lightsx,tiresx);
                    
UpdateVehicleDamageStatus(idpanelsxdoorsx1tiresx);
                    
FlasherState[id] = 1;
                }
            }
        }
    }
    return 
1;
}
strtok(const string[], &index)
{
    new 
length strlen(string);
    while ((
index length) && (string[index] <= ' '))
    {
        
index++;
    }
    new 
offset index;
    new 
result[20];
    while ((
index length) && (string[index] > ' ') && ((index offset) < (sizeof(result) - 1)))
    {
        
result[index offset] = string[index];
        
index++;
    }
    
result[index offset] = EOS;
    return 
result;
}
stock DelPrint(string1[])
{
    
strmid(string1string10strlen(string1)-1255);
    
//printf("%s", string1);
    
return 1;


aki etsao os erros

PHP код:
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(18) : error 017undefined symbol "MAX_VEHICLES"
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(18) : error 009invalid array size (negativezero or out of bounds)
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(19) : error 017undefined symbol "MAX_VEHICLES"
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(19) : error 009invalid array size (negativezero or out of bounds)
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(20) : error 017undefined symbol "MAX_VEHICLES"
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(20) : error 009invalid array size (negativezero or out of bounds)
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(23) : warning 235: public function lacks forward declaration (symbol "OnFilterScriptInit")
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(25) : error 017undefined symbol "print"
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(26) : error 017undefined symbol "print"
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(27) : error 017undefined symbol "print"
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(28) : error 017undefined symbol "MAX_VEHICLES"
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(31) : warning 217loose indentation
C
:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(34) : error 017undefined symbol "SetTimer"
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(38) : warning 235: public function lacks forward declaration (symbol "OnFilterScriptExit")
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(40) : error 017undefined symbol "print"
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(41) : error 017undefined symbol "print"
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(42) : error 017undefined symbol "print"
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(43) : error 017undefined symbol "KillTimer"
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(47) : warning 235: public function lacks forward declaration (symbol "OnPlayerCommandText")
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(52) : error 017undefined symbol "strcmp"
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(54) : error 017undefined symbol "GetPlayerVehicleID"
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(55) : error 017undefined symbol "GetVehicleDamageStatus"
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(56) : error 017undefined symbol "UpdateVehicleDamageStatus"
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(61) : error 017undefined symbol "strcmp"
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(63) : error 017undefined symbol "GetPlayerVehicleID"
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(64) : error 017undefined symbol "GetVehicleDamageStatus"
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(65) : error 017undefined symbol "UpdateVehicleDamageStatus"
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(70) : error 017undefined symbol "strcmp"
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(72) : error 017undefined symbol "GetPlayerVehicleID"
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(73) : error 017undefined symbol "GetVehicleDamageStatus"
Compilation aborted.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
26 Errors

Reply
#2

pawn Код:
//#include <a_samp>
troque isso por isso:
pawn Код:
#include <a_samp>
sua include a_samp estб desativada, entao nгo vai reconhecer nenhuma funзгo..
Reply
#3

pawn Код:
/*------------------------------------------------------------------------------

Thanks for downloading the SA-MP Light Control FS by Pghpunkid. Please feel free
to modify as you need. Also, please do not redistribute without my authorization
first. And if you do (with or without my permission) Please leave this header
section. To make this work, simply delete the "//" before "#include" on line 16
then recompile! By doing this, you agree to the above requirements and are going
to follow these few rules of using this free code.

Thanks and enjoy!

-Pghpunkid

------------------------------------------------------------------------------*/


#include <a_samp>

new LightPwr[MAX_VEHICLES];
new Flasher[MAX_VEHICLES];
new FlasherState[MAX_VEHICLES];
new FlashTimer;

public OnFilterScriptInit()
{
    print("\n-----------------------------------");
    print("   Light Control FS by Pghpunkid");
    print("-----------------------------------\n");
    for (new x=0; x<MAX_VEHICLES; x++)
    {
        LightPwr[x]=1;
        Flasher[x]=0;
        FlasherState[x]=0;
    }
    FlashTimer = SetTimer("FlasherFunc",100,1);
    return 1;
}

public OnFilterScriptExit()
{
    print("\n-----------------------------------");
    print("     Light Control FS Unloaded");
    print("-----------------------------------\n");
    KillTimer(FlashTimer);
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    new cmd[256], idx;
    cmd = strtok(cmdtext, idx);
    new vehicleid,panels,doors,lights,tires;
    if (strcmp("/lightsoff", cmd, true) == 0)
    {
        vehicleid = GetPlayerVehicleID(playerid);
        GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
        UpdateVehicleDamageStatus(vehicleid, panels, doors, 5, tires);
        LightPwr[vehicleid] = 0;
        Flasher[vehicleid] = 0;
        return 1;
    }
    if (strcmp("/lightswat", cmd, true) == 0)
    {
        vehicleid = GetPlayerVehicleID(playerid);
        GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
        UpdateVehicleDamageStatus(vehicleid, panels, doors, 3, tires);
        LightPwr[vehicleid] = 1;
        Flasher[vehicleid] = 0;
        return 1;
    }
    if (strcmp("/lightson", cmd, true) == 0)
    {
        vehicleid = GetPlayerVehicleID(playerid);
        GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
        UpdateVehicleDamageStatus(vehicleid, panels, doors, 0, tires);
        LightPwr[vehicleid] = 1;
        Flasher[vehicleid] = 0;
        return 1;
    }
    if (strcmp("/lightsflash", cmd, true) == 0)
    {
        vehicleid = GetPlayerVehicleID(playerid);
        GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
        Flasher[vehicleid] = 1;
        return 1;
    }
    if (strcmp("/lightsflashoff", cmd, true) == 0)
    {
        vehicleid = GetPlayerVehicleID(playerid);
        GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
        if (LightPwr[vehicleid] == 1)
            UpdateVehicleDamageStatus(vehicleid, panels, doors, 0, tires);
        else
            UpdateVehicleDamageStatus(vehicleid, panels, doors, 5, tires);
        Flasher[vehicleid] = 0;
        return 1;
    }
    return 0;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if (LightPwr[vehicleid] == 0)
    {
        new panels,doors,lights,tires;
        GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
        UpdateVehicleDamageStatus(vehicleid, panels, doors, 5, tires);
    }
    else
    {
        new panels,doors,lights,tires;
        GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
        UpdateVehicleDamageStatus(vehicleid, panels, doors, 0, tires);
    }
    return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
    Flasher[vehicleid] = 0;
    if (LightPwr[vehicleid] == 0)
    {
        new panels,doors,lights,tires;
        GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
        UpdateVehicleDamageStatus(vehicleid, panels, doors, 5, tires);
    }
    else
    {
        new panels,doors,lights,tires;
        GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
        UpdateVehicleDamageStatus(vehicleid, panels, doors, 0, tires);
    }
    return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
    return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
    if (LightPwr[vehicleid] == 0)
    {
        new panels,doors,lights,tires;
        GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
        UpdateVehicleDamageStatus(vehicleid, panels, doors, 5, tires);
    }
    return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
    if (LightPwr[vehicleid] == 0)
    {
        new panels,doors,lights,tires;
        GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
        UpdateVehicleDamageStatus(vehicleid, panels, doors, 5, tires);
    }
    return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
    return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
    return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
    if (LightPwr[vehicleid] == 0)
    {
        new panels,doors,lights,tires;
        GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
        UpdateVehicleDamageStatus(vehicleid, panels, doors, 5, tires);
    }
    return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
    return 1;
}

//Option A
/*
public OnPlayerUpdate(playerid)
{
    if (IsPlayerInAnyVehicle(playerid))
    {
        new id;
        id = GetPlayerVehicleID(playerid);
        if (Flasher[id] == 1)
        {
            if (FlasherState[id] == 1)
            {
                new panels,doors,lights,tires;
                GetVehicleDamageStatus(id,panels,doors,lights,tires);
                UpdateVehicleDamageStatus(id, panels, doors, 4, tires);
                FlasherState[id] = 0;
            }
            else {
                new panels,doors,lights,tires;
                GetVehicleDamageStatus(id,panels,doors,lights,tires);
                UpdateVehicleDamageStatus(id, panels, doors, 1, tires);
                FlasherState[id] = 1;
            }
        }
    }
    return 1;
}
*/


//Option B

forward FlasherFunc();
public FlasherFunc()
{
    for (new p=0; p<MAX_PLAYERS; p++)
    {
        if (IsPlayerInAnyVehicle(p) && IsPlayerConnected(p) && !IsPlayerNPC(p))
        {
            new id;
            new panelsx,doorsx,lightsx,tiresx;
            id = GetPlayerVehicleID(p);
            if (Flasher[id] == 1)
            {
                if (FlasherState[id] == 1)
                {
                    GetVehicleDamageStatus(id,panelsx,doorsx,lightsx,tiresx);
                    UpdateVehicleDamageStatus(id, panelsx, doorsx, 4, tiresx);
                    FlasherState[id] = 0;
                } else {
                    GetVehicleDamageStatus(id,panelsx,doorsx,lightsx,tiresx);
                    UpdateVehicleDamageStatus(id, panelsx, doorsx, 1, tiresx);
                    FlasherState[id] = 1;
                }
            }
        }
    }
    return 1;
}

strtok(const string[], &index)
{
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' '))
    {
        index++;
    }

    new offset = index;
    new result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = string[index];
        index++;
    }
    result[index - offset] = EOS;
    return result;
}

stock DelPrint(string1[])
{
    strmid(string1, string1, 0, strlen(string1)-1, 255);
    //printf("%s", string1);
    return 1;
}
Reply
#4

Vitor, й sempre nescessбrio incluir a #include <a_samp> й a livraria que tem todas as funзхes que vocк usou/o dono desse FS usou nele para comeзar o projeto... (: use qualquer um dos exemplos acima, se der erro. Volte e poste
Reply
#5

Quote:
Originally Posted by Willian_Luigi
Посмотреть сообщение
Vitor, й sempre nescessбrio incluir a #include <a_samp> й a livraria que tem todas as funзхes que vocк usou/o dono desse FS usou nele para comeзar o projeto... (: use qualquer um dos exemplos acima, se der erro. Volte e poste
sу ativei a include e compilei aqui para ver, e nгo deu erros (:
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)