08.03.2011, 17:13
Well, that`s not that hard, talking about question 2 ... all you have to do is add if( IsPlayerInRangeOfPoint( playerid, distance, x, y, z ) )
Let me make one for you:
So, overall, if you want to modify the distance, just modify the 5.0.
And to add new coords just add like:
Hope I helped.
Let me make one for you:
pawn Код:
//PDGate1
if(strcmp(cmdtext, "/OpenPDGate1", true) == 0)
{
if( IsPlayerInRangeOfPoint( playerid, 5.0, 253.220,105.377,1004.370 ) )
{
MoveObject(PDGate1,253.220703125,105.3779296875,1004.3708496094, 1);
SendClientMessage(playerid, COLOR_YELLOW, "Restricted Area!");
return 1;
}
return 1;
}
if(strcmp(cmdtext, "/ClosePDGate1", true) == 0)
{
if( IsPlayerInRangeOfPoint( playerid, 5.0, 253.220,105.377,1004.370 ) )
{
MoveObject(PDGate1,253.2209,105.3784,1002.2187, 1 );
SendClientMessage(playerid, COLOR_YELLOW, "Restricted Area!");
return 1;
}
return 1;
}
And to add new coords just add like:
pawn Код:
if(strcmp(cmdtext, "/OpenPDGate1", true) == 0)
{
if( IsPlayerInRangeOfPoint( playerid, 5.0, 253.220,105.377,1004.370 ) )
{
MoveObject(PDGate1,253.220703125,105.3779296875,1004.3708496094, 1);
SendClientMessage(playerid, COLOR_YELLOW, "Restricted Area!");
return 1;
}
if ( IsPlayerInRangeOfPoint( playerid,distance, x, y, z ) )
{
//and what happens here
}
return 1;
}