Jump to content

Question

Posted (edited)

salutare,

Cum fac sa sterg vehiculele din clan?

Quote

CMD:removevehicleclan(playerid, params[]) {
    new clanid;
    if(sscanf(params, "i", clanid)) return SCM(playerid, COLOR_SERVER, "Syntax: {FFFFFF}/removevehicleclan [clanid]");

    // AICI NU DESPAWNEAZA VEHICULELE, in rest, le sterge din database;
    for(new idz = 0; idz < MAX_CARS; idz ++) {
        if(CarClan[idz][vClanID] == clanid) {
            CarClan[idz][vSpawned] = 0;
            DestroyVehicle(CarClan[idz][vSpawned]);
        }
    }    
    new string[128];
    mysql_format(SQL, string, sizeof(string), "DELETE FROM clan_vehicles WHERE ClanID=%d",clanid);
    mysql_tquery(SQL, string, "", "");    
    return 1;
}

 

Edited by cstef4n

1 answer to this question

Recommended Posts

  • 0
Posted (edited)

salut, trebuie să apelezi funcția DestroyVehicle înainte de a reseta variabila care păstrează id-ul mașinii de clan.

DestroyVehicle(CarClan[idz][vSpawned]);
CarClan[idz][vSpawned] = 0;

recomand sa mai pui si niste verificari extra (de ex daca vehiculul exista) si sa pui INVALID_VEHICLE_ID in loc de 0.

Edited by sunkie

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.