Jump to content

Clan


Exaton

Recommended Posts

Salut grup am si eu o problema mica/mare dar pentru mine e mare si nu inteleg ce are. Am un gamemode da la un prieten cu clan vehicles pornit de la burned si cand cumpar o masina la clan si dupa cand cumpar a 2-a masina se pune in locul primei masini si prima masina dispare dupa restart dispar ambele din Clan Vehicles si in locul unde a fost creata masina pentru clan se pune o masina depe server (Factiune)

poftim codul:

function insert_clan_vehicle(playerid, modelid, price) {
    new 
        Float: Pos[3], Float: Angle,
        szQuery[256],
        string[128],
        carid = GetServerVehicles()+1,
        clanid = PlayerInfo[playerid][pClan];

    GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
    GetPlayerFacingAngle(playerid, Angle);


    ServerVehicles[carid][vSpawned] = CreateVehicle(modelid, Pos[0], Pos[1], Pos[2], Angle, 1, 1, -1);
    SetVehicleNumberPlate(ServerVehicles[carid][vSpawned], "NewCar");
    PutPlayerInVehicleEx(playerid, ServerVehicles[carid][vSpawned], 0);

    ServerVehicles[carid][vID] = carid;
    ServerVehicles[carid][vModel] = modelid;
    ServerVehicles[carid][vLocation][0] = Pos[0];
    ServerVehicles[carid][vLocation][1] = Pos[1];
    ServerVehicles[carid][vLocation][2] = Pos[2];
    ServerVehicles[carid][vAngle] = Angle;
    ServerVehicles[carid][vColor][0] = 1;
    ServerVehicles[carid][vColor][1] = 1;
    ServerVehicles[carid][vClan] = clanid;

    mysql_format(SQL, szQuery, sizeof(szQuery),
    "INSERT INTO `svehicles` (vID, vModel, LocationX, LocationY, LocationZ, Angle, Clan) VALUES ('%d', '%d', '%f', '%f', '%f', '%f', '%d')", carid, modelid, Pos[0], Pos[1], Pos[2], ServerVehicles[carid][vAngle], PlayerInfo[playerid][pClan]);
    mysql_query(SQL, szQuery);

    ClanInfo[clanid][clMoney] -= price;

    format(szQuery, sizeof(szQuery), "UPDATE `clans` SET `Money`='%d' WHERE `ID`='%d'", clan_money(clanid), clanid);
    mysql_tquery(SQL, szQuery, "", "");

    format(string, sizeof(string), "{%s}[CLAN] %s a cumparat vehiculul %s pentru clan (-$%s, total: $%s).", ClanInfo[clanid][clColor], GetName(playerid), aVehicleNames[modelid-400], FormatNumber(price), clan_money(clanid));
    SendClanMessage(clanid, string);
    return 1;
}

Edited by Exaton
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.