SA-MP Forums Archive
Moving Gates problem again ! - 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: Moving Gates problem again ! (/showthread.php?tid=135341)



Moving Gates problem again ! - Kirchhoff - 20.03.2010

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

#define COLOR_YELLOW 0xFFFF00AA
public OnFilterScriptInit ()
{
  gate = CreateObject(986,2560.146,-2227.251,13.071,0.0,0.0,90.000);
  return 1;
}

public OnPlayerCommandText (playerid, cmdtext[])
{
  if (strcmp(cmdtext, "/adminopen", true) == 0)
  {
    MoveObject(gate, 2560.146,-2235.245,13.071,3);
    SendClientMessage(playerid, COLOR_YELLOW,"Welcome to AdminBase !");
    return 1;
  }
  if (strcmp(cmdtext, "/adminclose2", true) == 0)
  {
    MoveObject(gate, 2560.146,-2227.251,13.071,3);
    SendClientMessage(playerid, COLOR_YELLOW,"GoodBye and come back to AdminBase base");
    return 1;
  }
OK , i made this but when i compile i get the following error !

Код:
D:\Gta san andreas\GTA San Andreas\server\pawno\new.pwn(25) : error 030: compound statement not closed at the end of file (started at line 13)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.



Re: Moving Gates problem again ! - MaykoX - 20.03.2010

Line ? 25 ??


Re: Moving Gates problem again ! - Kirchhoff - 20.03.2010

But how can i show you where is line 25 ?


Re: Moving Gates problem again ! - matthewdriftking - 20.03.2010

Quote:
Originally Posted by Kirchhoff
But how can i show you where is line 25 ?
line 25 is empty


Re: Moving Gates problem again ! - cozza123456 - 20.03.2010

Код:
#include <a_samp>
new gate;

#define COLOR_YELLOW 0xFFFF00AA
public OnFilterScriptInit ()
{
  gate = CreateObject(986,2560.146,-2227.251,13.071,0.0,0.0,90.000);
  return 1;
}

public OnPlayerCommandText (playerid, cmdtext[])
{
  if (strcmp(cmdtext, "/adminopen", true) == 0)
  {
    MoveObject(gate, 2560.146,-2235.245,13.071,3);
    SendClientMessage(playerid, COLOR_YELLOW,"Welcome to AdminBase !");
    return 1;
  }
  if (strcmp(cmdtext, "/adminclose2", true) == 0)
  {
    MoveObject(gate, 2560.146,-2227.251,13.071,3);
    SendClientMessage(playerid, COLOR_YELLOW,"GoodBye and come back to AdminBase base");
    return 1;
  }
  return 0;
  }
that should work fine. i compiled it.


Re: Moving Gates problem again ! - Kirchhoff - 20.03.2010

Can you please tell me what was wrong on my script ?! Please


Re: Moving Gates problem again ! - cozza123456 - 20.03.2010

Yes, sure. At the end of onplayercommandtext (after all of your commands) you need to return 0;
Look here: https://sampwiki.blast.hk/wiki/OnPlayerCommandText


Re: Moving Gates problem again ! - Kirchhoff - 20.03.2010

Oh i figured it out now ! TKS a lot for your help !


Re: Moving Gates problem again ! - cozza123456 - 20.03.2010

Not a problem, its been nice helping you


Re: Moving Gates problem again ! - Kirchhoff - 20.03.2010

OK i added lsp gates now with commands , but i get these warnings ! Pawno script :
Код:
#include <a_samp>
new gate;
new lpgate;

#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);
  return 1;
}

public OnPlayerCommandText (playerid, cmdtext[])
{
  if (strcmp(cmdtext, "/adminopen", true) == 0)
  {
    MoveObject(gate, 2560.146,-2235.245,13.071,3);
    SendClientMessage(playerid, COLOR_YELLOW,"Welcome to AdminBase !");
    return 1;
  }
  if (strcmp(cmdtext, "/adminclose", true) == 0)
  {
    MoveObject(gate, 2560.146,-2227.251,13.071,3);
    SendClientMessage(playerid, COLOR_YELLOW,"GoodBye and come back to AdminBase base");
    return 1;
  }
  if (strcmp(cmdtext, "/lspdopen", true) == 0)
  {
    MoveObject(lpgate, 1548.571,-1634.002,14.058,13.071,3);
    SendClientMessage(playerid, COLOR_YELLOW,"Welcome to AdminBase !");
    return 1;
  }
  if (strcmp(cmdtext, "/lspdclose", true) == 0)
  {
    MoveObject(lpgate, 1548.571,-1627.423,14.058,13.071,3);
    SendClientMessage(playerid, COLOR_YELLOW,"GoodBye and come back to AdminBase base");
    return 1;
  }
		return 0;
  }
Warnings :
Код:
D:\Gta san andreas\GTA San Andreas\server\filterscripts\MovingGatesBase.pwn(29) : warning 202: number of arguments does not match definition
D:\Gta san andreas\GTA San Andreas\server\filterscripts\MovingGatesBase.pwn(35) : warning 202: number of arguments does not match definition
D:\Gta san andreas\GTA San Andreas\server\filterscripts\MovingGatesBase.pwn(39) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Warnings.