SA-MP Forums Archive
The Gate - 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: The Gate (/showthread.php?tid=596791)



The Gate - iiMo - 22.12.2015

Hey,

I scripted a gate as a FilterScript and put it in the Filterscript.
But when I type the command in-game it doesn't do anything, can someone help me ?


Re: The Gate - Sebz - 22.12.2015

/rcon login PASSWORD
/rcon loadfs FILTERSCRIPTNAME

Example /rcon loadfs cars


(CaSe SeNsItIvE)


Re: The Gate - iiMo - 22.12.2015

It says that the commands work, but it doesn't have any effect.


Re: The Gate - TwinkiDaBoss - 22.12.2015

SHOW us your code. We cannot see what you have wrote down in your script by reading your mind. Atleast I cannot read your mind.


Re: The Gate - saffierr - 22.12.2015

@TwinkiDaBoss, don't worry, I can't either.
Show your code...


Re: The Gate - iiMo - 22.12.2015

Code will be shown in a second.


Re: The Gate - saffierr - 22.12.2015

Quote:
Originally Posted by iiMo
Посмотреть сообщение
Code will be shown in a second.
You have posted this 5mins ago, but ok.


Re: The Gate - iiMo - 22.12.2015

PHP код:
#include <a_samp>

#define FILTERSCRIPT
new MaltGate;

public 
OnFilterScriptInit()
{
    
MaltGate CreateObject(9691268.33813172.6552718.40459,   0.000000.0000065.53729);
    
MaltGate CreateObject(9691271.91394180.7189018.40559,   0.000000.0000065.53729);

    return 
1;
}

public 
OnPlayerCommandText(playeridcmdtext[])
{
    if(!
strcmp(cmdtext"/OpenGate"true)){
        {
            
MoveObject(MaltGate1265.96130165.5860418.40459,   0.000000.0000065.53729);
            
MoveObject(MaltGate1273.89319186.6057118.40559,   0.000000.0000065.55613);
            return 
1;
        }
    }
    else if(
strcmp(cmdtext"/CloseGate"true)){
  {
            
MoveObject(MaltGate1268.33813172.6552718.40459,   0.000000.0000065.53729);
            
MoveObject(MaltGate1271.91394180.7189018.40559,   0.000000.0000065.53729);
            return 
1;
        }
    }
    return 
0;
}
public 
OnFilterScriptExit()
{
    return 
1;




Re: The Gate - saffierr - 22.12.2015

You have to define the objects.. by creating variables.
Can't show a example atm


Re: The Gate - TwinkiDaBoss - 22.12.2015

You have 2 objects under same variable.
PHP код:
#include <a_samp>
#define FILTERSCRIPT
new MaltGate[2];
public 
OnFilterScriptInit()
{
    
MaltGate[0] = CreateObject(9691268.33813172.6552718.40459,   0.000000.0000065.53729);
    
MaltGate[1] = CreateObject(9691271.91394180.7189018.40559,   0.000000.0000065.53729);
    return 
1;
}
public 
OnPlayerCommandText(playeridcmdtext[])
{
    if(!
strcmp(cmdtext"/OpenGate"true)){
        {
            
MoveObject(MaltGate[0], 1265.96130165.5860418.40459,   0.000000.0000065.53729);
            
MoveObject(MaltGate[1], 1273.89319186.6057118.40559,   0.000000.0000065.55613);
            return 
1;
        }
    }
    else if(
strcmp(cmdtext"/CloseGate"true)){
      {
            
MoveObject(MaltGate[0], 1268.33813172.6552718.40459,   0.000000.0000065.53729);
            
MoveObject(MaltGate[1], 1271.91394180.7189018.40559,   0.000000.0000065.53729);
            return 
1;
        }
    }
    return 
0;