SA-MP Forums Archive
Problem with this CMD - 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: Problem with this CMD (/showthread.php?tid=390062)



Problem with this CMD - mSlat3r - 04.11.2012

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


Re: Problem with this CMD - jotan. - 04.11.2012

use cases.


Re: Problem with this CMD - mSlat3r - 04.11.2012

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


Re: Problem with this CMD - mSlat3r - 05.11.2012

Anyone?


Re: Problem with this CMD - Glad2BeHere - 05.11.2012

did u save them as idx++ or b++ ?!!!!!!!!!!!!!!!!!!


Re: Problem with this CMD - mSlat3r - 05.11.2012

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


Re: Problem with this CMD - Smally - 05.11.2012

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


Re: Problem with this CMD - mSlat3r - 05.11.2012

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