Jump to content
  • 0

Problema masini


AdY.Capone

Question

Problema intalnita (descriere):Doresc sa pot spana mai multe masini pe server in acelasi timp. Cum pot modifica sistemul de spawnare al masinilor??
Ero(area / rile) / warning-(ul / urile): -
Liniile de cod / sursa / script-ul(obligatoriu):

 

 

 

if(dialogid == DIALOG_VPANEL)
    {
        if(response)
        {
            new var[800];
            new coordsstring[64] = "Name\tStatus\n";
            if(GetVehNumber(playerid) == 0 && GetTutVeh(playerid) == 0)
            {
                return SendClientMessage(playerid,COLOR_ERROR,"You do not currently own a vehicle.");
            }
            if(listitem == 0)
            {
                for(new i = 1; i <= Total_Veh_Created; i++)
                {
                    if(strmatch(vInfo[vOwner], GetName(playerid)))
                    {
                        if(IsVehSpawned(i) == 1) format(gString, sizeof(gString), "{FFFFFF}%s\t{33AA33}SPAWNED\n", VehicleNames[vInfo[vModel] - 400]);
                        else format(gString, sizeof(gString), "{FFFFFF}%s\t{F81414}DESPAWNED\n", VehicleNames[vInfo[vModel] - 400]);
                        strcat(var, gString);
                    }
                }
                strins(var, coordsstring, 0);
                ShowPlayerDialog(playerid, DIALOG_VEHSWITCH, DIALOG_STYLE_TABLIST_HEADERS, "Vehicles", var, "Switch", "Exit");
            }
            if(listitem == 1)
            {
                if(GetPlayerCash(playerid) < BizzInfo[9][bEntranceCost]) return SendClientMessage(playerid, COLOR_ERROR,"You don't have enough money.");
                new Float:health;
                GetVehicleHealth(GetSpawnedVeh(playerid), health);
                if(health < 248) SendClientMessage(playerid, COLOR_ERROR, "Vehiculul este incendiat!");
                if(GetDriver(GetSpawnedVeh(playerid)) == INVALID_PLAYER_ID)
                {
                    GivePlayerCash(playerid, - BizzInfo[9][bEntranceCost]);
                    SendClientMessage(playerid, COLOR_SYN2, "The vehicle was towed.");
                    SetVehicleToRespawn(GetSpawnedVeh(playerid));
                    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                    SetVehicleHealth(GetSpawnedVeh(playerid),health);
                    BizzInfo[9][bSafe] += BizzInfo[9][bEntranceCost];
                    bUpdate(9, bSafex);
                    BizzPayLog(playerid, 9, BizzInfo[9][bEntranceCost]);

                    format(gString, sizeof(gString), "~r~~h~-$%s", FormatNumber(BizzInfo[9][bEntranceCost]));
                    GameTextForPlayer(playerid, gString, 1000, 1);
                }
                else
                {
                    SendClientMessage(playerid, COLOR_ERROR,"Vehiculul este in folosinta cuiva!.");
                }
            }
            if(listitem == 2)
            {
                 SendClientMessage(playerid,COLOR_SYN2,"Vehiculul tau a fost localizat. Il gasesti la punctul C de pe harta!.");
                 GetVehiclePos(GetSpawnedVeh(playerid), VehLocateC[0][playerid], VehLocateC[1][playerid], VehLocateC[2][playerid]);
                 SetPlayerMapIcon( playerid, 69, VehLocateC[0][playerid], VehLocateC[1][playerid], VehLocateC[2][playerid], 12, 86, MAPICON_GLOBAL_CHECKPOINT );
                 PlayerPlaySound(playerid, 1149, 0.0, 0.0, 0.0);
                 VehLocateON[playerid] = 1;
            }
            if(listitem == 3)
            {
                for(new i = 1; i <= Total_Veh_Created; i++)
                {
                    if(strmatch(vInfo[vOwner], GetName(playerid)))
                    {
                        new lock[4], destroyed[4];
                        if(vInfo[vLocked] == 1) {lock = "Yes"; }
                        else if(vInfo[vLocked] == 0) {lock = "No"; }
                        if(vInfo[vDestroyed] == 1) {destroyed = "Yes"; }
                        else if(vInfo[vDestroyed] == 0) {destroyed = "No"; }
                        new model = vInfo[vModel] - 400;
                        new insurance = 0;
                        if(OdoVehicle(vInfo[vModel]) == 1) insurance = 100 + floatround(vInfo[vKm]);

                        format(gString, 256, "{FFFFFF}Model:[%s] Locked:[%s] Color1:[%d] Color2:[%d]\n{FFFFFF}Price:[$%s] Destroyed:[%s] KM:[%.1f] Insurance:[$%s]\n\n", VehicleNames[model], lock, vInfo[vColor1], vInfo[vColor2], FormatNumber(vInfo[vPrice]), destroyed, vInfo[vKm], FormatNumber(insurance));
                        strcat(var, gString);
                    }
                }
                ShowPlayerDialog(playerid, DIALOG_IPANEL, DIALOG_STYLE_MSGBOX, "Vehicles Info", var, "Close", "");
            }
            if(listitem == 4)
            {
                if(PlayerInfo[playerid][pGold] < 2500) return SendClientMessage(playerid, COLOR_ERROR, "Tu nu detii suficient gold!");
                if(PlayerInfo[playerid][pVehicleSlots] == 5) return SendClientMessage(playerid, COLOR_ERROR, "You can't own more than 5 vehicles.");
                PlayerInfo[playerid][pVehicleSlots] += 1;
                Update(playerid, pVehicleSlotsx);
                PlayerInfo[playerid][pGold] -= 2500;
                Update(playerid, pGoldx);
                SendClientMessage(playerid, COLOR_SYN2, "Tocmai ai achizitionat un slot de vehicul personal din Shop!");
            }
        }
    }

 

Acesta fiind dialogul, iar comanda

CMD:vehicles(playerid, params[])
{
    format(gString, sizeof(gString), "Spawn Vehicle\nTow Vehicle\nLocate Vehicle\nVehicles Info\n{FFCC00}[+] Add vehicle slots - {FFFF00}2.500{FFCC00} Gold");
    ShowPlayerDialog(playerid, DIALOG_VPANEL, DIALOG_STYLE_LIST, "Personal Vehicles Panel", gString, "Select", "Exit");
    return 1;
}

Imagini / Video (optional):
Ati incercat sa rezolvati singur?: Nu stiu ce sa modific mai exact..

 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

Guest
This topic is now closed to further replies.
×
×
  • 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.