Jump to content

Question

Posted

CMD:checkv(playerid, params[])
{
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to log in first.");
    if(PlayerInfo[playerid][pAdmin] < 1) return SCM(playerid, COLOR_LIGHTGREEN3, AdminOnly);
    new id,string[256],count;
    if(sscanf(params, "u",id)) return SendClientMessage(playerid, COLOR_GREY, "Syntax:{FFFFFF} /checkv [name/playerid]");
    if(IsPlayerConnected(id))
    {
        for(new v; v < MAX_PERSONAL_VEHICLES; v++)
        {
            if(PlayerInfo[id][cID][v] != 0)
            {
                format(string,sizeof(string),"[ID:%d] %s | age: %d | km: %.0f | colors: %d, %d",PlayerInfo[id][pCarID][v],aVehicleNames[PlayerInfo[id][pCarModel][v] - 400],GetDaysFromTimestamp(PlayerInfo[id][pCarBuyTime][v]),PlayerInfo[id][pCarKM][v],PlayerInfo[id][pCarColor1][v],PlayerInfo[id][pCarColor2][v]);
                SendClientMessage(playerid, COLOR_LIGHTGREEN3, string);
                count++;
            }
        }
        if(count == 0) return SendClientMessage(playerid, COLOR_WHITE, "This player don't have a vehicle spawned.");
    }
    return 1;
}

Urmatoarele Erori
(24438) : error 029: invalid expression, assumed zero

(24440) : warning 213: tag mismatch

(24440) : error 001: expected token: ")", but found "["

(24440) : error 029: invalid expression, assumed zero

(24440) : warning 215: expression has no effect

(24440) : error 001: expected token: ";", but found "]"
Linia 24440: if(PlayerInfo[id][cID][v] != 0)
Linia 24438:for(new v; v < MAX_PERSONAL_VEHICLES; v++)

5 answers to this question

Recommended Posts

  • 0
Posted (edited)
CMD:checkv(playerid, params[])
{
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to log in first.");
    if(PlayerInfo[playerid][pAdmin] < 1) return SCM(playerid, COLOR_LIGHTGREEN3, AdminOnly);
    new id,string[256],count;
    if(sscanf(params, "u",id)) return SendClientMessage(playerid, COLOR_GREY, "Syntax:{FFFFFF} /checkv [name/playerid]");
    if(IsPlayerConnected(id))
    {
        for(new v;v<MAX_PERSONAL_VEHICLES;v++)
        {
            if(PlayerInfo[id][cID][v]!= 0)
            {
                format(string,sizeof(string),"[ID:%d] %s | age: %d | km: %.0f | colors: %d, %d",PlayerInfo[id][pCarID][v],aVehicleNames[PlayerInfo[id][pCarModel][v] - 400],GetDaysFromTimestamp(PlayerInfo[id][pCarBuyTime][v]),PlayerInfo[id][pCarKM][v],PlayerInfo[id][pCarColor1][v],PlayerInfo[id][pCarColor2][v]);
                SendClientMessage(playerid, COLOR_LIGHTGREEN3, string);
                count++;
            }
        }
        if(count == 0) return SendClientMessage(playerid, COLOR_WHITE, "This player don't have a vehicle spawned.");
    }
    return 1;
}

 

Edited by AndreiAdv
  • 0
Posted (edited)

Salut!

Nu inteleg o chestie si anume:

 

if(PlayerInfo[id][cID][v]!= 0)

De ce ai pus si cID si v cand ambele in teorie fac acelasi lucru?

Poti incerca sa vezi daca merge:

 

if(PlayerInfo[id][v] != 0)

Iar daca nu merge, foloseste == 0 (egal strict).

Edited by Джо

 

 

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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.