Jump to content

Clan


Exa
 Share

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;
}

Link to comment
Share on other sites

  • 4 weeks later...
  • 577777 locked this topic
Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...