SA-MP Forums Archive
zcmd.inc compiling problems - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: zcmd.inc compiling problems (/showthread.php?tid=398685)



zcmd.inc compiling problems - Red_Dragon. - 10.12.2012

pawn Код:
C:\PC\E\Express Gaming Roleplay Server - Copy\pawno\include\zcmd.inc(62) : warning 235: public function lacks forward declaration (symbol "OnGameModeInit")
C:\PC\E\Express Gaming Roleplay Server - Copy\pawno\include\zcmd.inc(64) : error 017: undefined symbol "funcidx"
C:\PC\E\Express Gaming Roleplay Server - Copy\pawno\include\zcmd.inc(64) : warning 215: expression has no effect
C:\PC\E\Express Gaming Roleplay Server - Copy\pawno\include\zcmd.inc(64) : error 001: expected token: ";", but found ")"
C:\PC\E\Express Gaming Roleplay Server - Copy\pawno\include\zcmd.inc(64) : error 029: invalid expression, assumed zero
C:\PC\E\Express Gaming Roleplay Server - Copy\pawno\include\zcmd.inc(64) : 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.
I have included zcmd and a_samp in my filterscript


Re: zcmd.inc compiling problems - LarzI - 10.12.2012

Are you trying to compile zcmd.inc? 'Cause if you are, then you're doing it wrong.

An include file (.inc) is only a file you use to include functions and such in your script, and it's not supposed to be compiled. Its code will be "compiled" together with your script.


Re: zcmd.inc compiling problems - Red_Dragon. - 10.12.2012

I am trying to compile my filterscript not zcmd.inc


Re: zcmd.inc compiling problems - LarzI - 10.12.2012

Have you tried redownloading zcmd.inc? I've been using zcmd.inc since the beginning of time, and I've never encountered such an error. Your include is either "damaged", or you probably have some loose braces in your code, I guess.


Re: zcmd.inc compiling problems - Red_Dragon. - 10.12.2012

No loose braces and redownload zcmd.inc and still the same errors and by the way here is the filterscript
pawn Код:
#include <zcmd>
#include <a_samp>
#define MAX_PLAYERVEHICLES 5
#define VSTORAGE 19103
public OnPlayerCommandText(playerid, cmdtext[])
CMD:vstorage(playerid, params[])
{
    SendClientMessage(playerid, COLOR_YELLOW, "Command currently Disabled");
    new vstring[1024];
    for(new i; i < MAX_PLAYERVEHICLES; i++)
    {
        if(PlayerVehicleInfo[playerid][i][pvId] > INVALID_PLAYER_VEHICLE_ID)
            format(vstring, sizeof(vstring), "%s\n%s", vstring, VehicleName[PlayerVehicleInfo[playerid][i][pvModelId] - 400]);

        else if(PlayerVehicleInfo[playerid][i][pvImpounded] == 1)
            format(vstring, sizeof(vstring), "%s\n%s (impounded)", vstring, VehicleName[PlayerVehicleInfo[playerid][i][pvModelId] - 400]);

        else
        format(vstring, sizeof(vstring), "%s\nEmpty", vstring);
    }
    ShowPlayerDialog(playerid, VSTORAGE, DIALOG_STYLE_LIST, "Vehicle Storage", vstring, "(De)Spawn", "Cancel");
    return 1;
}



Re: zcmd.inc compiling problems - DiGiTaL_AnGeL - 10.12.2012

Show the 61-65 lines.


Re: zcmd.inc compiling problems - LarzI - 10.12.2012

Well the problem is quite simple.

First of all, you need to put
pawn Код:
#include <a_samp>
on the very top - it has to be the first include.

Second of all, you need to add the initialization of the filterscript, but adding this above OnPlayerCommandText:
pawn Код:
public OnFilterScriptInit()
{
    return 1;
}



Re: zcmd.inc compiling problems - Red_Dragon. - 10.12.2012

pawn Код:
C:\PC\E\Express Gaming Roleplay Server - Copy\filterscripts\Vstorage.pwn(7) : error 029: invalid expression, assumed zero
C:\PC\E\Express Gaming Roleplay Server - Copy\filterscripts\Vstorage.pwn(7) : error 017: undefined symbol "cmd_vstorage"
C:\PC\E\Express Gaming Roleplay Server - Copy\filterscripts\Vstorage.pwn(7) : error 029: invalid expression, assumed zero
C:\PC\E\Express Gaming Roleplay Server - Copy\filterscripts\Vstorage.pwn(7) : 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.
Now these errors and here are the codes
pawn Код:
#include <a_samp>
#include <zcmd>
#define MAX_PLAYERVEHICLES 5
#define VSTORAGE 19103
public OnFilterScriptInit()
{
CMD:vstorage(playerid, params[])
 {
    SendClientMessage(playerid, COLOR_YELLOW, "Command currently Disabled");
    new vstring[1024];
    for(new i; i < MAX_PLAYERVEHICLES; i++)
    {
        if(PlayerVehicleInfo[playerid][i][pvId] > INVALID_PLAYER_VEHICLE_ID)
            format(vstring, sizeof(vstring), "%s\n%s", vstring, VehicleName[PlayerVehicleInfo[playerid][i][pvModelId] - 400]);

        else if(PlayerVehicleInfo[playerid][i][pvImpounded] == 1)
            format(vstring, sizeof(vstring), "%s\n%s (impounded)", vstring, VehicleName[PlayerVehicleInfo[playerid][i][pvModelId] - 400]);

        else
        format(vstring, sizeof(vstring), "%s\nEmpty", vstring);
    }
    ShowPlayerDialog(playerid, VSTORAGE, DIALOG_STYLE_LIST, "Vehicle Storage", vstring, "(De)Spawn", "Cancel");
    return 1;
  }
}
:/


Re: zcmd.inc compiling problems - LarzI - 10.12.2012

Close but no cigar. This should work:

pawn Код:
#include <a_samp>
#include <zcmd>

#define MAX_PLAYERVEHICLES 5
#define VSTORAGE 19103

public OnFilterScriptInit()
{
    return 1;
}

CMD:vstorage(playerid, params[])
{
    SendClientMessage(playerid, COLOR_YELLOW, "Command currently Disabled");
    new vstring[1024];
    for(new i; i < MAX_PLAYERVEHICLES; i++)
    {
        if(PlayerVehicleInfo[playerid][i][pvId] > INVALID_PLAYER_VEHICLE_ID)
            format(vstring, sizeof(vstring), "%s\n%s", vstring, VehicleName[PlayerVehicleInfo[playerid][i][pvModelId] - 400]);

        else if(PlayerVehicleInfo[playerid][i][pvImpounded] == 1)
            format(vstring, sizeof(vstring), "%s\n%s (impounded)", vstring, VehicleName[PlayerVehicleInfo[playerid][i][pvModelId] - 400]);

        else
        format(vstring, sizeof(vstring), "%s\nEmpty", vstring);
    }
    ShowPlayerDialog(playerid, VSTORAGE, DIALOG_STYLE_LIST, "Vehicle Storage", vstring, "(De)Spawn", "Cancel");
    return 1;

}



Re: zcmd.inc compiling problems - Red_Dragon. - 10.12.2012

Still these errors
pawn Код:
C:\PC\E\Express Gaming Roleplay Server - Copy\filterscripts\Vstorage.pwn(19) : error 017: undefined symbol "PlayerVehicleInfo"
C:\PC\E\Express Gaming Roleplay Server - Copy\filterscripts\Vstorage.pwn(19) : warning 215: expression has no effect
C:\PC\E\Express Gaming Roleplay Server - Copy\filterscripts\Vstorage.pwn(19) : error 001: expected token: ";", but found "]"
C:\PC\E\Express Gaming Roleplay Server - Copy\filterscripts\Vstorage.pwn(19) : error 029: invalid expression, assumed zero
C:\PC\E\Express Gaming Roleplay Server - Copy\filterscripts\Vstorage.pwn(19) : 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.
and here are the codes
pawn Код:
#include <a_samp>
#include <zcmd>

#define MAX_PLAYERVEHICLES 5
#define VSTORAGE 19103
#define COLOR_YELLOW 0xFFFF00AA


public OnFilterScriptInit()
{
    return 1;
}
CMD:vstorage(playerid, params[])
{
    SendClientMessage(playerid, COLOR_YELLOW, "Command currently Disabled");
    new vstring[1024];
    for(new i; i < MAX_PLAYERVEHICLES; i++)
    {
        if(PlayerVehicleInfo[playerid][i][pvId] > INVALID_PLAYER_VEHICLE_ID)
            format(vstring, sizeof(vstring), "%s\n%s", vstring, VehicleName[PlayerVehicleInfo[playerid][i][pvModelId] - 400]);

        else if(PlayerVehicleInfo[playerid][i][pvImpounded] == 1)
            format(vstring, sizeof(vstring), "%s\n%s (impounded)", vstring, VehicleName[PlayerVehicleInfo[playerid][i][pvModelId] - 400]);

        else
        format(vstring, sizeof(vstring), "%s\nEmpty", vstring);
    }
    ShowPlayerDialog(playerid, VSTORAGE, DIALOG_STYLE_LIST, "Vehicle Storage", vstring, "(De)Spawn", "Cancel");
    return 1;

}