Jump to content

Porblema stage


Recommended Posts

Salut, am copiat toate scripturile legate de stage din gamemodeul bhood in gamemodeul burned si viteza vehiculului nu se actualizeaza. Va rog sa ma ajutati.

Un infernus fara stage prinde maxim 209, dar cu stage prinde tot 209

 

function OneTimer() {
    foreach(new i : IsSpeed) GiveVehicleSpeed(i);
    return 1;
}

l-am trecut sub functie deoarece sub forma de task dadea erori, iar apoi am zis sa apelez la functia de timer, dar nu mai stiu unde trebuia sa o pun.

 

SetTimer("OneTimer", 350, true); 

Link to comment
Share on other sites

7 hours ago, nobilzeus said:

arată funcția aia givevehiclespeed

si mai bine muți să fie apela funcția asta doar când tine apasat pe w 

function GiveVehicleSpeed(i) {
    if(ServerSystem[11] == 1 || !IsPlayerInAnyVehicle(i)) return true;
    
    new
        vehicleid = GetPlayerVehicleID(i),
        keys,
        Float:vx,
        Float:vy,
        Float:vz,
        carid = FindSpawnID(GetPlayerVehicleID(i))
    ;   

    if(GetVehicleSpeedUp(i, carid))
        return true;

    GetPlayerKeys(i, keys, _:vx, _:vx);

    if ((keys & (KEY_VEHICLE_FORWARD | KEY_VEHICLE_BACKWARD | KEY_HANDBRAKE)) == KEY_VEHICLE_FORWARD) {

        GetVehicleVelocity(vehicleid, vx, vy, vz);


        if (vx * vx + vy * vy < g_SpeedThreshold)
            return true;


        vx *= SPEED_MULTIPLIER;
        vy *= SPEED_MULTIPLIER;


        if (vz > 0.04 || vz < -0.04)
            vz -= 0.020;

        SetVehicleVelocity(vehicleid, vx, vy, vz);
    }
    return true;
}

Link to comment
Share on other sites

1 hour ago, segmentationfault said:

și ce faci dacă mașina își pierde treptat din viteză (neapăsând pe W)?

nu asta e logica? dacă nu apeși pe w încetinești 

 

 

    if(GetVehicleSpeedUp(i, carid) ia vezi aici

Edited by nobilzeus
Link to comment
Share on other sites

8 hours ago, nobilzeus said:

nu asta e logica? dacă nu apeși pe w încetinești 

 

 

    if(GetVehicleSpeedUp(i, carid) ia vezi aici

function GiveVehicleSpeed(i) {
    if(ServerSystem[11] == 1 || !IsPlayerInAnyVehicle(i)) return true;
    
    new
        vehicleid = GetPlayerVehicleID(i),
        keys,
        Float:vx,
        Float:vy,
        Float:vz,
        carid = FindSpawnID(GetPlayerVehicleID(i))
    ;   

    if(GetVehicleSpeedUp(i, carid))
        return true;

    GetPlayerKeys(i, keys, _:vx, _:vx);

    if ((keys & (KEY_VEHICLE_FORWARD | KEY_VEHICLE_BACKWARD | KEY_HANDBRAKE)) == KEY_VEHICLE_FORWARD) {

        GetVehicleVelocity(vehicleid, vx, vy, vz);


        if (vx * vx + vy * vy < g_SpeedThreshold)
            return true;


        vx *= SPEED_MULTIPLIER;
        vy *= SPEED_MULTIPLIER;


        if (vz > 0.04 || vz < -0.04)
            vz -= 0.020;

        SetVehicleVelocity(vehicleid, vx, vy, vz);
    }
    return true;
}

Link to comment
Share on other sites

1 minute ago, Smokey20_official said:

function GiveVehicleSpeed(i) {
    if(ServerSystem[11] == 1 || !IsPlayerInAnyVehicle(i)) return true;
    
    new
        vehicleid = GetPlayerVehicleID(i),
        keys,
        Float:vx,
        Float:vy,
        Float:vz,
        carid = FindSpawnID(GetPlayerVehicleID(i))
    ;   

    if(GetVehicleSpeedUp(i, carid))
        return true;

    GetPlayerKeys(i, keys, _:vx, _:vx);

    if ((keys & (KEY_VEHICLE_FORWARD | KEY_VEHICLE_BACKWARD | KEY_HANDBRAKE)) == KEY_VEHICLE_FORWARD) {

        GetVehicleVelocity(vehicleid, vx, vy, vz);


        if (vx * vx + vy * vy < g_SpeedThreshold)
            return true;


        vx *= SPEED_MULTIPLIER;
        vy *= SPEED_MULTIPLIER;


        if (vz > 0.04 || vz < -0.04)
            vz -= 0.020;

        SetVehicleVelocity(vehicleid, vx, vy, vz);
    }
    return true;
}

ai dat aceiași vezi ca are Up la sfârșit 

Link to comment
Share on other sites

10 minutes ago, nobilzeus said:

ai dat aceiași vezi ca are Up la sfârșit 

function GetVehicleSpeedUp(playerid, carid) {
    if(ServerSystem[11] == 1) return true;
    new x, m = CarInfo[carid][cMaxSpeed];
    x = CarInfo[carid][cStage] ? StageSpeed[0][CarInfo[carid][cStage]]+x : x;
    return Carspeed(GetPlayerVehicleID(playerid)) < (m-3) || Carspeed(GetPlayerVehicleID(playerid)) > (x-3) ? (true) : (false);
}

Link to comment
Share on other sites

cmaxspeed trebuie setat la toate mașinile, poți faci asta când o cumperi sau când faci upgrade la stage, posibil să ai deja vitezele maxime pt mașini în tabelul de la dealership și iei viteză maximă de acolo 

 

dacă e gm de pe net posibil ca unele valori să fie greșite pt anumite mașini deci probabil trebuie să actualizezi viteza maximă din tabel pt unele

Edited by nobilzeus
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.