SA-MP Forums Archive
FilterScript problem ! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: FilterScript problem ! (/showthread.php?tid=137103)



FilterScript problem ! - Kirchhoff - 27.03.2010

This is my pawno code :
Код:
#include <a_samp>
new gate;
new lpgate;
new Johan;
new Tinky;
new Kirchhoff;

#define COLOR_YELLOW 0xFFFF00AA
public OnFilterScriptInit ()
{
  gate = CreateObject(986,2560.146,-2227.251,13.071,0.0,0.0,90.000);
  lpgate = CreateObject(975,1548.571,-1627.423,14.058,0.0,0.0,90.000);
  Johan = CreateObject(980,1245.414,-766.755,93.899,0.0,0.0,0.0);
  Tinky = CreateObject(986,263.578,-1333.148,54.028,0.0,-0.859,-327.109);
  Kirchhoff = CreateObject(986,283.645,-1319.531,54.603,0.0,0.859,212.891);
  return 1;
}

public OnPlayerCommandText (playerid, cmdtext[])
{
  if (strcmp(cmdtext, "/vipopen", true) == 0)
  {
    MoveObject(gate, 2560.146,-2235.245,13.071,3);
    SendClientMessage(playerid, COLOR_YELLOW,"Welcome to V.I.P base.");
    return 1;
  }
  if (strcmp(cmdtext, "/vipclose", true) == 0)
  {
    MoveObject(gate, 2560.146,-2227.251,13.071,3);
    SendClientMessage(playerid, COLOR_YELLOW,"Come back later.");
    return 1;
  }
  if (strcmp(cmdtext, "/lspdopen", true) == 0)
  {
    MoveObject(lpgate, 1548.571,-1634.002,14.058,3);
    SendClientMessage(playerid, COLOR_YELLOW,"Welcome to LSPD!");
    return 1;
  }
  if (strcmp(cmdtext, "/lspdclose", true) == 0)
  {
    MoveObject(lpgate, 1548.571,-1627.423,14.058,3);
    SendClientMessage(playerid, COLOR_YELLOW,"Come back later.");
    return 1;
  }
  if (strcmp(cmdtext, "/johanopen", true) == 0)
  {
    MoveObject(Johan, 1256.216,-766.755,93.924,3);
    SendClientMessage(playerid, COLOR_YELLOW,"Welcome to your house.");
    return 1;
  }
  if (strcmp(cmdtext, "/johanclose", true) == 0)
  {
    MoveObject(Johan, 1245.414,-766.755,93.899,3);
    SendClientMessage(playerid, COLOR_YELLOW,"Come back later.");
    return 1;
  }
  if (strcmp(cmdtext, "/tinkyopen", true) == 0)
  {
    MoveObject(Tinky, 263.578,-1333.148,62.053,3);
    SendClientMessage(playerid, COLOR_YELLOW,"Welcome to your house.");
    return 1;
  }
  if (strcmp(cmdtext, "/tinkyclose", true) == 0)
  {
    MoveObject(Tinky, 263.578,-1333.148,54.028,3);
    SendClientMessage(playerid, COLOR_YELLOW,"Come back later.");
    return 1;
  }
  if (strcmp(cmdtext, "/kirchhoffopen", true) == 0)
  {
    MoveObject(Kirchhoff, 283.645,-1319.531,47.303,3);
    SendClientMessage(playerid, COLOR_YELLOW,"Welcome to your house.");
    return 1;
  }
  if (strcmp(cmdtext, "/kirchhoffclose", true) == 0)
  {
    MoveObject(Kirchhoff, 283.645,-1319.531,54.603,3);
    SendClientMessage(playerid, COLOR_YELLOW,"Come back later.");
    return 1;
  }
  
//Vip Base
CreateObject(987,2559.913,-2231.224,12.359,0.0,0.0,-90.000);
CreateObject(987,2559.894,-2238.664,12.339,0.0,0.0,-90.000);
CreateObject(987,2560.189,-2211.354,12.347,0.0,0.0,-90.000);
CreateObject(987,2588.908,-2204.126,12.547,0.0,0.0,90.000);
CreateObject(987,2588.889,-2193.328,12.547,0.0,0.0,90.000);
CreateObject(3606,2611.299,-2244.970,15.951,0.0,0.0,-180.000);
CreateObject(3606,2591.026,-2245.103,15.951,0.0,0.0,180.000);
CreateObject(3606,2571.486,-2245.036,15.951,0.0,0.0,180.000);
CreateObject(3606,2610.968,-2188.148,15.951,0.0,0.0,0.0);
CreateObject(3606,2627.957,-2226.515,15.746,0.0,0.0,-90.000);

//LSPD Base
CreateObject(1411,1548.751,-1620.444,14.156,0.0,0.0,-90.000);
CreateObject(1411,1548.879,-1634.387,13.992,0.0,0.0,-90.000);

//Johan Base
CreateObject(988,1254.784,-767.485,91.951,0.0,0.0,-180.000);
CreateObject(988,1260.281,-767.469,91.930,0.0,0.0,-180.000);
CreateObject(988,1265.703,-767.477,91.892,0.0,0.0,-180.000);
CreateObject(988,1271.071,-767.523,91.889,0.0,0.0,-180.000);
CreateObject(988,1276.505,-767.537,91.884,0.0,0.0,-180.000);
CreateObject(988,1281.982,-767.526,91.883,0.0,0.0,-180.000);
CreateObject(988,1287.388,-767.638,91.886,0.0,0.0,-180.000);
CreateObject(989,1307.800,-799.579,84.711,0.0,0.0,22.500);
CreateObject(989,1306.138,-794.523,84.715,0.0,0.0,45.000);
CreateObject(992,1306.061,-802.312,84.533,0.0,0.0,180.000);

return 0;
}
This is the error :
Код:
D:\Gta san andreas\GTA San Andreas\server\filterscripts\MovingGatesBase.pwn(83) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
Line 83 is :
Код:
CreateObject(987,2559.913,-2231.224,12.359,0.0,0.0,-90.000);
Can you tell me what the mistake is ?


Re: FilterScript problem ! - Kirchhoff - 27.03.2010

I did but still the same problem !


Re: FilterScript problem ! - Kirchhoff - 27.03.2010

?


Re: FilterScript problem ! - Kirchhoff - 27.03.2010

Ty i solved this , but can you tell me what's the semnification of #pragma tabsize 0 ?


Re: FilterScript problem ! - Kirchhoff - 27.03.2010

Oh tks a lot solved . You can close topic !


Re: FilterScript problem ! - Kirchhoff - 28.03.2010

Problem again : I puted armor pickup and health pick and this is the eror it gives me :

FS :
Код:
#include <a_samp>
#pragma tabsize 0
new gate;
new lpgate;
new Speedy;
new Tinky;
new Kirchhoff;

#define COLOR_YELLOW 0xFFFF00AA
public OnFilterScriptInit ()
{
  gate = CreateObject(986,2560.146,-2227.251,13.071,0.0,0.0,90.000);
  lpgate = CreateObject(975,1548.571,-1627.423,14.058,0.0,0.0,90.000);
  Speedy = CreateObject(980,1245.414,-766.755,93.899,0.0,0.0,0.0);
  Tinky = CreateObject(986,263.578,-1333.148,54.028,0.0,-0.859,-327.109);
  Kirchhoff = CreateObject(986,283.645,-1319.531,54.603,0.0,0.859,212.891);
  return 1;
}

public OnPlayerCommandText (playerid, cmdtext[])
{
  if (strcmp(cmdtext, "/vipopen", true) == 0)
  {
    MoveObject(gate, 2560.146,-2235.245,13.071,3);
    SendClientMessage(playerid, COLOR_YELLOW,"Welcome to V.I.P base.");
    return 1;
  }
  if (strcmp(cmdtext, "/vipclose", true) == 0)
  {
    MoveObject(gate, 2560.146,-2227.251,13.071,3);
    SendClientMessage(playerid, COLOR_YELLOW,"Come back later.");
    return 1;
  }
  if (strcmp(cmdtext, "/lspdopen", true) == 0)
  {
    MoveObject(lpgate, 1548.571,-1634.002,14.058,3);
    SendClientMessage(playerid, COLOR_YELLOW,"Welcome to LSPD!");
    return 1;
  }
  if (strcmp(cmdtext, "/lspdclose", true) == 0)
  {
    MoveObject(lpgate, 1548.571,-1627.423,14.058,3);
    SendClientMessage(playerid, COLOR_YELLOW,"Come back later.");
    return 1;
  }
  if (strcmp(cmdtext, "/speedyopen", true) == 0)
  {
    MoveObject(Speedy, 1256.216,-766.755,93.924,3);
    SendClientMessage(playerid, COLOR_YELLOW,"Welcome to your house.");
    return 1;
  }
  if (strcmp(cmdtext, "/speedyclose", true) == 0)
  {
    MoveObject(Speedy, 1245.414,-766.755,93.899,3);
    SendClientMessage(playerid, COLOR_YELLOW,"Come back later.");
    return 1;
  }
  if (strcmp(cmdtext, "/tinkyopen", true) == 0)
  {
    MoveObject(Tinky, 263.578,-1333.148,62.053,3);
    SendClientMessage(playerid, COLOR_YELLOW,"Welcome to your house.");
    return 1;
  }
  if (strcmp(cmdtext, "/tinkyclose", true) == 0)
  {
    MoveObject(Tinky, 263.578,-1333.148,54.028,3);
    SendClientMessage(playerid, COLOR_YELLOW,"Come back later.");
    return 1;
  }
  if (strcmp(cmdtext, "/kirchhoffopen", true) == 0)
  {
    MoveObject(Kirchhoff, 283.645,-1319.531,47.303,3);
    SendClientMessage(playerid, COLOR_YELLOW,"Welcome to your house.");
    return 1;
  }
  if (strcmp(cmdtext, "/kirchhoffclose", true) == 0)
  {
    MoveObject(Kirchhoff, 283.645,-1319.531,54.603,3);
    SendClientMessage(playerid, COLOR_YELLOW,"Come back later.");
    return 1;
  }
  
//Vip Base
  CreateObject(987,2559.913,-2231.224,12.359,0.0,0.0,-90.000);
CreateObject(987,2559.894,-2238.664,12.339,0.0,0.0,-90.000);
CreateObject(987,2560.189,-2211.354,12.347,0.0,0.0,-90.000);
CreateObject(987,2588.908,-2204.126,12.547,0.0,0.0,90.000);
CreateObject(987,2588.889,-2193.328,12.547,0.0,0.0,90.000);
CreateObject(3606,2611.299,-2244.970,15.951,0.0,0.0,-180.000);
CreateObject(3606,2591.026,-2245.103,15.951,0.0,0.0,180.000);
CreateObject(3606,2571.486,-2245.036,15.951,0.0,0.0,180.000);
CreateObject(3606,2610.968,-2188.148,15.951,0.0,0.0,0.0);
CreateObject(3606,2627.957,-2226.515,15.746,0.0,0.0,-90.000);

//LSPD Base
CreateObject(1411,1548.751,-1620.444,14.156,0.0,0.0,-90.000);
CreateObject(1411,1548.879,-1634.387,13.992,0.0,0.0,-90.000);

//Speedy Base
CreateObject(988,1254.784,-767.485,91.951,0.0,0.0,-180.000);
CreateObject(988,1260.281,-767.469,91.930,0.0,0.0,-180.000);
CreateObject(988,1265.703,-767.477,91.892,0.0,0.0,-180.000);
CreateObject(988,1271.071,-767.523,91.889,0.0,0.0,-180.000);
CreateObject(988,1276.505,-767.537,91.884,0.0,0.0,-180.000);
CreateObject(988,1281.982,-767.526,91.883,0.0,0.0,-180.000);
CreateObject(988,1287.388,-767.638,91.886,0.0,0.0,-180.000);
CreateObject(989,1307.800,-799.579,84.711,0.0,0.0,22.500);
CreateObject(989,1306.138,-794.523,84.715,0.0,0.0,45.000);
CreateObject(992,1306.061,-802.312,84.533,0.0,0.0,180.000);

{

  AddStaticPickup(1242, 2, 231.7073, 160.7892, 1003.0234, 0);
  AddStaticPickup(1240, 2, 229.7282, 161.1591, 1003.0234, 0);
  return 1;
}

  return 0;
}
Error :
Код:
D:\Gta san andreas\GTA San Andreas\server\filterscripts\MovingGatesBase.pwn(118) : warning 225: unreachable code
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
Line 118 is :
Код:
  return 0;
I want to solve this because it screws my server ! .


Re: FilterScript problem ! - Hot - 28.03.2010

Don't create your Objects at OnPlayerCommandText, create them at OnGameModeInit/OnFilterScriptInit.


Re: FilterScript problem ! - Kirchhoff - 28.03.2010

Lol i didn't created them there. This is an FilterScript ! It is OnFilterScriptInIt

Nvm i solved it !


Re: FilterScript problem ! - Kirchhoff - 28.03.2010

Can someone include me on this FS an AddStatickPickup (that j) in the city hall so when someone enters the city hall and goes on that "yellow j" ti appears the message : Tipe /buylicense

These are the x,y,z of the pickup :
Код:
AddPlayerClass(277,246.4457,117.3282,1003.2188,1.7712,0,0,0,0,0,0); // pickupcitiyhall
This is the Filter Script :
Код:
#include <a_samp>
#pragma tabsize 0
new gate;
new lpgate;
new Speedy;
new Tinky;
new Kirchhoff;

#define COLOR_YELLOW 0xFFFF00AA
public OnFilterScriptInit ()
{
  gate = CreateObject(986,2560.146,-2227.251,13.071,0.0,0.0,90.000);
  lpgate = CreateObject(975,1548.571,-1627.423,14.058,0.0,0.0,90.000);
  Speedy = CreateObject(980,1245.414,-766.755,93.899,0.0,0.0,0.0);
  Tinky = CreateObject(986,263.578,-1333.148,54.028,0.0,-0.859,-327.109);
  Kirchhoff = CreateObject(986,283.645,-1319.531,54.603,0.0,0.859,212.891);
  return 1;
}

public OnPlayerCommandText (playerid, cmdtext[])
{
  if (strcmp(cmdtext, "/vipopen", true) == 0)
  {
    MoveObject(gate, 2560.146,-2235.245,13.071,3);
    SendClientMessage(playerid, COLOR_YELLOW,"Welcome to V.I.P base.");
    return 1;
  }
  if (strcmp(cmdtext, "/vipclose", true) == 0)
  {
    MoveObject(gate, 2560.146,-2227.251,13.071,3);
    SendClientMessage(playerid, COLOR_YELLOW,"Come back later.");
    return 1;
  }
  if (strcmp(cmdtext, "/lspdopen", true) == 0)
  {
    MoveObject(lpgate, 1548.571,-1634.002,14.058,3);
    SendClientMessage(playerid, COLOR_YELLOW,"Welcome to LSPD!");
    return 1;
  }
  if (strcmp(cmdtext, "/lspdclose", true) == 0)
  {
    MoveObject(lpgate, 1548.571,-1627.423,14.058,3);
    SendClientMessage(playerid, COLOR_YELLOW,"Come back later.");
    return 1;
  }
  if (strcmp(cmdtext, "/speedyopen", true) == 0)
  {
    MoveObject(Speedy, 1256.216,-766.755,93.924,3);
    SendClientMessage(playerid, COLOR_YELLOW,"Welcome to your house.");
    return 1;
  }
  if (strcmp(cmdtext, "/speedyclose", true) == 0)
  {
    MoveObject(Speedy, 1245.414,-766.755,93.899,3);
    SendClientMessage(playerid, COLOR_YELLOW,"Come back later.");
    return 1;
  }
  if (strcmp(cmdtext, "/tinkyopen", true) == 0)
  {
    MoveObject(Tinky, 263.578,-1333.148,62.053,3);
    SendClientMessage(playerid, COLOR_YELLOW,"Welcome to your house.");
    return 1;
  }
  if (strcmp(cmdtext, "/tinkyclose", true) == 0)
  {
    MoveObject(Tinky, 263.578,-1333.148,54.028,3);
    SendClientMessage(playerid, COLOR_YELLOW,"Come back later.");
    return 1;
  }
  if (strcmp(cmdtext, "/kirchhoffopen", true) == 0)
  {
    MoveObject(Kirchhoff, 283.645,-1319.531,47.303,3);
    SendClientMessage(playerid, COLOR_YELLOW,"Welcome to your house.");
    return 1;
  }
  if (strcmp(cmdtext, "/kirchhoffclose", true) == 0)
  {
    MoveObject(Kirchhoff, 283.645,-1319.531,54.603,3);
    SendClientMessage(playerid, COLOR_YELLOW,"Come back later.");
    return 1;
  }
  
//Vip Base
  CreateObject(987,2559.913,-2231.224,12.359,0.0,0.0,-90.000);
CreateObject(987,2559.894,-2238.664,12.339,0.0,0.0,-90.000);
CreateObject(987,2560.189,-2211.354,12.347,0.0,0.0,-90.000);
CreateObject(987,2588.908,-2204.126,12.547,0.0,0.0,90.000);
CreateObject(987,2588.889,-2193.328,12.547,0.0,0.0,90.000);
CreateObject(3606,2611.299,-2244.970,15.951,0.0,0.0,-180.000);
CreateObject(3606,2591.026,-2245.103,15.951,0.0,0.0,180.000);
CreateObject(3606,2571.486,-2245.036,15.951,0.0,0.0,180.000);
CreateObject(3606,2610.968,-2188.148,15.951,0.0,0.0,0.0);
CreateObject(3606,2627.957,-2226.515,15.746,0.0,0.0,-90.000);

//LSPD Base
CreateObject(1411,1548.751,-1620.444,14.156,0.0,0.0,-90.000);
CreateObject(1411,1548.879,-1634.387,13.992,0.0,0.0,-90.000);

//Speedy Base
CreateObject(988,1254.784,-767.485,91.951,0.0,0.0,-180.000);
CreateObject(988,1260.281,-767.469,91.930,0.0,0.0,-180.000);
CreateObject(988,1265.703,-767.477,91.892,0.0,0.0,-180.000);
CreateObject(988,1271.071,-767.523,91.889,0.0,0.0,-180.000);
CreateObject(988,1276.505,-767.537,91.884,0.0,0.0,-180.000);
CreateObject(988,1281.982,-767.526,91.883,0.0,0.0,-180.000);
CreateObject(988,1287.388,-767.638,91.886,0.0,0.0,-180.000);
CreateObject(989,1307.800,-799.579,84.711,0.0,0.0,22.500);
CreateObject(989,1306.138,-794.523,84.715,0.0,0.0,45.000);
CreateObject(992,1306.061,-802.312,84.533,0.0,0.0,180.000);

//Health + Armor pickup LSPD
CreatePickup(1242, 2, 231.7073, 160.7892, 1003.0234, -1);
CreatePickup(1240, 2, 229.7282, 161.1591, 1003.0234, -1);
return 0;
}



Re: FilterScript problem ! - Kirchhoff - 28.03.2010

Nvm i solved !