SA-MP Forums Archive
Where to put the Gate script in pawno? [Have cords] - 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: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Where to put the Gate script in pawno? [Have cords] (/showthread.php?tid=127200)



Where to put the Gate script in pawno? [Have cords] - manunited1878 - 12.02.2010

where to put this script? please give me the link when you are done to put it in Pawno, then upload it on Internet.
Код:
#include <a_samp>

new Firasgate;

public OnFilterScriptInit()
{
Firasgate = CreateObject(980, 320.59393310547, -1188.8247070313, 78.117607116699, 0, 0, 37.714782714844);
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/opengatefiras", cmdtext, true, 10) == 0)
{
if(Eg: PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
{
if(IsPlayerInRangeOfPoint(playerid, 10.0, 320.59393310547, -1188.8247070313, 78.117607116699))
{
MoveObject(Firasgate, 314.15914916992, -1193.9382324219, 77.978485107422, 10);
Eg: SendClientMessage(playerid, 0xFFFFFF, "You've opened the Firas gate, please close it");
}
}else{
Eg: SendClientMessage(playerid, 0xFFFFF, "You're not a Firas member!");
}
return 1;
}
if (strcmp("/closegatefiras", cmdtext, true, 10) == 0)
{
if(Eg: PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
{
if(IsPlayerInRangeOfPoint(playerid, 10.0, 320.59393310547, -1188.8247070313, 78.117607116699))
{
MoveObject(Firasgate, 320.59393310547, -1188.8247070313, 78.117607116699, 10);
Eg: SendClientMessage(playerid, 0xFFFFFF, "You've closed the Firas gate");
}
}else{
Eg: SendClientMessage(playerid, 0xFFFFF, "You're not a Firas member!");
}
return 1;
}
return 0;
}



Re: Where to put the Gate script in pawno? [Have cords] - MadeMan - 12.02.2010

You have it in place already, just remove the "Eg:"


Re: Where to put the Gate script in pawno? [Have cords] - manunited1878 - 12.02.2010

thats dont work, please just compile it for me .


Re: Where to put the Gate script in pawno? [Have cords] - MadeMan - 12.02.2010

Try this

pawn Код:
#include <a_samp>

new Firasgate;

public OnFilterScriptInit()
{
    Firasgate = CreateObject(980, 320.59393310547, -1188.8247070313, 78.117607116699, 0, 0, 37.714782714844);
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/opengatefiras", cmdtext, true) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 10.0, 320.59393310547, -1188.8247070313, 78.117607116699))
        {
            MoveObject(Firasgate, 314.15914916992, -1193.9382324219, 77.978485107422, 10);
            SendClientMessage(playerid, 0xFFFFFFFF, "You've opened the Firas gate, please close it");
        }
        return 1;
    }
    if (strcmp("/closegatefiras", cmdtext, true) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 10.0, 320.59393310547, -1188.8247070313, 78.117607116699))
        {
            MoveObject(Firasgate, 320.59393310547, -1188.8247070313, 78.117607116699, 10);
            SendClientMessage(playerid, 0xFFFFFFFF, "You've closed the Firas gate");
        }
        return 1;
    }
    return 0;
}



Re: Where to put the Gate script in pawno? [Have cords] - manunited1878 - 12.02.2010

Quote:
Originally Posted by MadeMan
Try this

pawn Код:
#include <a_samp>

new Firasgate;

public OnFilterScriptInit()
{
    Firasgate = CreateObject(980, 320.59393310547, -1188.8247070313, 78.117607116699, 0, 0, 37.714782714844);
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/opengatefiras", cmdtext, true) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 10.0, 320.59393310547, -1188.8247070313, 78.117607116699))
        {
            MoveObject(Firasgate, 314.15914916992, -1193.9382324219, 77.978485107422, 10);
            SendClientMessage(playerid, 0xFFFFFFFF, "You've opened the Firas gate, please close it");
        }
        return 1;
    }
    if (strcmp("/closegatefiras", cmdtext, true) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 10.0, 320.59393310547, -1188.8247070313, 78.117607116699))
        {
            MoveObject(Firasgate, 320.59393310547, -1188.8247070313, 78.117607116699, 10);
            SendClientMessage(playerid, 0xFFFFFFFF, "You've closed the Firas gate");
        }
        return 1;
    }
    return 0;
}
Mademan you rock! thanks for your help here and on my previous post!, thx man xD


Re: Where to put the Gate script in pawno? [Have cords] - [Lsrcr]Rafa - 27.07.2010

for where is this gate


Re: Where to put the Gate script in pawno? [Have cords] - John_F - 27.07.2010

If you want to change the 2 cmds into 1 you can try this:

pawn Код:
#include <a_samp>

new Firasgate;
new openClosed;

public OnFilterScriptInit()
{
    Firasgate = CreateObject(980, 320.59393310547, -1188.8247070313, 78.117607116699, 0, 0, 37.714782714844);
    openClosed = 0; //Starts off 0 (closed)
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/gatefiras", cmdtext, true) == 0)
    {
      if(openClosed == 0)
     {
        if(IsPlayerInRangeOfPoint(playerid, 10.0, 320.59393310547, -1188.8247070313, 78.117607116699))
        {
            MoveObject(Firasgate, 314.15914916992, -1193.9382324219, 77.978485107422, 10);
            SendClientMessage(playerid, 0xFFFFFFFF, "You've opened the Firas gate, please close it");
            openClosed = 1; // Change value of openClosed to 1, showing that it is open
        }
      }
      else
      {
        // If gate is already opened:
        if(IsPlayerInRangeOfPoint(playerid, 10.0, 320.59393310547, -1188.8247070313, 78.117607116699))
        {
            MoveObject(Firasgate, 320.59393310547, -1188.8247070313, 78.117607116699, 10);
            SendClientMessage(playerid, 0xFFFFFFFF, "You've closed the Firas gate");
            openClosed = 0; // Change the value back to 0, showing that it is open
        }
        return 1;
      }
      return 1;
  }
     
    return 0;
}
Didn't test it, but it should work.


Re: Where to put the Gate script in pawno? [Have cords] - [Lsrcr]Rafa - 27.07.2010

Quote:
Originally Posted by manunited1878
Посмотреть сообщение
Mademan you rock! thanks for your help here and on my previous post!, thx man xD
Quote:
Originally Posted by [Lsrcr]Rafa
Посмотреть сообщение
for where is this gate
Quote:
Originally Posted by MadeMan
Посмотреть сообщение
Try this

pawn Код:
#include <a_samp>

new Firasgate;

public OnFilterScriptInit()
{
    Firasgate = CreateObject(980, 320.59393310547, -1188.8247070313, 78.117607116699, 0, 0, 37.714782714844);
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/opengatefiras", cmdtext, true) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 10.0, 320.59393310547, -1188.8247070313, 78.117607116699))
        {
            MoveObject(Firasgate, 314.15914916992, -1193.9382324219, 77.978485107422, 10);
            SendClientMessage(playerid, 0xFFFFFFFF, "You've opened the Firas gate, please close it");
        }
        return 1;
    }
    if (strcmp("/closegatefiras", cmdtext, true) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 10.0, 320.59393310547, -1188.8247070313, 78.117607116699))
        {
            MoveObject(Firasgate, 320.59393310547, -1188.8247070313, 78.117607116699, 10);
            SendClientMessage(playerid, 0xFFFFFFFF, "You've closed the Firas gate");
        }
        return 1;
    }
    return 0;
}
Quote:
Originally Posted by MadeMan
Посмотреть сообщение
You have it in place already, just remove the "Eg:"
Quote:
Originally Posted by manunited1878
Посмотреть сообщение
thats dont work, please just compile it for me .
Quote:
Originally Posted by manunited1878
Посмотреть сообщение
where to put this script? please give me the link when you are done to put it in Pawno, then upload it on Internet.
Код:
#include <a_samp>

new Firasgate;

public OnFilterScriptInit()
{
Firasgate = CreateObject(980, 320.59393310547, -1188.8247070313, 78.117607116699, 0, 0, 37.714782714844);
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/opengatefiras", cmdtext, true, 10) == 0)
{
if(Eg: PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
{
if(IsPlayerInRangeOfPoint(playerid, 10.0, 320.59393310547, -1188.8247070313, 78.117607116699))
{
MoveObject(Firasgate, 314.15914916992, -1193.9382324219, 77.978485107422, 10);
Eg: SendClientMessage(playerid, 0xFFFFFF, "You've opened the Firas gate, please close it");
}
}else{
Eg: SendClientMessage(playerid, 0xFFFFF, "You're not a Firas member!");
}
return 1;
}
if (strcmp("/closegatefiras", cmdtext, true, 10) == 0)
{
if(Eg: PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
{
if(IsPlayerInRangeOfPoint(playerid, 10.0, 320.59393310547, -1188.8247070313, 78.117607116699))
{
MoveObject(Firasgate, 320.59393310547, -1188.8247070313, 78.117607116699, 10);
Eg: SendClientMessage(playerid, 0xFFFFFF, "You've closed the Firas gate");
}
}else{
Eg: SendClientMessage(playerid, 0xFFFFF, "You're not a Firas member!");
}
return 1;
}
return 0;
}
Quote:
Originally Posted by John_F
Посмотреть сообщение
If you want to change the 2 cmds into 1 you can try this:

pawn Код:
#include <a_samp>

new Firasgate;
new openClosed;

public OnFilterScriptInit()
{
    Firasgate = CreateObject(980, 320.59393310547, -1188.8247070313, 78.117607116699, 0, 0, 37.714782714844);
    openClosed = 0; //Starts off 0 (closed)
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/gatefiras", cmdtext, true) == 0)
    {
      if(openClosed == 0)
     {
        if(IsPlayerInRangeOfPoint(playerid, 10.0, 320.59393310547, -1188.8247070313, 78.117607116699))
        {
            MoveObject(Firasgate, 314.15914916992, -1193.9382324219, 77.978485107422, 10);
            SendClientMessage(playerid, 0xFFFFFFFF, "You've opened the Firas gate, please close it");
            openClosed = 1; // Change value of openClosed to 1, showing that it is open
        }
      }
      else
      {
        // If gate is already opened:
        if(IsPlayerInRangeOfPoint(playerid, 10.0, 320.59393310547, -1188.8247070313, 78.117607116699))
        {
            MoveObject(Firasgate, 320.59393310547, -1188.8247070313, 78.117607116699, 10);
            SendClientMessage(playerid, 0xFFFFFFFF, "You've closed the Firas gate");
            openClosed = 0; // Change the value back to 0, showing that it is open
        }
        return 1;
      }
      return 1;
  }
     
    return 0;
}
Didn't test it, but it should work.
ok if i want to make the sites (left,right,down) where i want to go the door what i need to do