Loop or IsPlayerInRageOfPoint
#1

Hi guys!

I can't fix an issue.
IsPlayerInRageOfPoint is not working when I am trying to buy a biz, but IT IS WORKING when I try to Enter an owned biz

NO ERRORS OR WARNINGS IN MYSQLOG!

pawn Код:
CMD:buybiz(playerid, params[])
{
      for (new i = 0; i < MAX_BIZ; ++i)
        {
            if(IsPlayerInRangeOfPoint(playerid,3.0,BizInfo[i][EXTX],BizInfo[i][EXTY],BizInfo[i][EXTZ]))
            { // I put else and it says I am not near
When entering , it works like a charm

pawn Код:
if(Keys &  KEY_SECONDARY_ATTACK)
        {
            for (new i = 0; i < MAX_BIZ; ++i)
            {
                if(IsPlayerInRangeOfPoint(playerid,3.0,BizInfo[i][EXTX],BizInfo[i][EXTY],BizInfo[i][EXTZ]))
                {
Creating the biz . NOTE: Everything works with inserting in database. I translated these names to English.

pawn Код:
new ID = SpawnedBizess;
mysql_format(MySQLHandle, Query, sizeof(Query),"INSERT INTO  bizess ( OwnerName , Type , etc, etc , Price , EXTX , EXTY , EXTZ , Owned ) VALUES ('No-one',%d,50,0,%d,%f,%f,%f,0)",type,price,xa,ya,za);
                    mysql_tquery(MySQLHandle, Query, "OnBizCreate", "i", ID);
pawn Код:
forward OnBizCreate(bizid);
public OnBizCreate(bizid)
{
   
    BizInfo[idfirme][BizID] = cache_insert_id();
    SpawnedBizess++;
    printf("New Biz - ID: %d", BizInfo[idfirme][BizID]);
}
When loading...
pawn Код:
OnGameModeinit
{
    mysql_tquery(MySQLHandle, "SELECT * FROM bizess", "LoadBiz", "");
}

forward LoadBiz();
public LoadBiz()
{
        new Query[ 256 ];

        if(cache_num_rows())
        {
            for(new i, j = cache_num_rows(); i < j ; i++)
            {
BizInfo[i][BizID] = cache_get_field_content_int(i, "BizID");

                        cache_get_field_content(i,"OwnerName",BizInfo[i][OwnerName],MySQLHandle,25);

                        BizInfo[i][Type] = cache_get_field_content_int(i, "BizInfo");
// ...
// ...
SpawnedBizess++;
            }
        }
        return 1;
}
Reply
#2

Fixed, some silly returns :S
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)