Cars Help
#1

hy.I add some vehicle to my cars.cfg and i have in total (gm+cars.cfg) 550 cars..but in game vehicle up to 500 don-t work..when i tray to turn the engine /engine sat server:unknown command same with /rtc and /rac...but under 500 work-s perfect..please help me
Reply
#2

change MAX_VEHICLES to 550 also check if you have increased array size in place where it reads from files
Reply
#3

i have just #define CAR_AMOUNT 1500 and don-t work ..i put #define MAX_VEHICLE 550 ?
Reply
#4

Agree With Voldemort Change Max_Vehicles To 550
Reply
#5

i change from 2000 to 550 but same shit...doesn-t work..please help me
Reply
#6

Show /engine cmd, please
Reply
#7

if(!strcmp(cmd, "/engine", true))
{
if(IsPlayerConnected(playerid))
{
if(!IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, COLOR_GREY, " You must be in a vehicle");
return 1;
}
if(!engineOn[GetPlayerVehicleID(playerid)])
{
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
{
return 1;
}
if(IsAnOwnableCar(idcar))
{
if(PlayerInfo[playerid][pPcarkey] == idcar) { }
else if(PlayerInfo[playerid][pPcarkey2] == idcar) { }
else if(PlayerInfo[playerid][pPcarkey3] == idcar) { }
else if(PlayerInfo[playerid][pPcarkey4] == idcar) { }
else { return 1; }
}
if(pveh == 510 || pveh == 462 || pveh == 481 || pveh == 509)
{
return 1;
}
if(idcar == 59 || idcar == 60)
{
return 1;
}
if(idcar >= 135 && idcar <= 154)
{
if(HireCar[playerid] != idcar)
{
return 1;
}
}
if(IsAPlane(idcar))
{
return 1;
}
if(IsAHarvest(idcar))
{
return 1;
}
if(IsASweeper(idcar))
{
return 1;
}
if(IsAGarbage(idcar))
{
return 1;
}
new vehicle = GetPlayerVehicleID(playerid);
if(Motor[vehicle] == 1) { return 1; }
new motor, lights, alarm, doors, bonnet, boot, objective;
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s invarte cheia si incearca sa porneasca motorul.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
SetTimerEx("StartingTheVehicle",500,0,"i",playerid );
GameTextForPlayer(playerid, "~w~Pornind Motor...",500,3);
Motor[vehicle] = 1;
GetVehicleParamsEx(vehicle, motor, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicle, 1, lights, alarm, doors, bonnet, boot, 0);
return 1;
}
if(engineOn[GetPlayerVehicleID(playerid)])
{
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
{
return 1;
}
if(IsAnOwnableCar(idcar))
{
if(PlayerInfo[playerid][pPcarkey] == idcar) { }
else if(PlayerInfo[playerid][pPcarkey2] == idcar) { }
else if(PlayerInfo[playerid][pPcarkey3] == idcar) { }
else if(PlayerInfo[playerid][pPcarkey4] == idcar) { }
else { return 1; }
}
if(pveh == 510 || pveh == 462 || pveh == 481 || pveh == 509)
{
return 1;
}
if(idcar == 59 || idcar == 60)
{
return 1;
}
if(idcar >= 135 && idcar <= 154)
{
if(HireCar[playerid] != idcar)
{
return 1;
}
}
if(IsAHarvest(idcar))
{
return 1;
}
if(IsADrugHarvest(idcar))
{
return 1;
}
if(IsAPlane(idcar))
{
return 1;
}
if(IsASweeper(idcar))
{
return 1;
}
new vehicle = GetPlayerVehicleID(playerid);
engineOn[GetPlayerVehicleID(playerid)] = false;
//RemovePlayerFromVehicle(playerid);
new motor, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicle, motor, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicle, 0, lights, alarm, doors, bonnet, boot, 0);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s Opreste motorul.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
Motor[vehicle] = 0;
return 1;
}

}
return 1;
}

and ownable:
public IsAnOwnableCar(vehicleid)
{
if(vehicleid >= 357 && vehicleid <= 550) { return 1; }
return 0;
}
Reply
#8

Try this, you just need to understand what you write ;p, not as bad, but just think what you write, drop out all unneded variables etc, and in result you get this, but still make sure you dont mix vehicleid from game with id from file in IsAnOwnableCar etc, hope I helped
pawn Код:
if(!strcmp(cmd, "/Motor", true))
{
    if(IsPlayerConnected(playerid))
    {
        if(!IsPlayerInAnyVehicle(playerid))
        {
            SendClientMessage(playerid, COLOR_GREY, " Trebuie sa fii intr-un vehicul pentru a folosi aceasta comanda");
            return 1;
        }
        new v = GetPlayerVehicleID(playerid);
        if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
        {
            return 1;
        }
        if(IsAnOwnableCar(v))
        {
            if(PlayerInfo[playerid][pPcarkey] == v) { }
            else if(PlayerInfo[playerid][pPcarkey2] == v) { }
            else if(PlayerInfo[playerid][pPcarkey3] == v) { }
            else if(PlayerInfo[playerid][pPcarkey4] == v) { }
            else { return 1; }
        }
        if(v == 510 || v == 462 || v == 481 || v == 509 || v == 59 || v == 60)
        {
            return 1;
        }
        if(v >= 135 && v <= 154)
        {
            if(HireCar[playerid] != v)
            {
                return 1;
            }
        }
        if(IsAPlane(v) || IsAHarvest(v) || IsASweeper(v) || IsAGarbage(v))
        {
            return 1;
        }
        GetPlayerName(playerid, sendername, sizeof(sendername));
        if(Motor[v] == 1)
        {
            GameTextForPlayer(playerid, "~w~Stopping Motor...",500,3);
            format(string, sizeof(string), "* %s stops engine.", sendername);
            Motor[v] = 0;
        }
        else
        {
            GameTextForPlayer(playerid, "~w~Starting Motor...",500,3);
            format(string, sizeof(string), "* %s starts engine.", sendername);
            SetTimerEx("StartingTheVehicle",500,0,"i",playerid);
            Motor[v] = 1;
        }
        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
        new motor, lights, alarm, doors, bonnet, boot, objective;
        GetVehicleParamsEx(vehicle, motor, lights, alarm, doors, bonnet, boot, objective);
        SetVehicleParamsEx(vehicle,Motor[v], lights, alarm, doors, bonnet, boot, objective);
        return 1;
    }
    return 1;
}
Reply
#9

same shit...server:unknown command and the vehicle doesn-t sttart....but at 499 id car work perfect
Reply
#10

between each if put print("1"); print("2"); and so on..

do cmd once then go to server log and check how far it have counted, so you know untill which if it can execute, I go for owned vehicles, or some function works different, such as IsAHarvest, as you increased cars count in cars.cfg it means all car ids goes up and IsAHarvest isnt IsAHarvest anymore, IDs just doesnt match, simple way to fix this is new Morecars = 50;

and in /motor cmd add example:
if(idcar == 59+Morecars || idcar == 60+Morecars)
{
return 1;
}

just think and you will get what I mean, have fun with pawno sex
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)