Problem with this CMD
#1

pawn Код:
CMD:buydealer(playerid)
{
    new plname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, plname, sizeof(plname));
    new string[128];
    for(new b = 0; b < MAX_CARDEALERSHIPS; b++) if(IsPlayerInRangeOfPoint(playerid, 2.0, CarDealer[b][pVehicleSpawnX], CarDealer[b][pVehicleSpawnY], CarDealer[b][pVehicleSpawnZ]))
     {
        if(PlayerInfo[playerid][pDealerKey] == -1)
        {
        CarDealer[b][pOwner] = plname;
        format(string, sizeof(string), "You have just purchased a Dealership! (ID: %d)", b);
        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
        format(string, sizeof(string), "{4BB325}Vehicle Dealership\n{C4C920}[Owner: %s]\n[ID: %d]", plname, b);
        UpdateDynamic3DTextLabelText(CarDealer[b][pLabel], COLOR_WHITE, string);
        PlayerInfo[playerid][pDealerKey] = b;
        }
        else SendClientMessage(playerid, COLOR_GRAD2, "You already own a Dealership!");
    }
    else SendClientMessage(playerid, COLOR_GRAD1, "You are not at a dealership purchase point!");
    return 1;
}
I have this, but whenever I do the CMD it will say I have purchased the dealership but then it will spam me with 'You are not at a dealership point'

It spams me that message 10 times since the max dealerships is 10

So, any idea ;/
Reply
#2

use cases.
Reply
#3

Mind explaining how I would do something like this in cases..?
Reply
#4

Anyone?
Reply
#5

did u save them as idx++ or b++ ?!!!!!!!!!!!!!!!!!!
Reply
#6

Haven't added saving yet, I just create it IG then do /buydealer straight after, I add saving once I know other CMD's work
Reply
#7

That'll be why you're trying to check if the player is in point of range, of something that's not saved.
Reply
#8

Quote:
Originally Posted by Lido
Посмотреть сообщение
That'll be why you're trying to check if the player is in point of range, of something that's not saved.
Alright, thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)