Jump to content
  • 0

Despawn clan vehicle


TheGodfather

Question

Salut, cand folosesc /cpark, vreau ca masina in care sunt sa se despawneze la finalul comenzii. Dar nu se distruge corect acel clobject care este un tag, lipit pe masina ca un fel de vip name. Mai jos las comanda si o parte de cod unde se despawneaza corect masina, stergand corect si acel tag, pentru ca daca spawnez alta masina cu comanda care e acum, o sa apara tagul aiurea pe alta masina.

YCMD:cpark(playerid, params[], help) {
    new Float:X, Float:Y, Float:Z, Float:Angle, clanid = ClanVehicle[playerid];
    GetVehiclePos(GetPlayerVehicleID(playerid), X, Y, Z); GetVehicleZAngle(GetPlayerVehicleID(playerid), Angle);
    SetVehiclePos(ClanVehicleInfo[GetPlayerVehicleID(playerid)][clVehInGame], X, Y, Z); SetVehicleZAngle(ClanVehicleInfo[GetPlayerVehicleID(playerid)][clVehInGame], Angle);
    ClanVehicleInfo[clanid][clX] = X, ClanVehicleInfo[clanid][clY] = Y, ClanVehicleInfo[clanid][clZ] = Z, ClanVehicleInfo[clanid][clAngle] = Angle;
    SetCameraBehindPlayer(playerid);
    gQuery[0] = EOS; mysql_format( SQL, gQuery, sizeof gQuery, "UPDATE `clanvehicles` SET `X`='%f', `Y`='%f', `Z`='%f', `Angle`='%f' WHERE `ID`='%d'", X, Y, Z, Angle, ClanVehicleInfo[ClanVehicle[playerid]][clID]);
    mysql_tquery( SQL, gQuery, "", "" );
    DestroyObject(ClanVehicleInfo[ClanVehicle[playerid]][clObject]);
    ClanVehicleInfo[ClanVehicle[playerid]][clVehInGame] = 0;
    DestroyVehicle(GetPlayerVehicleID(playerid));
    return true; 
}

case DIALOG_CLANVEHICLES+210: {
            if(!response) return true;
            new i = SelectedHud[ playerid ];
            switch(listitem) {
                case 0: {
                    if(ClanVehicleInfo[i][clVehInGame] != 0) {
                        SCM(playerid, -1, "Clan vehicle despawned!");
                        DestroyVehicle(ClanVehicleInfo[i][clVehInGame]);
                        DestroyObject(ClanVehicleInfo[i][clObject]);
                        ClanVehicleInfo[i][clVehInGame] = 0;
                    }    

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

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.