23.05.2012, 19:42
(
Last edited by SkL_MD; 21/06/2012 at 09:20 AM.
)
Let's start:
A. To create variable which will hold if you're in the area, put on top of the script:
MAX_PLAYERS - it will replace the functions with 'playerid'.
B. To set the variable to 1, meaning that went into that area, put somewhere in a command (for example), that:
playerid - this is the player ID which will set respawnarea.
1 - indicates that the player entered the area and can not use any command.
C. To make it unable to use only a few commands in that area, if any, add them to OnPlayerCommandText (explanations are past the end line with / /):
D. To put that in / exitzone (for example) out of the area, adding that in order / exitzone:
E. Not to have bugs when a new player spawneaza connected OnPlayerConnect provides that:
PS: You can do and if in an area (no order) that the player can not use commands than those specified in the IsPlayerInZone place an order (section 2) will find OnPlayerUpdate, used with IsPlayerInRangeOfPoint and other functions for the area.
A. To create variable which will hold if you're in the area, put on top of the script:
pawn Code:
new IsPlayerInZone[ MAX_PLAYERS ];
B. To set the variable to 1, meaning that went into that area, put somewhere in a command (for example), that:
Code:
IsPlayerInZone[ playerid ] = 1;
1 - indicates that the player entered the area and can not use any command.
C. To make it unable to use only a few commands in that area, if any, add them to OnPlayerCommandText (explanations are past the end line with / /):
Code:
if( IsPlayerInZone[ playerid ] == 1 && strcmp(cmdtext, "/exitzone", true) != 0 ) return SendClientMessage( playerid, 0xFF0000FF, "EROARE: {FFFFFF}You can not get out of this area, using /exitzone !" );
Code:
IsPlayerInZone[ playerid ] = 0;
Code:
IsPlayerInZone[ playerid ] = 0;