#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; }
#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;
}
Originally Posted by MadeMan
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;
}
Mademan you rock! thanks for your help here and on my previous post!, thx man xD
|
Try this
pawn Код:
|
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; } |
If you want to change the 2 cmds into 1 you can try this:
pawn Код:
|