Houses problem
#1

somebody please tell me why is houseid is always "0" in the dynamic 3D text, when i create another checkpoint, it keeps 0.

pawn Код:
#define MAX_HOUSES 1000

enum hinfo
{
    hPrice,
    hInt,
    hVW,
    hID
}
new HouseInfo[MAX_HOUSES][hinfo];

CMD:ch(playerid, params[])
{
    new price, inti, vw, ID, houseid, string[128];
    new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid, x,y,z);
   
    if(sscanf(params, "iii", price, inti, vw)) return SendClientMessage(playerid, COLOR_WHITE, "/ch [price] [inti] [vw]");
    ID = HouseInfo[houseid][hID];
   
    CreateDynamicCP(x,y,z,1.0,-1,-1,-1,30.0);
    format(string, sizeof(string), "House ID: %i\nPrice: %i", ID, price);
    CreateDynamic3DTextLabel(string, COLOR_WHITE, x,y,z, 50.0);
    return 1;
}
Reply
#2

Becouse you didn't increment it
Reply
#3

I think you shall increase it each time you do so and if I found the right code for the ID, then it shall be something like

pawn Код:
HouseInfo[houseid][hID]++;
And add it after the
pawn Код:
ID = HouseInfo[houseid][hID]
That shall be the problem for my idea.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)