Jump to content
  • 0

Ajutor Scripting


Davidoff7776

Question

Salut! Am si eu aceasta functie pe gm burned:

function DespawnVehicle(carid) {
    new dbid = FindSpawnID(carid);
    if(CarInfo[dbid][Spawned] != 0) DestroyPlayerCar(dbid);
    printf("Vehicle %d despawned. [db: %d]", carid, dbid);
    return 1;
}

si as dori sa adaug o verificare cum ca daca masina este folosita sa returneze 1 dar nu prea stiu cum sa fac asta

if(CarInfo[habar nu am ce sa scriu] = 1) return 1;

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0
1 hour ago, Davidoff7776 said:

Salut! Am si eu aceasta functie pe gm burned:

 


function DespawnVehicle(carid) {
    new dbid = FindSpawnID(carid);
    if(CarInfo[dbid][Spawned] != 0) DestroyPlayerCar(dbid);
    printf("Vehicle %d despawned. [db: %d]", carid, dbid);
    return 1;
}

 

si as dori sa adaug o verificare cum ca daca masina este folosita sa returneze 1 dar nu prea stiu cum sa fac asta

 


if(CarInfo[habar nu am ce sa scriu] = 1) return 1;

 

foreach(new i : Player) {

 new vehicle;

vehicle = GetPlayerVehicleID(i);

if(i == dbid) return 1;

}

Link to comment
Share on other sites

  • 0

function DespawnVehicle(carid) {
    if(IsVehicleOccupied(carid)) return SendClientMessage(playerid, COLOR_LGREEN, "vehiculul tau este ocupat!");
    new dbid = FindSpawnID(carid);
    if(CarInfo[dbid][Spawned] != 0) DestroyPlayerCar(dbid);
    printf("Vehicle %d despawned. [db: %d]", carid, dbid);
    return 1;
}

Link to comment
Share on other sites

  • 0

function DespawnVehicle(carid) {
    new dbid = FindSpawnID(carid);
    if(VehicleHaveDriver(dbid)) {
        VehicleTimer[dbid] = SetTimerEx("DespawnVehicle", 60000*20, 0, "d", dbid);// aici se reseteaza timer-ul pentru a nu ramane masina pe server
        return 1;
    }
    if(CarInfo[dbid][Spawned] != 0) DestroyPlayerCar(dbid);
    printf("Vehicle %d despawned. [db: %d]", carid, dbid);
    return 1;
}

ceva de genul ar trebuii sa fie, ca sa ti se reseteze si timer-ul, ca altfel ramane masina pe server

Link to comment
Share on other sites

  • 0
Acum 11 ore, Davidoff7776 a spus:

Pai daca e cineva in masina si se foloseste fuctia DespawnVehicle, va despawna si masinile cu jucatori in ele. Eu vreau sa fie despawnate decat cele nefolosite. 

Daca nu stii unde se modifica acea chestie nu te baga.

 

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
Answer this question...

×   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.