SA-MP Forums Archive
[Tutorial] How To Make Command Moving Gates - 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)
+---- Forum: Tutorials (https://sampforum.blast.hk/forumdisplay.php?fid=70)
+---- Thread: [Tutorial] How To Make Command Moving Gates (/showthread.php?tid=498797)



How To Make Command Moving Gates - damarpeer - 05.03.2014

Hello Guys Today Will Teach You How To Make Moving Object Like Gates
P.S: My First Tutorial
We Are Starting Now


Open Pawno , Then Click On New Then Press Ctrl + A To Select All Then Delete All

Now, Add At The Top This Line Is To Load The Include a_Samp
PHP Code:
#include <a_samp> 
For Example My Gate Name Will Be castle So add
PHP Code:
new castle
Here You Should Add The Gate Coordinates
Then Add
PHP Code:
public OnFilterScriptInit()
{
    
castle CreateObject(Model IDCord XCord YCord ZRotation XRotation YRotation Z);

Here The Command You Want To Open The Gate And Close

PHP Code:
public OnPlayerCommandText(playeridcmdtext[])
{
    if(!
strcmp(cmdtext"/openGate"))
    {
        
MoveObject(castleCord XCord YCord ZFloat:Speed);
        return 
1;
    }
    if(!
strcmp(cmdtext"/closeGate"))
    {
        
MoveObject(castleCord XCord YCord ZFloat:Speed);
        return 
1;
    }
    return 
0;

At The End Your File Should Be Like This
PHP Code:
#include <a_samp>
new castle;
public 
OnFilterScriptInit()
{
    
castle CreateObject(987, -2088.10010001642.6999500120.70000000.00000000.000000070.9990000);
}
public 
OnPlayerCommandText(playeridcmdtext[])
{
    if(!
strcmp(cmdtext"/opensesmi"))
    {
        
MoveObject(castle, -2088.09961001642.6992200125.70000002.0);
        return 
1;
    }
    if(!
strcmp(cmdtext"/closesesmi"))
    {
        
MoveObject(castle, -2088.10010001642.6999500120.70000002.0);
        return 
1;
    }
    return 
0;

So Now We Done Its a Basic Tutorial But Its My First Tutorial But If It Helped You +Rep Me


Re: How To Make Command Moving Gates - jueix - 05.03.2014

It's okay, But your not really explaining anything like what move object does, What each part is meant to do ETC. But still good.


Re: How To Make Command Moving Gates - damarpeer - 05.03.2014

Thnx But Is It Ok For First Tutorial Cuz I didn't Make Any tutorial before


Re: How To Make Command Moving Gates - AlonzoTorres - 05.03.2014

Might want to show them how they can implement this into their gamemodes and not only how to make a filterscript of it.