pawn Код:
CMD:enter(playerid, params[])
{
// DEBUGG TESTING!!
printf("DDoorsInfo Has %d var's", sizeof(DDoorsInfo));
// You has started at "0"!
for(new b = 0; b < sizeof(DDoorsInfo); b++)
{
if(IsPlayerInRangeOfPoint(playerid, 1.0, DDoorsInfo[b][ddEnterX], DDoorsInfo[b][ddEnterY], DDoorsInfo[b][ddEnterZ]))//Checks if player is near the Enter.
{
if(DDoorsInfo[b][dLocked] == 1) return SendClientMessage(playerid, COLOR_GREY, "This Door is locked!");//Checks it it is locked/
SetPlayerPos(playerid, DDoorsInfo[b][ddExitX], DDoorsInfo[b][ddExitY], DDoorsInfo[b][ddExitZ]);
SetPlayerFacingAngle(playerid, DDoorsInfo[b][ddExitA]);
SetPlayerInterior(playerid, DDoorsInfo[b][ddInteriorInt]);
SetPlayerVirtualWorld(playerid, DDoorsInfo[b][ddInteriorVW]);
InsideDoors[playerid] = b;
break;
}
if(IsPlayerInRangeOfPoint(playerid, 2.0, DDoorsInfo[b][ddExitX], DDoorsInfo[b][ddExitY], DDoorsInfo[b][ddExitZ]) && GetPlayerVirtualWorld(playerid) == DDoorsInfo[b][ddInteriorVW])//Checks if player is in near the exit.
{
SetPlayerPos(playerid, DDoorsInfo[b][ddEnterX], DDoorsInfo[b][ddEnterY], DDoorsInfo[b][ddEnterZ]);
SetPlayerFacingAngle(playerid, DDoorsInfo[b][ddEnterA]);
SetPlayerInterior(playerid, DDoorsInfo[b][ddExteriorInt]);
SetPlayerVirtualWorld(playerid, DDoorsInfo[b][ddExteriorVW]);
InsideDoors[playerid] = 0;
break;
}
}
if (IsPlayerInRangeOfPoint(playerid,3.0,2249.8784,52.7020,26.6671))
{
SetPlayerPos(playerid,207.5627,-103.7291,1005.2578);
SetPlayerVirtualWorld(playerid, 15);
SetPlayerFacingAngle(playerid, 270);
}
return 1;
}