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