Gate Help
#1

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

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

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

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

Download the windows, linux package or either..
Reply
#5

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?
Reply
#6

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

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

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

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

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)