SA-MP Forums Archive
[++REP] Problem with command! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [++REP] Problem with command! (/showthread.php?tid=590708)



[++REP] Problem with command! - norton2 - 03.10.2015

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;
}



Re: [++REP] Problem with command! - Thomaske - 03.10.2015

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.


Re: [++REP] Problem with command! - faff - 03.10.2015

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


Re: [++REP] Problem with command! - norton2 - 03.10.2015

Thank you Thomaske.