CarCheck errors
#1

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 :/
Reply
#2

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)
{
Reply
#3

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

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
Reply
#5

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;
}
Reply
#6

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


Forum Jump:


Users browsing this thread: 2 Guest(s)