06.02.2011, 23:12
I`ll give it a try to help you:
First:
Second, you need to create the closed gate, using the 'sacgclose' we used before. This is done in OnGameModeInit function:
Now, we move on to commands. You need to put these commands under OnPlayerCommandText
Now with the close command:
I made it with IsPlayerInRangeOfPoint, which checks if the player is near the gate which you want to open ... if you do it without a IsPlayerInRangeOfPoint, you would`ve been able to open the gate from anywhere ...
Hope I helped ... if you have any questions, feel free to post or pm me.
ps: You don`t need any:
You need only 1 gate created, which you'll move with /fbo and /fbc commands.
First:
pawn Код:
new sacgclose;
pawn Код:
sacgclose = CreateObject (8210,1024.183,-2008.802,3.244,0.00000000,0.00000000,83. 995) ;
pawn Код:
if(!strcmp(cmdtext,"/fbo",true))
{
if(IsPlayerInRangeOfPoint(playerid, 10.0, 1024.183,-2008.802,3.244))
{
MoveObject(sacgclose, 1024.184,-2008.802,15.244, 2.0); // (sacgclose, X,Y,Z, MovingSpeed)
SendClientMessage(playerid, 0xAA0000AA, "You have opened the Coast Guard Bay gates please /fbc.");
return 1;
}
else SendClientMessage(playerid, 0xAA0000AA, "You must be near the gate to open it.");
else
return 1;
}
pawn Код:
if(!strcmp(cmdtext,"/fbc",true))
{
if(IsPlayerInRangeOfPoint(playerid, 10.0, 1024.183,-2008.802,3.244))
{
MoveObject(sacgclose, 1024.184,-2008.802,15.244, 2.0);
SendClientMessage(playerid, 0xAA0000AA, "You have closes the Coast Guard Bay gates.");
return 1;
}
else SendClientMessage(playerid, 0xAA0000AA, "You must be near the gate to open it.");
else
return 1;
}
Hope I helped ... if you have any questions, feel free to post or pm me.
ps: You don`t need any:
pawn Код:
new aacgopen