[Tutorial] How To Make Command Moving Gates
#1

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

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

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)