SA-MP Forums Archive
id's - 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: id's (/showthread.php?tid=375602)



id's - thefatshizms - 07.09.2012

Hello, im creating a house system and i want to give each biz i make through a command an id so if i make a biz for the first time its id would be 0 or 1 then second one i make it would be 1 or 2 etc

This is what i got so far on the system
pawn Код:
// the command

CMD:cbiz(playerid, params[])
{
    if(PlayerInfo[playerid][Padmin] >=4)
    {
        new Float:X, Float:Y, Float:Z;
        new id = Bizcount;
        GetPlayerPos(playerid, X, Y, Z);
        new Query[300];
        format(Query, sizeof(Query), "INSERT INTO `biz` (`Xpos`, `Ypos`, `Zpos`, `Owner`, `Status`) VALUES ('%f', %f', '%f', 'None', 'Forsale')", X, Y, Z);
        mysql_query(Query);
        return 1;
    }
    return 1;
}

//enum

enum Biz
{
    Owner[MAX_PLAYER_NAME],
    Profit,
    Float:Xpos,
    Float:Ypos,
    Float:Zpos,
    Onsale,
    Sellp,
    Items,
    BizID,
    interior,
    Float:XIpos,
    Float:YIpos,
    Float:ZIpos,
    Status
}

#define MAX_BIZ 1000

new BizInfo[1000][Biz];