02.02.2011, 08:00
Dunno, try adding a variable to check if the business is owned or not, like:
and if it works, it's something wrong with strmatch, however your code seems good, I can't find anything wrong with it.
Edit: The checkpoint thing is weird.
Edit again:
pawn Код:
if(Business[i][bOwned] == 1)
{
//blablabla
}
else if(Business[i][bOwned] == 0)
{
//blablabla
}
Edit: The checkpoint thing is weird.
Edit again:
pawn Код:
command(createbusiness,playerid, params[])
{
if(GetPlayerAdmin(playerid) < 5) return 0;
{
new level;
if(sscanf(params, "i", level)) return SendClientMessage(playerid, COLOR_YELLOW, "Usage: /createbusiness Level(1-7)");
else
{
new string[200], Float:POS[3];
GetPlayerPos(playerid, POS[0], POS[1], POS[2]);
format(string, sizeof(string), "INSERT INTO `businesses` (`Id`, `bOwner`, `bLevel`, `bX`, `bY`, `bZ`) VALUES (NULL, 'None', '%d', '%f', '%f', '%f');",level, POS[0], POS[1], POS[2]);
mysql_query(string);
CreateDynamicMapIcon(POS[0], POS[1], POS[2], 31, 0, -1, -1, -1, 200);
LoadBusiness(); //I don't think re-loading all business again is good.Make a stock function like AddBiz and add the new variables to the biz
}
}
return 1;
}