Jump to content
  • 0

checkv


adv1337

Question

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++)

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0
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
Link to comment
Share on other sites

  • 0

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 Джо

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • 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.