Jump to content
  • 0

Probleme DS


PauLL

Question

Problema intalnita (descriere): Am reusit sa fac oarecum prima parte a sistemului de DS,insa acum am alta problema.Cand se utilizeaza o comanda gen  /buyinfernus [cand se cumpara masina ] ma da in ea si se blocheaza timpul 11 secunde...sau la /vpark sau /vcolor ,se blocheaza timpul pentru aproximativ 11 secunde,apoi revine la loc si comanda functioneaza,insa nu stiu de ce se blocheaza timpul si nu stiu de la ce poate fii.
Ero(area / rile) / warning-(ul / urile): Nici unul.
Liniile de cod / sursa / script-ul(obligatoriu): Comenzile de la /v [park,color,etc] :  comanda /buyinfernus

 

 // comanda buy infernus//
        if(strcmp(cmd, "/buyinfernus", true) == 0)
    {
    
    
        if(PlayerInfo[playerid][pPcarkey] == -1) { }
        else if(PlayerInfo[playerid][pPcarkey2] == -1) { }
        else if(PlayerInfo[playerid][pPcarkey3] == -1) { }
        else { SendClientMessage(playerid, COLOR_GREY, "* Detii 3 masini!"); return 1; }
        if(PlayerInfo[playerid][pLevel] >= 5 )
         {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_WHITE, "{00A1FF}USAGE:{C0C0C0} /buyinfernus [color1] [color2] ");
                return 1;
            }
        //    new car;
        //    car = strval(tmp);
        //    if(car < 411 || car > 411) { SendClientMessage(playerid, COLOR_WHITE, "{0950F7}*Aceasta este comanda de a cumpara infernus !"); return 1; }
        //    tmp = strtok(cmdtext, idx);
    //    if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "{00A1FF}USAGE:{C0C0C0} /buyinfernus"); return 1; }
         

 

            new color1;
            color1 = strval(tmp);
            if(color1 < 0 || color1 > 126) { SendClientMessage(playerid, COLOR_WHITE, "{0950F7}* Color Number can't be below 0 or above 126 !"); return 1; }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "{00A1FF}USAGE:{C0C0C0} /acreatecar [carid] [color1] [color2] [price]"); return 1; }
            new color2;
            color2 = strval(tmp);
            if(color2 < 0 || color2 > 126) { SendClientMessage(playerid, COLOR_WHITE, "{0950F7}* Color Number can't be below 0 or above 126 !"); return 1; }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "{00A1FF}USAGE:{C0C0C0} /acreatecar [carid] [color1] [color2] [price]"); return 1; }
            new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z);
            new thiscar = CreateVehicle(411,X,Y,Z,1,color1,color2,99999999);
               if(PlayerInfo[playerid][pPcarkey] == -1) { PlayerInfo[playerid][pPcarkey] = thiscar; }
              else if(PlayerInfo[playerid][pPcarkey2] == -1) { PlayerInfo[playerid][pPcarkey2] = thiscar; }
               else if(PlayerInfo[playerid][pPcarkey3] == -1) { PlayerInfo[playerid][pPcarkey3] = thiscar; }
            else { return 1; }
            
          //  new value = strval(tmp);

            CarInfo[thiscar][cModel] = 411; CarInfo[thiscar][cColorOne] = color1; CarInfo[thiscar][cColorTwo] = color2;
               CarInfo[thiscar][cLocationx] = X; CarInfo[thiscar][cLocationy] = Y; CarInfo[thiscar][cLocationz] = Z; CarInfo[thiscar][cAngle] = 1;
            CarInfo[thiscar][paintjob] = -1; LoadComponents(thiscar); PutPlayerInVehicle(playerid,thiscar,0);


            CarInfo[thiscar][cOwned] = 1;
            GetPlayerName(playerid, sendername, sizeof(sendername));
            strmid(CarInfo[thiscar][cOwner], sendername, 0, strlen(sendername), 999);
            GivePlayerMoney(playerid,-150000);
            //Delete3DTextLabel(TextUpCar[idcar]);
              OnCarUpdate(); SavePlayerData(playerid);
            PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
            GameTextForPlayer(playerid, "~w~Felicitari~n~ai platit 150k pentru infernus !", 5000, 3);
            TogglePlayerControllable(playerid, 1);

          return 1;
          }
    }

 Si comenzile de la /v

 

//==========================[/v(ehicle)]========================================
    if(strcmp(cmd, "/v", true) == 0 || strcmp(cmd, "/vehicle", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            new x_nr[64];
            x_nr = strtok(cmdtext, idx);
            if(!strlen(x_nr))
            {
                SendClientMessage(playerid, COLOR_WHITE, "____________[Personal Vehicle Help]____________");
                SendClientMessage(playerid, COLOR_WHITE, "** {1AFF00}(/v)ehicle {09DFF7}[name]");
                SendClientMessage(playerid, COLOR_WHITE, "**buy, park, color, tow(1-3), fix(1-3), model");
                return 1;
            }
            if(strcmp(x_nr,"park",true) == 0)
            {
                new Float:x,Float:y,Float:z;
                new Float:a;
                new carid;
                new getcarid = GetPlayerVehicleID(playerid);
                if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { carid = PlayerInfo[playerid][pPcarkey]; }
                else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { carid = PlayerInfo[playerid][pPcarkey2]; }
                else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3]) { carid = PlayerInfo[playerid][pPcarkey3]; }
                else { return 1; }
                GetPlayerName(playerid, playername, sizeof(playername));
                GetVehiclePos(carid, x, y, z);
                GetVehicleZAngle(carid, a);
                if(IsPlayerInVehicle(playerid,carid) && CarInfo[carid][cOwned] == 1)
                {
                       if(PlayerInfo[playerid][pPcarkey] == -1 && PlayerInfo[playerid][pPcarkey2] == -1 && PlayerInfo[playerid][pPcarkey3] == -1)
                    {
                        SendClientMessage(playerid, COLOR_GREY, "N ai o masina personala.");
                        return 1;
                    }
                       if(getcarid == carid)
                    {
                        new Float:CarHP, Float:OldCarHP; new panels,doors,lights,tires;
                        CarInfo[carid][cLocationx] = x;
                        CarInfo[carid][cLocationy] = y;
                        CarInfo[carid][cLocationz] = z;
                        CarInfo[carid][cAngle] = a;
                        GetVehicleDamageStatus(carid,panels,doors,lights,tires);
                        GetVehicleHealth(carid, CarHP); OldCarHP = CarHP;
                        OnCarUpdate(); DestroyVehicle(carid);
                        CreateVehicle(CarInfo[carid][cModel],CarInfo[carid][cLocationx],CarInfo[carid][cLocationy],CarInfo[carid][cLocationz]+1.0,CarInfo[carid][cAngle],CarInfo[carid][cColorOne],CarInfo[carid][cColorTwo],60000);
//                        format(TextCar, sizeof(TextCar), "{EE1111}Owner: {0099FF}• %s •", CarInfo[carid][cOwner]);
//                       Update3DTextLabelText(TextUpCar[carid], 0x33AAFFFF, TextCar);
                        LoadComponents(carid);
                        SendClientMessage(playerid, COLOR_BLUE, "* Noua pozitie a fost salvata!");
                         SetVehicleHealth(carid, OldCarHP);
                        UpdateVehicleDamageStatus(carid, panels, doors, lights, tires);
                        return 1;
                       }
                }
            }
       
            else if(strcmp(x_nr,"color",true) == 0)
            {
                if(PlayerInfo[playerid][pPcarkey] == -1 && PlayerInfo[playerid][pPcarkey2] == -1 && PlayerInfo[playerid][pPcarkey3] == -1)
                {
                    SendClientMessage(playerid, COLOR_GREY,"  You don't have a Vehicle to respray.");
                    return 1;
                }
                if(GetPlayerMoney(playerid) < 1000)
                {
                    SendClientMessage(playerid, COLOR_GREY,"  You don't have enough money for vehicle respray.");
                    return 1;
                }
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_WHITE, "USAGE: /v color [ColorOneID] [ColorTwoID]");
                    return 1;
                }
                new color1;
                color1 = strval(tmp);
                if(color1 < 0 && color1 > 126)
                {
                    SendClientMessage(playerid, COLOR_GREY, " Wrong color id!");
                    return 1;
                }
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_WHITE, "USAGE: /v color [ColorOneID] [ColorTwoID]");
                    return 1;
                }
                new color2;
                color2 = strval(tmp);
                if(color2 < 0 && color2 > 126)
                {
                    SendClientMessage(playerid, COLOR_GREY, " Wrong color id!");
                    return 1;
                }
                if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { vehid = PlayerInfo[playerid][pPcarkey]; }
                else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { vehid = PlayerInfo[playerid][pPcarkey2]; }
                else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3]) { vehid = PlayerInfo[playerid][pPcarkey3]; }
                else { return 1; }
                if(IsPlayerInVehicle(playerid, vehid))
                {
                    new Float:CarHP, Float:OldCarHP;
                    new panels, doors, lights, tires;
                    GetVehicleDamageStatus(vehid, panels, doors, lights, tires);
                    GetVehicleHealth(vehid, CarHP); OldCarHP = CarHP;
                     CarInfo[vehid][cColorOne] = color1;
                    CarInfo[vehid][cColorTwo] = color2;
                    GivePlayerMoney(playerid, -1000);
                    GameTextForPlayer(playerid, "~w~Masina Personala~n~~g~Revopsita cu succes~n~~r~$-100", 5000, 1);
                    ChangeVehicleColor(vehid, color1, color2);
                    SetVehicleToRespawn(vehid);
                    SetVehicleHealth(vehid, OldCarHP);
                    UpdateVehicleDamageStatus(vehid, panels, doors, lights, tires);
                    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                    OnCarUpdate();
                    return 1;
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY," You are not in your Personal car.");
                    return 1;
                }
            }
            /*else if(strcmp(x_nr,"locate1",true) == 0)
            {
                 if(!IsPlayerConnected(playerid)) { return 1; }
                new Float:x,Float:y,Float:z;
                new car = PlayerInfo[playerid][pPcarkey];
                if(PlayerInfo[playerid][pPcarkey]==-1) { GameTextForPlayer(playerid, "~w~Nu ai o masina pentru a putea fi localizata", 2500, 3); return 1; }
                SendClientMessage(playerid,COLOR_WHITE,"Locatia masinii a fost gasita.");
                GetVehiclePos(car, x, y, z);
                SetPlayerCheckpoint(playerid, x, y, z, 6);
                return 1;
            }
            else if(strcmp(x_nr,"locate2",true) == 0)
            {
                 if(!IsPlayerConnected(playerid)) { return 1; }
                new Float:x,Float:y,Float:z;
                new car = PlayerInfo[playerid][pPcarkey2];
                if(PlayerInfo[playerid][pPcarkey2]==-1) { GameTextForPlayer(playerid, "~w~Nu ai o masina pentru a putea fi localizata", 2500, 3); return 1; }
                SendClientMessage(playerid,COLOR_WHITE,"Locatia masinii a fost gasita.");
                GetVehiclePos(car, x, y, z);
                SetPlayerCheckpoint(playerid, x, y, z, 6);
                return 1;
            }
            else if(strcmp(x_nr,"locate3",true) == 0)
            {
                 if(!IsPlayerConnected(playerid)) { return 1; }
                new Float:x,Float:y,Float:z;
                new car = PlayerInfo[playerid][pPcarkey3];
                if(PlayerInfo[playerid][pPcarkey3]==-1) { GameTextForPlayer(playerid, "~w~Nu ai o masina pentru a putea fi localizata", 2500, 3); return 1; }
                SendClientMessage(playerid,COLOR_WHITE,"Locatia masinii a fost gasita.");
                GetVehiclePos(car, x, y, z);
                SetPlayerCheckpoint(playerid, x, y, z, 6);
                return 1;
            }*/
            else if(strcmp(x_nr,"tow1",true) == 0)
            {
                if(IsPlayerConnected(playerid))
                {
                    new Float:CarHP, Float:OldCarHP;
                    new panels,doors,lights,tires;
                    new car = PlayerInfo[playerid][pPcarkey];
                    GetPlayerName(playerid, playername, sizeof(playername));
                    if (car != -1 && strcmp(playername, CarInfo[PlayerInfo[playerid][pPcarkey]][cOwner], true) == 0)
                    {
                        GetVehicleDamageStatus(car,panels,doors,lights,tires);
                        GetVehicleHealth(car, CarHP); OldCarHP = CarHP;
                        GameTextForPlayer(playerid, "~w~Masina personala~n~~g~Tractata cu succes~n~~r~$-1.500", 5000, 1);
                        GivePlayerMoney(playerid,-1500);
                        SetVehicleToRespawn(car);
                        SetVehicleHealth(car, OldCarHP);
                        UpdateVehicleDamageStatus(car, panels, doors, lights, tires);
                        PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                    }
                    else
                    {
                        GameTextForPlayer(playerid, "~w~Nu detii o masina personala.", 5000, 1);
                    }
                }
            }
            else if(strcmp(x_nr,"tow2",true) == 0)
            {
                if(IsPlayerConnected(playerid))
                {
                    new Float:CarHP, Float:OldCarHP;
                    new panels,doors,lights,tires;
                    new car = PlayerInfo[playerid][pPcarkey2];
                    GetPlayerName(playerid, playername, sizeof(playername));
                    if (car != -1 && strcmp(playername, CarInfo[PlayerInfo[playerid][pPcarkey2]][cOwner], true) == 0)
                    {
                        GetVehicleDamageStatus(car,panels,doors,lights,tires);
                        GetVehicleHealth(car, CarHP); OldCarHP = CarHP;
                        GameTextForPlayer(playerid, "~w~Masina personala~n~~g~Tractata cu succes~n~~r~$-1.500", 5000, 1);
                        GivePlayerMoney(playerid,-1500);
                        SetVehicleToRespawn(car);
                        SetVehicleHealth(car, OldCarHP);
                        UpdateVehicleDamageStatus(car, panels, doors, lights, tires);
                        PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                    }
                    else
                    {
                        GameTextForPlayer(playerid, "~w~Nu detii o masina personala.", 5000, 1);
                    }
                }
            }
            else if(strcmp(x_nr,"tow3",true) == 0)
            {
                if(IsPlayerConnected(playerid))
                {
                    new Float:CarHP, Float:OldCarHP;
                    new panels,doors,lights,tires;
                    new car = PlayerInfo[playerid][pPcarkey3];
                    GetPlayerName(playerid, playername, sizeof(playername));
                    if (car != -1 && strcmp(playername, CarInfo[PlayerInfo[playerid][pPcarkey3]][cOwner], true) == 0)
                    {
                        GetVehicleDamageStatus(car,panels,doors,lights,tires);
                        GetVehicleHealth(car, CarHP); OldCarHP = CarHP;
                        GameTextForPlayer(playerid, "~w~Masina personala~n~~g~Tractata cu succes~n~~r~$-1.500", 5000, 1);
                        GivePlayerMoney(playerid,-1500);
                        SetVehicleToRespawn(car);
                        SetVehicleHealth(car, OldCarHP);
                        UpdateVehicleDamageStatus(car, panels, doors, lights, tires);
                        PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                    }
                    else
                    {
                        GameTextForPlayer(playerid, "~w~Nu detii o masina personala.", 5000, 1);
                    }
                }
            }
            else if(strcmp(x_nr,"fix1",true) == 0)
            {
                if(IsPlayerConnected(playerid))
                {
                    new car = PlayerInfo[playerid][pPcarkey];
                    GetPlayerName(playerid, playername, sizeof(playername));
                    if (car != -1 && strcmp(playername, CarInfo[PlayerInfo[playerid][pPcarkey]][cOwner], true) == 0)
                    {
                        GameTextForPlayer(playerid, "~w~Masina personala~n~~g~Reparata cu succes~n~~r~$-2.500", 5000, 1);
                        GivePlayerMoney(playerid,-2500);
                        SetVehicleToRespawn(car);
                        PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                    }
                    else
                    {
                        GameTextForPlayer(playerid, "~w~Nu detii o masina personala.", 5000, 1);
                    }
                }
            }
            else if(strcmp(x_nr,"fix2",true) == 0)
            {
                if(IsPlayerConnected(playerid))
                {
                    new car = PlayerInfo[playerid][pPcarkey2];
                    GetPlayerName(playerid, playername, sizeof(playername));
                    if (car != -1 && strcmp(playername, CarInfo[PlayerInfo[playerid][pPcarkey2]][cOwner], true) == 0)
                    {
                        GameTextForPlayer(playerid, "~w~Masina personala~n~~g~Reparata cu succes~n~~r~$-2.500", 5000, 1);
                        GivePlayerMoney(playerid,-2500);
                        SetVehicleToRespawn(car);
                        PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                    }
                    else
                    {
                        GameTextForPlayer(playerid, "~w~Nu detii o masina personala.", 5000, 1);
                    }
                }
            }
            else if(strcmp(x_nr,"fix3",true) == 0)
            {
                if(IsPlayerConnected(playerid))
                {
                    new car = PlayerInfo[playerid][pPcarkey3];
                    GetPlayerName(playerid, playername, sizeof(playername));
                    if (car != -1 && strcmp(playername, CarInfo[PlayerInfo[playerid][pPcarkey3]][cOwner], true) == 0)
                    {
                        GameTextForPlayer(playerid, "~w~Masina personala~n~~g~Reparata cu succes~n~~r~$-2.500", 5000, 1);
                        GivePlayerMoney(playerid,-2500);
                        SetVehicleToRespawn(car);
                        PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                    }
                    else
                    {
                        GameTextForPlayer(playerid, "~w~Nu detii o masina personala.", 5000, 1);
                    }
                }
            }
            else if(strcmp(x_nr,"x2x1x4x4x1",true) == 0)
            {
                new Float:x,Float:y,Float:z;
                new carid;
                new Float:a;
                new Float:CarHP, Float:OldCarHP;
                new panels,doors,lights,tires;
                carid = GetPlayerVehicleID(playerid);
                GetVehiclePos(carid, x, y, z);
                GetVehicleZAngle(carid, a);
                if(IsPlayerInVehicle(playerid,carid))
                {
                    if(PlayerInfo[playerid][pDonateRank] < 3)
                    {
                        SCM(playerid, COLOR_GREY, "* Trebuie sa ai cont EXTRA VIP pentru acces la /v model!");
                        return 1;
                    }
                    if(GetPlayerMoney(playerid) < 5000)
                    {
                    SendClientMessage(playerid, COLOR_GREY,"Nu ai destui bani.");
                    return 1;
                    }
                    tmp = strtok(cmdtext, idx);
                    if(!strlen(tmp))
                    {
                        SCM(playerid, COLOR_GREY, "USAGE: x");
                        return 1;
                    }
                    new model;
                    model = strval(tmp);
                    if(model < 400 || model > 611)
                    {
                    SCM(playerid, COLOR_GREY, "* x");
                    return 1;
                    }
                    else
                    {
                    //new tittle[128];
                    //new carkey = PlayerInfo[playerid][pPcarkey];
                    //format(tittle,128,"%s", CarInfo[carkey][cModel]);
                    //else
                    //{
                    CarInfo[carid][cModel] = model;
                     CarInfo[carid][cLocationx] = x;
                     CarInfo[carid][cLocationy] = y;
                     CarInfo[carid][cLocationz] = z;
                     CarInfo[carid][cAngle] = a;
                     //format(string, sizeof(string), "~n~ You changed Car's Model~n~");
                     GetVehicleDamageStatus(carid,panels,doors,lights,tires);
                    GetVehicleHealth(carid, CarHP); OldCarHP = CarHP;
                    OnCarUpdate(); DestroyVehicle(carid);
                    CreateVehicle(CarInfo[carid][cModel],CarInfo[carid][cLocationx],CarInfo[carid][cLocationy],CarInfo[carid][cLocationz]+1.0,CarInfo[carid][cAngle],CarInfo[carid][cColorOne],CarInfo[carid][cColorTwo],60000);
                    LoadComponents(carid);
                    GivePlayerMoney(playerid, -5000);
                    SendClientMessage(playerid, COLOR_BLUE, "* Schimbarea modelului te-a costat $5.000!");
                     //format(string, sizeof(string), "~n~ You changed Car's Model~n~");
                     SetVehicleHealth(carid, OldCarHP);
                    UpdateVehicleDamageStatus(carid, panels, doors, lights, tires);
                    format(CarInfo[carid][cDescription], 32, "%s",vehName[model-400]);
                    return 1;
                    }
                /*else
                {
                SCM(playerid, COLOR_GREY, "* Trebuie sa fi in masina pentru a utiliza comanda!");
                return 1;
                }*/
               }
               return 1;
            }
            else
            {
                SendClientMessage(playerid, COLOR_WHITE, "____________[Personal Vehicle Help]____________");
                SendClientMessage(playerid, COLOR_WHITE, "** {1AFF00}(/v)ehicle {09DFF7}[name]");
                SendClientMessage(playerid, COLOR_WHITE, "**buy, park, color, tow(1-3), fix(1-3), model");
                return 1;
            }
           }
        return 1;
    }

 


Imagini / Video (optional): Nu este nevoie
Ati incercat sa rezolvati singur?: Nu am idee de la ce s-ar putea bloca timpul.

Multumesc anticipat,as dorii sa stiu ce este gresit si de la ce se blocheaza timpul.

As dori sa mentionez faptul ca,inafara de freeze-ul la ceas de 11 secunde,comenzile merg:masina se creeaza,se pune pe numele cui trebuie,se salveaza,se parkeaza,ii se schimba culorile..etc]

Edited by PauLL
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Ai un timmer cred....

Y!M: menyx.official

Skype: menyx.official

 

 

Inainte de a critica o persoana indiferent de etnie/varsta/inteligenta ei uita-te la tine si nu uita ca toti suntem Oameni si ca nu are sens sa incerci sa pari diferit!Daca esti mai prost/destept decat cel scos/aflat in discutie incearca sa nu faci pe "MR. Inteligent" TACI si FACI!

Respecta membrii acestei comunitati daca ai pretentia sa fi respectat si tratat(a) ca pe o fiinta umana!

 

Nu fac nimic remarcabil, dar ceea ce fac este esenţial.•

 

Link to comment
Share on other sites

  • 0

Uitate la urmatoarele functii :

 

  • OnCarUpdate();
  • SavePlayerData(playerid);

Cauta si vezi daca pe undeva se iveste "TogglePlayerControllable(playerid, 0);  sau vreun timer.

Link to comment
Share on other sites

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.