Jump to content

Recommended Posts

Posted

Salut am comanda asta /editcarmodel,o compliez fara nicio problema,intru pe server,si cand stau intr-o masina si execut comanda imi scrie Car model id x is now id 411 asta fiind infernus,si imi spameaza chatu cu textul asta pana mi se inchide conexiunea la server,nu pica serverul,mi se blocheaza mie sampu. Serverul ramane on.

Comanda: 

}
    if(strcmp(cmd, "/editcarmodel", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pAdmin] < 4)
            {
                SendClientMessage(playerid, COLOR_GRAD2, "   Nu esti Admin !");
                return 1;
            }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /editcarmodel [modelid]");
                return 1;
            }
            new proplev = strval(tmp);
            for(new i = 0; i < sizeof(CarInfo); i++)
            {
                if(IsAnOwnableCar(idcar))
                {
                    CarInfo[idcar][cModel] = proplev;
                    format(string, sizeof(string), "Car: %d is now %d",idcar,CarInfo[idcar][cModel]);
                    SendClientMessage(playerid, COLOR_GRAD2, string);
                    OnPropUpdate();
                }
            }
        }
        return 1;
    }

  • Upvote 1
Posted (edited)

 

ia incearca asa.

 if(strcmp(cmd, "/editcarmodel", true) == 0)
    {

            new proplev = strval(tmp);
            for(new i = 0; i < sizeof(CarInfo); i++)
            if(PlayerInfo[playerid][pAdmin] >= 5)
            {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))

           {
                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /editcarmodel [modelid]");
                return 1;
                if(IsAnOwnableCar(idcar))
                {
                    CarInfo[idcar][cModel] = proplev;
                    format(string, sizeof(string), "Car: %d is now %d",idcar,CarInfo[idcar][cModel]);
                    SendClientMessage(playerid, COLOR_GRAD2, string);
                    OnPropUpdate();

                  return 0;
                }
            }
        }

       else return SendClientMessage(playerid, COLOR_GRAD2, "Nu esti admin.");
        return 1;
    }

Edited by Alberto.
Posted

am analizat mai bine comanda. Cred ca ar fii necesar doar sa ii pui un return atunci cand iti arata acel text

Comanda: 

}
    if(strcmp(cmd, "/editcarmodel", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pAdmin] < 4)
            {
                SendClientMessage(playerid, COLOR_GRAD2, "   Nu esti Admin !");
                return 1;
            }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /editcarmodel [modelid]");
                return 1;
            }
            new proplev = strval(tmp);
            for(new i = 0; i < sizeof(CarInfo); i++)
            {
                if(IsAnOwnableCar(idcar))
                {
                    CarInfo[idcar][cModel] = proplev;
                    format(string, sizeof(string), "Car: %d is now %d",idcar,CarInfo[idcar][cModel]);
                    SendClientMessage(playerid, COLOR_GRAD2, string);
                    OnPropUpdate();

                  return 1; // asta am adaugat 
                }
            }
        }
        return 1;
    }

Posted (edited)

Acum merge,doar ca trebuie sa dau restart la server pentru a se transforma masina in ce vreau. Adica eu /editcarmodel la un Elegy sa se faca infernus,imi scrie Car id 323 is now model 411 dar abia dupa ce dau restart la server se transforma,nu se poate face ceva?

Edited by AlexanderSMG
Posted

e normal sa o "transforme" dupa ce primeste un respawn. Poti doar evita restartul facand o comanda /rac(respawn all cars), asta daca nu o ai deja. Daca nu ai o comanda in genul, lasa un reply  si te ajut eu sa faci una.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.