28.05.2009, 16:50
1.I fixed the mistakes :
2.Put at OnPlayerCommandText:
If you haven't function IsPlayerInArea:
pawn Код:
if(strcmp(cmdtext, "/back", true) == 0)
{
if(BlockCmd[playerid] ==1)
{
SetPlayerPos(playerid, PosX[playerid], PosY[playerid], PosZ[playerid]);
SetPlayerFacingAngle(playerid, PosA[playerid]);
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid, PosI[playerid]);
ResetPlayerWeapon(playerid);
BlockCmd[playerid] =0;
}else SendClientMessage(playerid,0xFF0000AA, "[ERROR] You cant use /back because you're not in a dm area");
return 1;
}
pawn Код:
if(IsPlayerInArea(playerid,-957.5858, 607.2495, 2942.825, 2942.825) //LV zone
{
SendClientMessage(playerid,0xFF0000AA,"[ERROR]You are in VasVentura");
return 0;
}
pawn Код:
stock IsPlayerInArea(playerid, Float:max_x, Float:min_x, Float:max_y, Float:min_y)
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
if(X <= max_x && X >= min_x && Y <= max_y && Y >= min_y) return 1;
return 0;
}