[++REP] Problem with command!
#1

Hi, I have a problem with /v. Sometimes it works, sometimes I say, "You not have a vehicles.".

Код HTML:
CMD:v(playerid, params [])
{
    new bool:found = false, msg[356], lst[19];
    msg = "Name\tStatus\tPlate";
    for(new i = 1, j = GetVehiclePoolSize(); i <= j; i++)
    {
        if(Veh[i][Owner] == pInfo[playerid][pID])
        {
            found = true;
            if(Veh[i][Lock] == 0) { lst = "{00BA19}Unlocked"; }
            else if(Veh[i][Lock] == 1) { lst = "{BD0000}Locked"; }
            format(msg, sizeof(msg), "%s\n%s\t%s\t%s", msg, g_VehicleNames[GetVehicleModel(Veh[i][ServerID])-400], lst, Veh[i][Plate]);
        }
    }
    if(found) { ShowPlayerDialog(playerid, DIALOG_V, DIALOG_STYLE_TABLIST_HEADERS, "My Vehicles", msg, "Select", "Cancel"); }
    else { SendClientMessage(playerid, COLOR_DARKGRAY, "You not have a vehicles."); }
    return 1;
}
Reply
#2

you need to checkout if this line is getting his values correct:

if(Veh[i][Owner] == pInfo[playerid][pID])

if the 2 numbers are not the same you get the message "You not have a vehicles."

So in the first place you need to debugg that.

second one is that the found fails his value, but i don't think thats the problem.
Reply
#3

I hope you ain't writing a gamemode using those grammar skills.
Reply
#4

Thank you Thomaske.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)