[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


Messages In This Thread
How To Make Command Moving Gates - by damarpeer - 05.03.2014, 09:50
Re: How To Make Command Moving Gates - by jueix - 05.03.2014, 10:21
Re: How To Make Command Moving Gates - by damarpeer - 05.03.2014, 10:58
Re: How To Make Command Moving Gates - by AlonzoTorres - 05.03.2014, 13:07

Forum Jump:


Users browsing this thread: 1 Guest(s)