Quote:
Originally Posted by CodeStyle175
wtf is that PlayerInfo[playerid][LoggedIn] ?
so much useless code
if(PlayerInfo[playerid][bOwned] == 0) {
and what is this doing even?
GetPlayerMoney
you dont use samp default function for buying business omg what aare you donig?
PHP код:
PlayerBizCnt(p){
new cnt;
foreach(fBizes,i){
if(BizInfo[i][Owner]==PlayerInfo[p][pSQLid])cnt++;
}
return cnt;
}
CMD:buybiz(pid,params[]) {
if(PlayerBizCnt(pid)>=1)return scm(pid,-1,"You already own business!");
new i = GetBizID(pid);
if(i==-1 || BizInfo[i][Owner]!=0)return scm(pid,-1,"You can't buy this business!");
if(PlayerInfo[pid][pCash] < BizInfo[i][Price])return scm(pid,-1,"You don't have enough money!");
BizInfo[i][bOwner]=PlayerInfo[pid][pSQLid];
PlayerInfo[pid][pCash]-=BizInfo[i][Price];
//saving sql
new s[120];
format(s,120,"update bussines set owner='%d' where bID='%d'",BizInfo[i][Owner],BizInfo[i][bID]);
mysql_tquery(mysql,s);
//message for player
format(s,120,"You just bought this Business (%s) for $%d. Your Business will earn you $%d/hr", BizInfo[i][Name], BizInfo[i][Price],BizInfo[i][Profit]);
scm(pid,-1,s);
return 1;
}
|
Perhaps if u would have read his code better u might have seen Its not so useless. He has some things there he need for certain things, and Yeah you are Just being a little shit again. Forgive me if Im wrong But Your absolutely not Here to help people and if u were, your not doing quite a good job. There is no reason for you to be such a prick on this forums so if u have some issues with Yourself Dont intoxicate this forums with it