SA-MP Forums Archive
Gate Help - 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)
+--- Thread: Gate Help (/showthread.php?tid=392106)



Gate Help - coolmark1995 - 12.11.2012

Hello I am trying to get this script for my gate to work code is
Код:
#include <a_samp>
new Gate, bool:GateClosed = true;

public OnFilterScriptInit()
{
	Gate = CreateObject(980, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 100.0);
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if(!strcmp(cmdtext, "/Open", true)){
		if(GateClosed){
			if(IsPlayerInRangeOfPoint(playerid, 15.0, 0.0, 0.0, 0.0)){
				GateClosed = false;
				MoveObject(Gate, 2306.1000976563, 1383.0999755859, 12.39999961853, 3.0, 0.0, 0.0, 0.0);
				return 1;
			}
		}
		else{
			if(IsPlayerInRangeOfPoint(playerid, 15.0, 0.0, 0.0, 0.0)){
				GateClosed = true;
				MoveObject(Gate, 0.0, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0);
				return 1;
			}
		}
	}
	return 0;
}
but pawno gives me errors like
Код:
C:\Users\Rose\Downloads\home.pwn(147) : warning 217: loose indentation
C:\Users\Rose\Downloads\home.pwn(149) : error 029: invalid expression, assumed zero
C:\Users\Rose\Downloads\home.pwn(150) : error 001: expected token: ";", but found "{"
C:\Users\Rose\Downloads\home.pwn(155) : warning 225: unreachable code
C:\Users\Rose\Downloads\home.pwn(155) : error 029: invalid expression, assumed zero
C:\Users\Rose\Downloads\home.pwn(155) : error 004: function "OnPlayerCommandText" is not implemented
C:\Users\Rose\Downloads\home.pwn(157) : error 017: undefined symbol "cmdtext"
C:\Users\Rose\Downloads\home.pwn(159) : error 017: undefined symbol "playerid"
C:\Users\Rose\Downloads\home.pwn(166) : error 017: undefined symbol "playerid"
C:\Users\Rose\Downloads\home.pwn(175) : error 030: compound statement not closed at the end of file (started at line 5)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


8 Errors.
how can I fix this gate?


Re: Gate Help - ThePhenix - 12.11.2012

It isn't not giving me any error.
Try to update your includes.


Re: Gate Help - coolmark1995 - 12.11.2012

Quote:
Originally Posted by ThePhenix
Посмотреть сообщение
It isn't not giving me any error.
Try to update your includes.
where can I get the updates?


Re: Gate Help - ThePhenix - 12.11.2012

http://www.sa-mp.com/download.php

Download the windows, linux package or either..


Re: Gate Help - coolmark1995 - 12.11.2012

Quote:
Originally Posted by ThePhenix
Посмотреть сообщение
http://www.sa-mp.com/download.php

Download the windows, linux package or either..
I am still getting same error what can I do?


Re: Gate Help - ThePhenix - 12.11.2012

Are you sure you compile (Pawno) the Script with the new folder?


Re: Gate Help - Face9000 - 12.11.2012

pawn Код:
new Gate;
new bool:GateClosed;

if(!strcmp(cmdtext, "/Open", true))
{
        if(GateClosed)
        {
            if(IsPlayerInRangeOfPoint(playerid, 15.0, 0.0, 0.0, 0.0))
            {
                GateClosed = false;
                MoveObject(Gate, 2306.1000976563, 1383.0999755859, 12.39999961853, 3.0, 0.0, 0.0, 0.0);
                return 1;
            }
        }
        else
        {
            if(IsPlayerInRangeOfPoint(playerid, 15.0, 0.0, 0.0, 0.0))
            {
                GateClosed = true;
                MoveObject(Gate, 0.0, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0);
                return 1;
            }
        }
}



Re: Gate Help - coolmark1995 - 12.11.2012

Quote:
Originally Posted by Logitech90
Посмотреть сообщение
pawn Код:
new Gate;
new bool:GateClosed;

if(!strcmp(cmdtext, "/Open", true))
{
        if(GateClosed)
        {
            if(IsPlayerInRangeOfPoint(playerid, 15.0, 0.0, 0.0, 0.0))
            {
                GateClosed = false;
                MoveObject(Gate, 2306.1000976563, 1383.0999755859, 12.39999961853, 3.0, 0.0, 0.0, 0.0);
                return 1;
            }
        }
        else
        {
            if(IsPlayerInRangeOfPoint(playerid, 15.0, 0.0, 0.0, 0.0))
            {
                GateClosed = true;
                MoveObject(Gate, 0.0, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0);
                return 1;
            }
        }
}
I still get errors
Код:
C:\Users\Rose\Downloads\home.pwn(147) : warning 217: loose indentation
C:\Users\Rose\Downloads\home.pwn(150) : error 017: undefined symbol "cmdtext"
C:\Users\Rose\Downloads\home.pwn(154) : error 017: undefined symbol "playerid"
C:\Users\Rose\Downloads\home.pwn(163) : error 017: undefined symbol "playerid"
C:\Users\Rose\Downloads\home.pwn(171) : error 030: compound statement not closed at the end of file (started at line 5)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.



Re: Gate Help - Face9000 - 12.11.2012

Can you show me line 150, 154, 163 and 171?


Re: Gate Help - coolmark1995 - 12.11.2012

Quote:
Originally Posted by Logitech90
Посмотреть сообщение
Can you show me line 150, 154, 163 and 171?
so I have gate working but how can I make it move to the left or right? and it dosent recognize command eathier

Код:
#include <a_samp>
new Gate, bool:GateClosed = true;

public OnFilterScriptInit()
{
	Gate = CreateObject(980, 2306.1000976563, 1383.0999755859, 12.39999961853);
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if(!strcmp(cmdtext, "/Open", true)){
		if(GateClosed){
			if(IsPlayerInRangeOfPoint(playerid, 15.0, 0.0, 0.0, 0.0)){
				GateClosed = false;
				MoveObject(Gate, 2306.1000976563, 1383.0999755859, 12.39999961853, 3.0, 0.0, 0.0, 0.0);
				return 1;
			}
		}
		else{
			if(IsPlayerInRangeOfPoint(playerid, 15.0, 0.0, 0.0, 0.0)){
				GateClosed = true;
				MoveObject(Gate, 0.0, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0);
				return 1;
			}
		}
	}
	return 0;
}