SA-MP Forums Archive
CarCheck errors - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: CarCheck errors (/showthread.php?tid=147626)



CarCheck errors - Minio1822 - 13.05.2010

When Im trying to compile gm I get 4 errors :
Код:
E:\samp03asvr_R4_win32_2_\samp03asvr_R4_win32\gamemodes\SRP.pwn(18382) : error 004: function "Carcheck" is not implemented
E:\samp03asvr_R4_win32_2_\samp03asvr_R4_win32\gamemodes\SRP.pwn(18430) : error 004: function "Carcheck" is not implemented
E:\samp03asvr_R4_win32_2_\samp03asvr_R4_win32\gamemodes\SRP.pwn(18574) : error 004: function "Carcheck" is not implemented
E:\samp03asvr_R4_win32_2_\samp03asvr_R4_win32\gamemodes\SRP.pwn(18589) : error 004: function "Carcheck" is not implemented
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
pawn Код:
//-------------------------[Buy Car]------------------------------------------------
if(strcmp(cmd, "/buycar", true) == 0)
{
if(Carcheck(playerid) == 1){  // line 18382
if(PlayerInfo[playerid][pCKey] > 0)
{
Please help me :/


Re: CarCheck errors - Zimon95 - 13.05.2010

Maybe Carcheck is an array.
pawn Код:
//-------------------------[Buy Car]------------------------------------------------
if(strcmp(cmd, "/buycar", true) == 0)
{
if(Carcheck[playerid] == 1){  // line 18382
if(PlayerInfo[playerid][pCKey] > 0)
{



Re: CarCheck errors - aircombat - 13.05.2010

it means that there is a missing bracket, show the whole cmd


Re: CarCheck errors - Minio1822 - 13.05.2010

New errors :
Код:
E:\samp03asvr_R4_win32_2_\samp03asvr_R4_win32\gamemodes\SRP.pwn(18382) : error 028: invalid subscript (not an array or too many subscripts): "Carcheck"
E:\samp03asvr_R4_win32_2_\samp03asvr_R4_win32\gamemodes\SRP.pwn(18382) : warning 215: expression has no effect
E:\samp03asvr_R4_win32_2_\samp03asvr_R4_win32\gamemodes\SRP.pwn(18382) : error 001: expected token: ";", but found "]"
E:\samp03asvr_R4_win32_2_\samp03asvr_R4_win32\gamemodes\SRP.pwn(18382) : error 029: invalid expression, assumed zero
E:\samp03asvr_R4_win32_2_\samp03asvr_R4_win32\gamemodes\SRP.pwn(18382) : fatal error 107: too many error messages on one line



Re: CarCheck errors - Zimon95 - 13.05.2010

Yes, you missed a bracket. Try this code:
pawn Код:
//-------------------------[Buy Car]------------------------------------------------
if(strcmp(cmd, "/buycar", true) == 0)
{
    if(Carcheck[playerid] == 1)
    {  // line 18382
        if(PlayerInfo[playerid][pCKey] > 0)
        {
            SendClientMessage(playerid, COLOR_RED, "ERROR: You already own a car");
            return 1;
        }
        if(!IsPlayerInAnyVehicle(playerid))
        {
            SendClientMessage(playerid, COLOR_RED, "ERROR: You are not in a vehicle!");
            return 1;
        }
        new carid = GetPlayerVehicleID(playerid)-1;
        if(!IsOwnable(carid))
        {
            SendClientMessage(playerid, COLOR_RED, "ERROR: This car is not purchasable");
            return 1;
        }
        if(CInfo[carid][cBought] > 0)
        {
            format(string, sizeof(string), "ERROR: %s owns this vehicle, contact him to buy it", CInfo[carid][cOwner]);
            SendClientMessage(playerid, COLOR_RED, string);
            return 1;
        }
        if(CInfo[carid][cLevel] > PlayerInfo[playerid][pLevel])
        {
            format(string, sizeof(string), "ERROR: This car is for level %d+ players only", CInfo[carid][cLevel]);
            SendClientMessage(playerid, COLOR_RED, string);
            return 1;
        }
        if(CInfo[carid][cValue] > PlayerInfo[playerid][pCash])
        {
            format(string, sizeof(string), "ERROR: This car costs $%d, you need $%d more to buy it", CInfo[carid][cValue], CInfo[carid][cValue] - PlayerInfo[playerid][pCash]);
            SendClientMessage(playerid, COLOR_RED, string);
            return 1;
        }
        CInfo[carid][cBought] = 1;
        PlayerInfo[playerid][pCKey] = carid+1;
        GetPlayerName(playerid, sendername, sizeof(sendername));
        strmid(CInfo[carid][cOwner], sendername, 0, strlen(sendername), 255);
        AntiHack(playerid,-CInfo[carid][cValue]);
        SendClientMessage(playerid, COLOR_GREEN, "Congratulations, you now own a car, type /carinfo");
        OnPropUpdate();
    }
    return 1;
}



Re: CarCheck errors - Minio1822 - 13.05.2010

I've fixed it without this bracket.
I've replaced public Carcheck with another one on forums and it worked