Where to put the Gate script in pawno? [Have cords]
#1

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

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

thats dont work, please just compile it for me .
Reply
#4

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;
}
Reply
#5

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

for where is this gate
Reply
#7

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

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
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)