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



Help with gate :/ - Snail - 15.09.2014

Hi All.

Today I was making a Gate for my friend, and I'm getting this error :/

C:\Users\George\Desktop\SAMP Server\filterscripts\gate.pwn(12) : error 010: invalid function or declaration

Here is the code

pawn Код:
gate = CreateObject(980,1081.4000000,-777.0000000,109.6000000);
Thanks.


Re: Help with gate :/ - IamPRO - 15.09.2014

use
pawn Код:
new gate = CreateObject(980,1081.4000000,-777.0000000,109.6000000, Float:rX, Float:rY, Float:rZ, Float:DrawDistance);



Re: Help with gate :/ - Snail - 15.09.2014

Here is the full script
pawn Код:
#define FILTERSCRIPT
#include <a_samp>
#include <zcmd>
#if defined FILTERSCRIPT
#pragma tabsize 0


#define blue 0x0000FFFF
#define orange 0xFF9900AA
new gate;

gate = CreateObject(980, 1081.4, -777, 103.6, 0, 0, 358);
clubtower = CreateObject(3749,1081.3000000,-778.4000200,112.5000000);


public OnFilterScriptInit()
{
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

#endif

CMD:gateopen(playerid,params[]) {
    MoveObject(gate, 1081.4, -777, 109.6, 2);
    SendClientMessage(playerid,blue,"[GATE]: Welcome Home!");
    return 1;
}

CMD:gateclose(playerid,params[]) {
    MoveObject(gate, 1081.4, -777, 103.6, 0, 0, 358);
    SendClientMessage(playerid,orange,"[GATE]: Goodbye!");
    return 1;
}



Re: Help with gate :/ - IamPRO - 15.09.2014

pawn Код:
#define FILTERSCRIPT
#include <a_samp>
#include <zcmd>
#if defined FILTERSCRIPT
#pragma tabsize 0


#define blue 0x0000FFFF
#define orange 0xFF9900AA
new gate;

public OnFilterScriptInit()
{
    gate = CreateObject(980, 1081.4, -777, 103.6, 0, 0, 358,250.0);
    clubtower = CreateObject(3749,1081.30,-778.400020,112.50, 0, 0,0, 250.0);  //use correct params
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

#endif

CMD:gateopen(playerid,params[]) {
    MoveObject(gate, 1081.4, -777, 109.6, 2);
    SendClientMessage(playerid,blue,"[GATE]: Welcome Home!");
    return 1;
}

CMD:gateclose(playerid,params[]) {
    MoveObject(gate, 1081.4, -777, 103.6, 0, 0, 358);
    SendClientMessage(playerid,orange,"[GATE]: Goodbye!");
    return 1;
}



Re: Help with gate :/ - Snail - 15.09.2014

Thanks man

REP Given.


Re: Help with gate :/ - IamPRO - 15.09.2014

deleted, double clicked "post".


Re: Help with gate :/ - LivingLikeYouDo - 15.09.2014

pawn Код:
//#define FILTERSCRIPT
#include <a_samp>
#include <zcmd>
//#if defined FILTERSCRIPT
#pragma tabsize 0


#define blue 0x0000FFFF
#define orange 0xFF9900AA
new gate;
new clubtower;

public OnFilterScriptInit()
{
    gate = CreateObject(980, 1081.4, -777, 103.6, 0, 0, 358);
    clubtower = CreateObject(3749,1081.3000000,-778.4000200,112.5000000);
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

//#endif

CMD:gateopen(playerid,params[]) {
    MoveObject(gate, 1081.4, -777, 109.6, 2);
    SendClientMessage(playerid,blue,"[GATE]: Welcome Home!");
    return 1;
}

CMD:gateclose(playerid,params[]) {
    MoveObject(gate, 1081.4, -777, 103.6, 0, 0, 358);
    SendClientMessage(playerid,orange,"[GATE]: Goodbye!");
    return 1;
}
This one will work.

@IamPRO - You forgot to mention a 'new' for clubtower object, other than that, your's is working too.


Re: Help with gate :/ - FisherMan - 15.09.2014

Make Sure New Gate