SA-MP Forums Archive
Help please - 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: Help please (/showthread.php?tid=436985)



Help please - john77 - 13.05.2013

I tried to make something in MTA and convert to SAMP when I put in the filterscripts it doesn't appear in the game I even put FS name in server setting please check it out

http://pastebin.com/HXK2A5Q9

If you help me fix it I will give 1 rep


Re: Help please - MP2 - 13.05.2013

If it's a filterscript, the problem is that you're creating the objects under OnGameModeInit; you need to use OnFilterScriptInit.


Re: Help please - john77 - 13.05.2013

So just this bit
public OnFilterScriptInit() to
public OnGameModeInit;

or?


Re: Help please - john77 - 13.05.2013

...No need


Re: Help please - Calabresi - 13.05.2013

You have to add the lines you have in OnFilterScriptInit under OnGameModeInit.


Re: Help please - john77 - 13.05.2013

Could you give me an example I am a bit of a n00b when it comes to scripting thanks


Re: Help please - Calabresi - 13.05.2013

Quote:
Originally Posted by john77
Посмотреть сообщение
Could you give me an example I am a bit of a n00b when it comes to scripting thanks
pawn Код:
public OnFilterScriptInit()
{
      // Code number 1
}

public OnGameModeInit()
{
      // Code number 2
}
To:

pawn Код:
public OnGameModeInit()
{
     // Code number 1
     // Code number 2
}



Re: Help please - john77 - 13.05.2013

So like this? http://pastebin.com/Zxuz0V1x


Re: Help please - Xoomer - 13.05.2013

ok check this
pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
#define FILTERSCRIPT

#include <a_samp>

#if defined FILTERSCRIPT
new kk;
public OnFilterScriptInit()
{
       CreateObject(16121,-445.5000000,1442.9000200,20.0000000,0.0000000,0.0000000,132.0000000); //object(des_rockgp2_09) (1) (1)


       kk = CreateObject(16121,-445.5000000,1442.9000200,20.0000000,0.0000000,0.0000000,132.0000000); //object(des_rockgp2_09) (1) (1)
        // pos2         CreateObject(16121,-445.5000000,1442.9000200,20.0000000,0.0000000,0.0000000,132.0000000); //object(des_rockgp2_09) (1)
       return 1;

}

public OnFilterScriptExit()
{
        return 1;
}

#else

main()
{
        print("\n----------------------------------");
        print(" Blank Gamemode by your name here");
        print("----------------------------------\n");
}

#endif



public OnGameModeInit()
{
       
}

public OnGameModeExit()
{
        return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
        if (strcmp("/open", cmdtext, true, 10) == 0)
        {
        SendClientMessage(playerid,0x000000ff,"{ff0000}Welcome Back to your cave");
        MoveObject(kk, -395.20001220703, 1242.6999511719, -1.3999999761581, 208, 0.30000001);
        return 1;
        }
        if (strcmp("/close", cmdtext, true, 10) == 0)
        {
        SendClientMessage(playerid,0x000000ff,"{ff0000}You are now leaving the cave");
        MoveObject(kk, -395.20001220703, 1242.6999511719, 4.0999999046326, 208, 0.30000001);
        return 1;
        }
        return 0;
        }
try it


Re: Help please - Calabresi - 13.05.2013

pawn Код:
#include <a_samp>

main()
{
    print("\n--------------------------------------");
    print(" Blank Filterscript by your name here");
    print("--------------------------------------\n");
    return 1;
}

new kk;

public OnFilterScriptInit()
{
    CreateObject(16121,-445.5000000,1442.9000200,20.0000000,0.0000000,0.0000000,132.0000000); //object(des_rockgp2_09) (1) (1)


    kk = CreateObject(16121,-445.5000000,1442.9000200,20.0000000,0.0000000,0.0000000,132.0000000); //object(des_rockgp2_09) (1) (1)
    // pos2     CreateObject(16121,-445.5000000,1442.9000200,20.0000000,0.0000000,0.0000000,132.0000000); //object(des_rockgp2_09) (1)
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/open", cmdtext, true, 10) == 0)
    {
        SendClientMessage(playerid,0x000000ff,"{ff0000}Welcome Back to your cave");
        MoveObject(kk, -395.20001220703, 1242.6999511719, -1.3999999761581, 208, 0.30000001);
        return 1;
    }
    if (strcmp("/close", cmdtext, true, 10) == 0)
    {
        SendClientMessage(playerid,0x000000ff,"{ff0000}You are now leaving the cave");
        MoveObject(kk, -395.20001220703, 1242.6999511719, 4.0999999046326, 208, 0.30000001);
        return 1;
    }
Ignore my previous messages - I thought you were trying to create a gamemode from your error messages. Use this code and it should be fine as a filterscript.