I need help with a moving gate FS
#1

SOLVED!
Reply
#2

Код:
//===============-a-samp-============================//
#include <a_samp>
#include <streamer>
//================-FS-===============================//
#define FILTERSCRIPT// Defined as FilterScript
//===============-Defined Gates-====================//
new Gate1;//Defined gate 1
new Gate2;//Defined gate 2

public OnFilterScriptInit()
{

	Gate1 = CreateObject(987, 2561.4971, 1483.4440, 9.6313, 0.0000, 0.0000, 0.0000, 100.0);//gate 1
	Gate2 = CreateObject(987, 2513.0234, 1603.0077, 9.6423, 0.0000, 0.0000, 180.0000, 100.0);//gate 2
}	
//============================================-Gate1 CMD-=========================================================//

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/og1", true)){
        if(IsPlayerInRangeOfPoint(playerid, 15.0, 1245.5999755859, -767.09997558594, 93.900001525879)){
            MoveObject(Gate1, 2561.4971, 1483.4440, 3.4713,0.0000, 0.0000, 0.0000, 0.0);
            SendClientMessage(playerid, COLOR_BLUE, "Welcome in Paceroni's Compound!");
            return 1;
        }
    }
    if(!strcmp(cmdtext, "/cg1", true)){
        if(IsPlayerInRangeOfPoint(playerid, 15.0, 1245.5999755859, -767.09997558594, 93.900001525879)){
            MoveObject(Gate1, 2561.4971, 1483.4440, 9.6313, 0.0000, 0.0000, 180.0000, 0.0);
            SendClientMessage(playerid, COLOR_RED, "Paceroni's Compound gate closed!");
            return 1;
        }
    }
//============================================-Gate 2 CMD-========================================================//
  if(!strcmp(cmdtext, "/og2", true)){
        if(IsPlayerInRangeOfPoint(playerid, 15.0, 1313.8000488281, -818.90002441406, 76.099998474121)){
            MoveObject(Gate2,2513.0234, 1603.0077, 3.4623, 0.0000, 0.0000, 180.0000, 0.0);
            SendClientMessage(playerid, COLOR_BLUE, "Welcome in Paceroni's Compound!");
            return 1;
        }
    }
    if(!strcmp(cmdtext, "/cg2", true)){
        if(IsPlayerInRangeOfPoint(playerid, 20.0, 1313.8000488281, -818.90002441406, 76.099998474121)){
            MoveObject(Gate2,2513.0234, 1603.0077, 9.6423, 3.0, 0.0000, 0.0000, 180.0000, 0.0);
            SendClientMessage(playerid, COLOR_RED, "Paceroni's Compound gate closed!");
            return 1;
        }
    }
You removed a bracket , Here you go.
Reply
#3

I appreciate your fast response, but I still do have 5 errors:

Код:
(23) : error 017: undefined symbol "COLOR_BLUE"
(30) : error 017: undefined symbol "COLOR_RED"
(35) : warning 217: loose indentation
(38) : error 017: undefined symbol "COLOR_BLUE"
(42) : warning 217: loose indentation
(44) : warning 202: number of arguments does not match definition
(45) : error 017: undefined symbol "COLOR_RED"
(49) : error 030: compound statement not closed at the end of file (started at line 20)
Reply
#4

pawn Код:
//===============-a-samp-============================//
#include <a_samp>
#include <streamer>
#define COLOR_RED 0xAA3333AA
#define COLOR_BLUE 0x2641FEAA
//================-FS-===============================//
#define FILTERSCRIPT// Defined as FilterScript
//===============-Defined Gates-====================//
new Gate1;//Defined gate 1
new Gate2;//Defined gate 2

public OnFilterScriptInit()
{

    Gate1 = CreateObject(987, 2561.4971, 1483.4440, 9.6313, 0.0000, 0.0000, 0.0000, 100.0);//gate 1
    Gate2 = CreateObject(987, 2513.0234, 1603.0077, 9.6423, 0.0000, 0.0000, 180.0000, 100.0);//gate 2
}  
//============================================-Gate1 CMD-=========================================================//

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/og1", true)){
        if(IsPlayerInRangeOfPoint(playerid, 15.0, 1245.5999755859, -767.09997558594, 93.900001525879)){
            MoveObject(Gate1, 2561.4971, 1483.4440, 3.4713,0.0000, 0.0000, 0.0000, 0.0);
            SendClientMessage(playerid, COLOR_BLUE, "Welcome in Paceroni's Compound!");
            return 1;
        }
    }
    if(!strcmp(cmdtext, "/cg1", true)){
        if(IsPlayerInRangeOfPoint(playerid, 15.0, 1245.5999755859, -767.09997558594, 93.900001525879)){
            MoveObject(Gate1, 2561.4971, 1483.4440, 9.6313, 0.0000, 0.0000, 180.0000, 0.0);
            SendClientMessage(playerid, COLOR_RED, "Paceroni's Compound gate closed!");
            return 1;
        }
    }
//============================================-Gate 2 CMD-========================================================//
  if(!strcmp(cmdtext, "/og2", true)){
        if(IsPlayerInRangeOfPoint(playerid, 15.0, 1313.8000488281, -818.90002441406, 76.099998474121)){
            MoveObject(Gate2,2513.0234, 1603.0077, 3.4623, 0.0000, 0.0000, 180.0000, 0.0);
            SendClientMessage(playerid, COLOR_BLUE, "Welcome in Paceroni's Compound!");
            return 1;
        }
    }
    if(!strcmp(cmdtext, "/cg2", true)){
        if(IsPlayerInRangeOfPoint(playerid, 20.0, 1313.8000488281, -818.90002441406, 76.099998474121)){
            MoveObject(Gate2,2513.0234, 1603.0077, 9.6423, 3.0, 0.0000, 0.0000, 180.0000, 0.0);
            SendClientMessage(playerid, COLOR_RED, "Paceroni's Compound gate closed!");
            return 1;
        }
    }
}
Reply
#5

Quote:
Originally Posted by kokoshkata
Посмотреть сообщение
I appreciate your fast response, but I still do have 5 errors:

Код:
(23) : error 017: undefined symbol "COLOR_BLUE"
(30) : error 017: undefined symbol "COLOR_RED"
(35) : warning 217: loose indentation
(38) : error 017: undefined symbol "COLOR_BLUE"
(42) : warning 217: loose indentation
(44) : warning 202: number of arguments does not match definition
(45) : error 017: undefined symbol "COLOR_RED"
(49) : error 030: compound statement not closed at the end of file (started at line 20)
Are you sure you have your #define's at the top of your script for "COLOR_BLUE" and "COLOR_RED"?
Reply
#6

Yes, I have the #define's at the top for COLOR_BLUE and COLOR_RED.

But I'm still getting those errors:

Код:
(37) : warning 217: loose indentation
(44) : warning 217: loose indentation
(46) : warning 202: number of arguments does not match definition
(51) : warning 209: function "OnPlayerCommandText" should return a value
Anyway to fix them?
Reply
#7

Instead of your defines just put the color code in there
Reply
#8

Alright, I solved the problems with ''indentation'',now my only problem is:

Код:
(53) : warning 209: function "OnPlayerCommandText" should return a value
Reply
#9

Add a return 1; or return 0; at the end before the last closing brace, i forget how onplayercommandtext works. ZCMD ftw
Reply
#10

Thanks, It works perfectly now.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)