Jump to content
Autentificarea cu Google și Facebook nu mai este disponibilă. ×
  • 0

[Ajutor] Am o eroare la comanda [/vcreate]


Question

Posted
CMD:vcreate(playerid, params[])
{
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to log in first.");
    if(PlayerInfo[playerid][pAdmin] >= 5)
    {
        new id,model,string[128],giveplayer[30],total;
        if(sscanf(params, "ui", id, model)) return SCM(playerid, COLOR_GREY, "Syntax:{FFFFFF} /vcreate [playerid] [model]");
        if(model < 400 || model > 611) return SCM(playerid, COLOR_GREY, "Invalid car ID! (400-611)");
        if(IsPlayerConnected(id))
        {
            if(id != INVALID_PLAYER_ID)
            {
                for(new v; v < MAX_PERSONAL_CARS; v++)
            {
                if(PlayerInfo[playerid][pCar][v] != -1) total++;
             }
                if(total+1 > PlayerInfo[id][pCarSlots])
                {
                    SendClientMessage(playerid, COLOR_GREY, "This player have all vehicles slots full.");
                    return 1;
                }
                GetPlayerName(id, giveplayer, sizeof(giveplayer));
                CreateVEH[playerid] = model;
                CreateVEHID[playerid] = id;
                format(string, sizeof(string), "Esti sigur ca vrei sa-i dai lui %s masina %s?\n\nAbuzul de aceasta comanda poate duce la scoaterea ta din staff!", giveplayer, aVehicleNames[model - 400]);
                ShowPlayerDialog(playerid, DIALOG_VCREATE, DIALOG_STYLE_MSGBOX, "Personal Vehicle Create", string, "Da", "Nu");
            }
        }
        else return SendClientMessage(playerid, COLOR_GREY, "Player not connected.");
    }
    else return SendClientMessage(playerid, COLOR_LIGHTGREEN3, AdminOnly);
    return 1;

Am adaugat aceasta comanda (copy-paste) , am adaugat toate variabilele si imi da eroarea [ error 001: expected token: ")", but found "{"  ] si nu inteleg ce este gresit [ if(PlayerInfo[playerid][pCar][v] != -1) total++; ] asta  este linia din care imi da eroare.

 

Multumesc!

 

7 answers to this question

Recommended Posts

  • 0
Posted
if(PlayerInfo[playerid][pCar][v] != -1, total++);

incearca asa.

  • Like 1

                     

  Serverul meu de Discord: Click aici       a7DfKP7.gif                                                                      FGIfknL.gif

k35T5Nb.png                                                                                                                                                                                                                                                                                                I0aS856.gif

  • 0
Posted
Acum 2 ore, s4uriK.Official a spus:

if(PlayerInfo[playerid][pCar][v] != -1, total++);

incearca asa.

Alta perla mai buna decat asta nu ai putut scoate? Se vede ca scriptezi in lemn

 

Ai "pCar" cu array?

  • Haha 1
  • 0
Posted
Acum 7 ore, iSkull a spus:

Alta perla mai buna decat asta nu ai putut scoate? Se vede ca scriptezi in lemn

 

Ai "pCar" cu array?

:))))

                     

  Serverul meu de Discord: Click aici       a7DfKP7.gif                                                                      FGIfknL.gif

k35T5Nb.png                                                                                                                                                                                                                                                                                                I0aS856.gif

  • 0
Posted
14 hours ago, s4uriK.Official said:

if(PlayerInfo[playerid][pCar][v] != -1, total++);

incearca asa.

Imi da acceasi eroare , chiar nu imi pot da seama de ce nu merge  , am facut tot ce ma dus capul

  • 0
Posted

Nu stiu daca are legatura cu comanda ( probabil nu ai copiat tu corect ) Lipseste un "}" dupa return 1;

  • 0
Posted

Cum il ai definit tu pe pCar... daca este doar pCar trebuie facut array.. Uita-te in gm dupa pCar vezi cum mai e structurat

 

v - reprezinta nr maxim de personale

iar la tine trebuie sa vina pCar[v] iar la definire o sa pui pCar[MAX_personal... bla bla]

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.