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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: gate (
/showthread.php?tid=211027)
gate -
TheKingOfSamp - 14.01.2011
Hello, This cmds works well but i should type /gate 1 to - open and /gate2 to - close
So i need /gate- to open and /gate - close ( the same cmd ) , I tried this but when i do this the gates
don't open in game , here's the code
Код:
}
if(!strcmp(cmdtext, "/gate1", true))//open
{
if(PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pLeader] == 3 || PlayerInfo[playerid][pLeader] == 5 || PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pMember] == 5)
{
if(IsPlayerInRangeOfPoint(playerid, 15, 1588.06298828,-1638.16271973,7.16996956))
MoveObject(pdgate, 1588.06298828,-1638.16271973,7.16996956, 3);
return 1;
}
}
if(!strcmp(cmdtext, "/gate2", true))//close
{
if(PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pLeader] == 3 || PlayerInfo[playerid][pLeader] == 5 || PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pMember] == 5)
{
if(IsPlayerInRangeOfPoint(playerid, 15, 1588.06298828,-1638.16271973,15.16996956))
MoveObject(pdgate, 1588.06298828,-1638.16271973,15.16996956, 3);
return 1;
}
}
hope get help , thanks..
Re: gate -
Mean - 14.01.2011
pawn Код:
if(!strcmp(cmdtext, "/gate1", true))//open
{
if(PlayerInfo[playerid][pLeader] >= 1 || PlayerInfo[playerid][pMember] >= 1)
{
if(IsPlayerInRangeOfPoint(playerid, 15, 1588.06298828,-1638.16271973,7.16996956)) MoveObject(pdgate, 1588.06298828,-1638.16271973,7.16996956, 3);
return 1;
}
}
if(!strcmp(cmdtext, "/gate2", true))//close
{
if(PlayerInfo[playerid][pLeader] >= 1 || PlayerInfo[playerid][pMember] >= 1)
{
if(IsPlayerInRangeOfPoint(playerid, 15, 1588.06298828,-1638.16271973,15.16996956)) MoveObject(pdgate, 1588.06298828,-1638.16271973,15.16996956, 3);
return 1;
}
}
Re: gate -
fangoth1 - 14.01.2011
pawn Код:
if(!strcmp(cmdtext, "/gate", true))//open
{
new opengate = MoveObject(pdgate, 1588.06298828,-1638.16271973,7.16996956, 3);
if(PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pLeader] == 3 || PlayerInfo[playerid][pLeader] == 5 || PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pMember] == 5)
{
if(IsPlayerInRangeOfPoint(playerid, 15, 1588.06298828,-1638.16271973,7.16996956))
MoveObject(pdgate, 1588.06298828,-1638.16271973,7.16996956, 3);
}
else if(GetObjectPos(pdgate, opengate))
{
MoveObject(pdgate, X, Y, Z, 3);
}
return 1;
}