Moving Gates problem again !
#1

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.
Reply
#2

Line ? 25 ??
Reply
#3

But how can i show you where is line 25 ?
Reply
#4

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

Код:
#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.
Reply
#6

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

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
Reply
#8

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

Not a problem, its been nice helping you
Reply
#10

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)