Help me please.
#1

So i made a script to save impounded cars here it is:

pawn Код:
new impounded[MAX_VEHICLES];
pawn Код:
enum pInfo
pImpounded[MAX_VEHICLES],
pawn Код:
enum ImpoundedInfo
{
    pVeh,
    pImpounded,
}
pawn Код:
stock SaveImpounded()
{
    new idx = 0, File:file;
    new string[256];
    while(idx < MAX_IMPOUNDED)
    {
        format(string, sizeof(string), "%d|%d",
        ImpoundedInfo[idx][pVeh],
        ImpoundedInfo[idx][pImpounded],
        if(idx == 0)
        {
            file = fopen("Impounded.cfg", io_write);
        }
        else
        {
            file = fopen("Impounded.cfg", io_append);
        }
        fwrite(file, string);
        fclose(file);
        idx++;
    }
    print("Impounded saved successfully.");
}

stock LoadImpounded()
{
    new dinfo[7][128];
    new string[256];
    new File:file = fopen("Impounded.cfg", io_read);
    if(file)
    {
        new idx = 0;
        while(idx < MAX_IMPOUNDED)
        {
            fread(file, string);
            split(string, dinfo, '|');

            ImpoundedInfo[idx][pVeh] = strval(dinfo[1]);
            ImpoundedInfo[idx][Impounded] = strval(dinfo[2]);
            idx++;
        }
    }
    print("Impounded loaded successfully.");
    return 1;
}
[MAX_VEHICLES];
pawn Код:
CMD:impound(playerid, params[])
{
    new  engine,lights,alarm,doors,bonnet,boot,objective;
    new vid, id, idn[MAX_PLAYER_NAME], n[MAX_PLAYER_NAME], str[288];
    id = (strval(params));
    GetPlayerName(playerid, n, sizeof(n));
    if(!strlen(params)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /impound");
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(!IsPlayerInAnyVehicle(id)) return SendClientMessage(playerid, COLOR_GREY, "You are not in vehicle");
    if(!IsALSR(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not an LSR Member.");
    vid = GetPlayerVehicleID(id);
    GetPlayerName(id, idn, sizeof(idn));
    GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
    SetVehicleParamsEx(vid,0,lights,alarm,doors,bonnet,boot,objective);
    impounded[vid] = 1;
    format(str,sizeof(str),"%s Takes out a notepad and writes car in impounded list.", n, idn);
    SendClientMessageToAll(COLOR_PURPLE, str);
    return 1;
}
CMD:unimpound(playerid, params[])
{
    new  engine,lights,alarm,doors,bonnet,boot,objective;
    new vid, id, idn[MAX_PLAYER_NAME], n[MAX_PLAYER_NAME], str[245];
    id = (strval(params));
    GetPlayerName(playerid, n, sizeof(n));
    if(!strlen(params)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /unimpound");
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(!IsPlayerInAnyVehicle(id)) return SendClientMessage(playerid, COLOR_GREY, "You are not in vehicle");
    if(!IsALSR(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not an LSR Member.");
    vid = GetPlayerVehicleID(id);
    GetPlayerName(id, idn, sizeof(idn));
    GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
    SetVehicleParamsEx(vid,1,lights,alarm,doors,bonnet,boot,objective);
    impounded[vid] = 0;
    format(str, sizeof(str), "%s Takes out a notepad and writes car in unimpounded list.", n, idn);
    SendClientMessageToAll(COLOR_PURPLE, str);
    return 1;
}[MAX_VEHICLES];
Mhm whats wrong here ??
and the errors \/

Код:
D:\Documents and Settings\ScOuT3221\Desktop\SAMPSERVER\gamemodes\ZRP.pwn(2336) : error 021: symbol already defined: "ImpoundedInfo"
D:\Documents and Settings\ScOuT3221\Desktop\SAMPSERVER\gamemodes\ZRP.pwn(2373 -- 2374) : error 028: invalid subscript (not an array or too many subscripts): "ImpoundedInfo"
D:\Documents and Settings\ScOuT3221\Desktop\SAMPSERVER\gamemodes\ZRP.pwn(2374) : warning 215: expression has no effect
D:\Documents and Settings\ScOuT3221\Desktop\SAMPSERVER\gamemodes\ZRP.pwn(2374) : error 001: expected token: ";", but found "]"
D:\Documents and Settings\ScOuT3221\Desktop\SAMPSERVER\gamemodes\ZRP.pwn(2374) : error 029: invalid expression, assumed zero
D:\Documents and Settings\ScOuT3221\Desktop\SAMPSERVER\gamemodes\ZRP.pwn(2374) : fatal error 107: too many error messages on one line
Reply
#2

show us the lines.
Reply
#3

Wha lines ??
Reply
#4

pawn Код:
stock SaveImpounded()
{
    new idx = 0, File:file;
    new string[256];
    while(idx < MAX_IMPOUNDED)
    {
2373            format(string, sizeof(string), "%d|%d",
2374                ImpoundedInfo[idx][pVeh],
2375                 ImpoundedInfo[idx][pImpounded],
        if(idx == 0)
        {
            file = fopen("Impounded.cfg", io_write);
        }
        else
        {
            file = fopen("Impounded.cfg", io_append);
        }
        fwrite(file, string);
        fclose(file);
        idx++;
    }
    print("Impounded saved successfully.");
}
This fixed.
Код:
D:\Documents and Settings\ScOuT3221\Desktop\SAMPSERVER\gamemodes\ZRP.pwn(2336) : error 021: symbol already defined: "ImpoundedInfo"
and it send me another error
Код:
D:\Documents and Settings\ScOuT3221\Desktop\SAMPSERVER\gamemodes\ZRP.pwn(2372 -- 2373) : error 028: invalid subscript (not an array or too many subscripts): "ImpoundedInfo"
Reply
#5

Co can someone help me with that bullshit ??
Reply
#6

Please help me
Reply
#7

SHowthe enum ImpoundedInfo
Reply
#8

pawn Код:
enum ImpoundedInfo
{
    pVeh,
    pImpounded,
}
Reply
#9

do like hulitubolies sayd
Reply
#10

So does somebody know how to fix it ??
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)