SA-MP Forums Archive
Vehicle Creation - 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: Vehicle Creation (/showthread.php?tid=503014)



Vehicle Creation - Sweez - 27.03.2014

Hello, i've just found a bug and i cannot fix it. When i try to create a vehicle, it gives me an error, look at my lines:

pawn Код:
else if(!strcmp(option, "vehicle", true, 7))
    {
        if(sscanf(params, "is[32]iiii", idx, option, veh, vehid, col1, col2)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /oedit [orgslot] vehicle [vehiclelot] [vehiclemodel] [color1] [color2]");
        if(veh < 1 || veh > 5) return SendClientMessage(playerid, COLOR_GREY, "Vehicle slots are between 1 and 5.");
        veh = veh-1;
        if(FamInfo[idx][fVehType][veh])
        {
            FamInfo[idx][fVehType][veh] = 0;
            FamInfo[idx][fVehCoX][veh] = 0;
            FamInfo[idx][fVehCoY][veh] = 0;
            FamInfo[idx][fVehCoZ][veh] = 0;
            FamInfo[idx][fVehRot][veh] = 0;
            FamInfo[idx][fVehCol1][veh] = 0;
            FamInfo[idx][fVehCol2][veh] = 0;
            DestroyVehicle(FamInfo[idx][fVeh][veh]);
        }
        if(vehid)
        {
            FamInfo[idx][fVehType][veh] = vehid;
            GetPlayerPos(playerid, FamInfo[idx][fVehCoX][veh], FamInfo[idx][fVehCoY][veh], FamInfo[idx][fVehCoZ][veh]);
            GetPlayerFacingAngle(playerid, FamInfo[idx][fVehRot][veh]);
            FamInfo[idx][fVehCol1][veh] = col1;
            FamInfo[idx][fVehCol2][veh] = col2;
            FamInfo[idx][fVeh][veh] = CreateVehicle(vehid, FamInfo[idx][fVehCoX][veh], FamInfo[idx][fVehCoY][veh], FamInfo[idx][fVehCoZ][veh], FamInfo[idx][fVehRot][veh], FamInfo[idx][fVehCol1][veh], FamInfo[idx][fVehCol2][veh], 1200);
            ChangeVehicleColor(FamInfo[idx][fVeh][veh], FamInfo[idx][fVehCol1][veh], FamInfo[idx][fVehCol2][veh]);
            Fam[FamInfo[idx][fVeh][veh]] = idx;
            format(string, sizeof(string), "AdmWarn: %s has set organisation %d's vehicle slot %d to ID %d.", RPN(playerid), idx, veh+1, vehid);
            SendAdminMessage(COLOR_DARKRED, 1, string);
        }
    }
    else SendClientMessage(playerid, COLOR_GREY, "Invalid option.");
    return 1;
}



Re: Vehicle Creation - SiraBots - 27.03.2014

What is the error you get?


Re: Vehicle Creation - Dokins - 27.03.2014

Definition of idx?


Re: Vehicle Creation - Sweez - 27.03.2014

I do not get errors in pawn, i get them while in the server, when i try to create a car, it says that this command doesnt exist.


Re: Vehicle Creation - ScriptFohLife - 27.03.2014

Try put CMD:COMMANDNAME(playerid, params[]) in the start.


Re: Vehicle Creation - Konstantinos - 27.03.2014

Load crashdetect: https://github.com/Zeex/samp-plugin-...es/tag/v4.13.1
Use debug info: https://github.com/Zeex/samp-plugin-...ith-debug-info

After done the above and re-compile, start the server and execute the command. If it displays the unknown command then post your server log.


Re: Vehicle Creation - BroZeus - 27.03.2014

I think u dont have all plugins get nativechecker sscanf and regex plugin then try


Re: Vehicle Creation - Sweez - 27.03.2014

Quote:
Originally Posted by BroZeus
Посмотреть сообщение
I think u dont have all plugins get nativechecker sscanf and regex plugin then try
I have all of them, its something from the script i think ..


Re: Vehicle Creation - BroZeus - 27.03.2014

Why dont you use ZCMD?


Re: Vehicle Creation - Hanuman - 27.03.2014

pawn Код:
else if(!strcmp(option, "vehicle", true, 7))
{
        if(sscanf(params, "is[32]iiii", idx, option, veh, vehid, col1, col2)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /oedit [orgslot] vehicle [vehiclelot] [vehiclemodel] [color1] [color2]");
        if(veh < 1 || veh > 5) return SendClientMessage(playerid, COLOR_GREY, "Vehicle slots are between 1 and 5.");
        veh = veh-1;
        if(FamInfo[idx][fVehType][veh])
        {
            FamInfo[idx][fVehType][veh] = 0;
            FamInfo[idx][fVehCoX][veh] = 0;
            FamInfo[idx][fVehCoY][veh] = 0;
            FamInfo[idx][fVehCoZ][veh] = 0;
            FamInfo[idx][fVehRot][veh] = 0;
            FamInfo[idx][fVehCol1][veh] = 0;
            FamInfo[idx][fVehCol2][veh] = 0;
            DestroyVehicle(FamInfo[idx][fVeh][veh]);
        }
        if(vehid)
        {
            FamInfo[idx][fVehType][veh] = vehid;
            GetPlayerPos(playerid, FamInfo[idx][fVehCoX][veh], FamInfo[idx][fVehCoY][veh], FamInfo[idx][fVehCoZ][veh]);
            GetPlayerFacingAngle(playerid, FamInfo[idx][fVehRot][veh]);
            FamInfo[idx][fVehCol1][veh] = col1;
            FamInfo[idx][fVehCol2][veh] = col2;
            FamInfo[idx][fVeh][veh] = CreateVehicle(vehid, FamInfo[idx][fVehCoX][veh], FamInfo[idx][fVehCoY][veh], FamInfo[idx][fVehCoZ][veh], FamInfo[idx][fVehRot][veh], FamInfo[idx][fVehCol1][veh], FamInfo[idx][fVehCol2][veh], 1200);
            ChangeVehicleColor(FamInfo[idx][fVeh][veh], FamInfo[idx][fVehCol1][veh], FamInfo[idx][fVehCol2][veh]);
            Fam[FamInfo[idx][fVeh][veh]] = idx;
            format(string, sizeof(string), "AdmWarn: %s has set organisation %d's vehicle slot %d to ID %d.", RPN(playerid), idx, veh+1, vehid);
            SendAdminMessage(COLOR_DARKRED, 1, string);
        }
        else SendClientMessage(playerid, COLOR_GREY, "Invalid option.");
        return 1;
}
Replace ur cmd with this.