02.08.2011, 01:03
The best indentation I have ever see =P
Try this one.
pawn Код:
new
objGate, // Gamemaker style :P
bool: objGateState = false
;
public OnFilterScriptInit( )
{
objGate = CreateObject( 987, 1006.49169922, -2104.39648438, 12.14295101, 0.00000000, 0.00000000, 158.46972656 );
return 1;
}
public OnFilterScriptExit( )
{
DestroyObject( objGate );
return 1;
}
public OnPlayerCommandText( playerid, cmdtext[ ] )
{
if ( !strcmp( cmdtext, "/openmaingate", true ) )
{
if ( PlayerNameIs( playerid, "Chicken0895" ) )
{
if ( IsPlayerInRangeOfPoint( playerid, 15.0, 1002.49169922, -2106.39648438, 14.14295101 ) )
{
if ( objGateState )
return SendClientMessage( playerid, -1, "Gate is already opened." );
MoveObject( objGate, 1006.49169922, -2104.39648438, 6.14295101, 1.500000 );
objGateState = true;
}
else return SendClientMessage( playerid, -1, "You aren't near of the gate." ):
}
else return SendClientMessage( playerid, -1, "You aren't Chicken0985." );
return 1;
}
if ( !strcmp( cmdtext, "/closemaingate", true ) )
{
if ( PlayerNameIs( playerid, "Chicken0895" ) )
{
if ( IsPlayerInRangeOfPoint( playerid, 15.0, 1002.49169922, -2106.39648438, 14.14295101 ) )
{
if ( !objGateState )
return SendClientMessage( playerid, -1, "Gate is already closed." );
MoveObject( objGate, 1006.49169922, -2104.39648438, 12.14295101, 1.500000 );
objGateState = false;
}
else return SendClientMessage( playerid, -1, "You aren't near of the gate." ):
}
else return SendClientMessage( playerid, -1, "You aren't Chicken0985." );
return 1;
}
return 0;
}

