[Include] [INC] Bzucoґs interior script - Add easily shops/pubs etc.
#30

Buzco, i have seen a lot of your previous scripts. Your work is wasting of hardware.
Original code:

pawn Код:
forward IsInThisInteriorPickup(id);
public IsInThisInteriorPickup(id)
{
  new value;
  for(new shopid;shopid<MAX_SHOP;shopid++)
  {
    if(shopdata[shopid][used]==1)
    {
       if(shopdata[shopid][shoptype]==id)
       {
         value = 1;
       }
    }
  }
  return value;
}

forward OnPlayerEnterShop(playerid);
public OnPlayerEnterShop(playerid)
{
  for(new shopid;shopid<MAX_SHOP;shopid++)
  {
    if(shopdata[shopid][used] == 1)
    {
       if (PlayerToPointBint(3.0, playerid,shopdata[shopid][enterX],shopdata[shopid][enterY],shopdata[shopid][enterZ]))
       {
         SetPlayerInterior(playerid,shopdata[shopid][interior]);
         SetPlayerPos(playerid,shopdata[shopid][exitX],shopdata[shopid][exitY],shopdata[shopid][exitZ]);
         SetPlayerVirtualWorld(playerid,shopid+1);
       }
    }
  }
  return 1;
}
My edit:

pawn Код:
IsInThisInteriorPickup(id)
{
  for(new shopid; shopid < MAX_SHOP; shopid++)
  {
    if(shopdata[shopid][used] == 1 && shopdata[shopid][shoptype] == id) return 1;
  }
  return 0;
}

OnPlayerEnterShop(playerid)
{
  for(new shopid; shopid < MAX_SHOP; shopid++)
  {
    if(shopdata[shopid][used] == 1 && PlayerToPointBint(3.0, playerid,shopdata[shopid][enterX],shopdata[shopid][enterY],shopdata[shopid][enterZ]))
    {
       SetPlayerInterior(playerid,shopdata[shopid][interior]);
       SetPlayerPos(playerid,shopdata[shopid][exitX],shopdata[shopid][exitY],shopdata[shopid][exitZ]);
       SetPlayerVirtualWorld(playerid,shopid+1);
       break;
    }
  }
}
Your code is uselessly complicated. Use less arrays, use "public" only when it is needed and use "break".

EDIT: This include doesn't require any "public" function.
Reply


Messages In This Thread
[INC] Bzucoґs interior script - Add easily shops/pubs etc. - by bzuco - 17.02.2008, 05:59
Re: [INC] Bzucoґs interior script - Add easily shops/pubs etc. - by luxeon - 17.02.2008, 06:34
Re: [INC] Bzucoґs interior script - Add easily shops/pubs etc. - by [FSR]R3t4Rd - 17.02.2008, 06:42
Re: [INC] Bzucoґs interior script - Add easily shops/pubs etc. - by SirSimon - 17.02.2008, 07:13
Re: [INC] Bzucoґs interior script - Add easily shops/pubs etc. - by bzuco - 17.02.2008, 07:15
Re: [INC] Bzucoґs interior script - Add easily shops/pubs etc. - by SirSimon - 17.02.2008, 07:16
Re: [INC] Bzucoґs interior script - Add easily shops/pubs etc. - by bzuco - 17.02.2008, 07:35
Re: [INC] Bzucoґs interior script - Add easily shops/pubs etc. - by SirSimon - 17.02.2008, 07:40
Re: [INC] Bzucoґs interior script - Add easily shops/pubs etc. - by VenZen - 17.02.2008, 07:44
Re: [INC] Bzucoґs interior script - Add easily shops/pubs etc. - by cvanderburgt - 17.02.2008, 07:45
Re: [INC] Bzucoґs interior script - Add easily shops/pubs etc. - by bzuco - 17.02.2008, 07:55
Re: [INC] Bzucoґs interior script - Add easily shops/pubs etc. - by SirSimon - 17.02.2008, 08:14
Re: [INC] Bzucoґs interior script - Add easily shops/pubs etc. - by robanswe - 17.02.2008, 08:22
Re: [INC] Bzucoґs interior script - Add easily shops/pubs etc. - by FujiNNN - 17.02.2008, 08:25
Re: [INC] Bzucoґs interior script - Add easily shops/pubs etc. - by Dark_Kostas - 17.02.2008, 08:46
Re: [INC] Bzucoґs interior script - Add easily shops/pubs etc. - by robanswe - 17.02.2008, 08:48
Re: [INC] Bzucoґs interior script - Add easily shops/pubs etc. - by El0vric - 17.02.2008, 08:52
Re: [INC] Bzucoґs interior script - Add easily shops/pubs etc. - by Djrasim - 17.02.2008, 08:55
Re: [INC] Bzucoґs interior script - Add easily shops/pubs etc. - by bzuco - 17.02.2008, 08:58
Re: [INC] Bzucoґs interior script - Add easily shops/pubs etc. - by Dark_Kostas - 17.02.2008, 08:59
Re: [INC] Bzucoґs interior script - Add easily shops/pubs etc. - by domidom - 17.02.2008, 09:39
Re: [INC] Bzucoґs interior script - Add easily shops/pubs etc. - by bzuco - 17.02.2008, 09:51
Re: [INC] Bzucoґs interior script - Add easily shops/pubs etc. - by Dark_Kostas - 17.02.2008, 10:19
Re: [INC] Bzucoґs interior script - Add easily shops/pubs etc. - by Homerman - 17.02.2008, 10:52
Re: [INC] Bzucoґs interior script - Add easily shops/pubs etc. - by bzuco - 17.02.2008, 11:33
Re: [INC] Bzucoґs interior script - Add easily shops/pubs etc. - by snipe69 - 17.02.2008, 13:17
Re: [INC] Bzucoґs interior script - Add easily shops/pubs etc. - by s4kura0152 - 24.03.2008, 14:29
Re: [INC] Bzucoґs interior script - Add easily shops/pubs etc. - by sebihunter - 24.03.2008, 14:36
Re: [INC] Bzucoґs interior script - Add easily shops/pubs etc. - by P1nd3r - 24.03.2008, 14:40
Re: [INC] Bzucoґs interior script - Add easily shops/pubs etc. - by Magor - 24.03.2008, 17:37
Re: [INC] Bzucoґs interior script - Add easily shops/pubs etc. - by Bzzzz - 20.05.2009, 08:15
Re: [INC] Bzucoґs interior script - Add easily shops/pubs etc. - by Abernethy - 20.05.2009, 08:38
Re: [INC] Bzucoґs interior script - Add easily shops/pubs etc. - by Paolo Saldivar - 20.05.2009, 20:56
Re: [INC] Bzucoґs interior script - Add easily shops/pubs etc. - by Klutty - 20.05.2009, 21:13

Forum Jump:


Users browsing this thread: 4 Guest(s)