SA-MP Forums Archive
I need help with a moving gate FS - 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: I need help with a moving gate FS (/showthread.php?tid=440918)



I need help with a moving gate FS - kokoshkata - 31.05.2013

SOLVED!


Re: I need help with a moving gate FS - nor15 - 31.05.2013

Код:
//===============-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.


Re: I need help with a moving gate FS - kokoshkata - 31.05.2013

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)



Re: I need help with a moving gate FS - mahdi499 - 31.05.2013

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



Re: I need help with a moving gate FS - zJordioz - 31.05.2013

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"?


Re: I need help with a moving gate FS - kokoshkata - 01.06.2013

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?


Re: I need help with a moving gate FS - NicholasA - 01.06.2013

Instead of your defines just put the color code in there


Re: I need help with a moving gate FS - kokoshkata - 01.06.2013

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

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



Re: I need help with a moving gate FS - DobbysGamertag - 01.06.2013

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


Re: I need help with a moving gate FS - kokoshkata - 01.06.2013

Thanks, It works perfectly now.