ocmd:enter(playerid, params[])
{
for(new x; x<sizeof(fmInfo); x++)
{
if(!fmInfo[x][fff_id] || fmInfo[x][fhi_x]==0.0 || !IsPlayerInRangeOfPoint(playerid,2,fmInfo[x][fhx],fmInfo[x][fhy],fmInfo[x][fhz]))continue;
SetPlayerPos(playerid,fmInfo[x][fhi_x],fmInfo[x][fhi_y],fmInfo[x][fhi_z]);
SetPlayerInterior(playerid,fmInfo[x][ff_Interior]);
SetPlayerVirtualWorld(playerid,x);
return 1;
}
for(new i; i<sizeof(sbInfo); i++)
{
if(!IsPlayerInRangeOfPoint(playerid, 5.0, sbInfo[i][sbx], sbInfo[i][sby], sbInfo[i][sbz])) continue;
SetPlayerInterior(playerid, sbInfo[i][sbint]);
SetPlayerPos(playerid, sbInfo[i][isbx], sbInfo[i][isby], sbInfo[i][isbz]);
SetPlayerVirtualWorld(playerid, i);
return 1;
}
for(new e; e<sizeof(hInfo); e++)
{
if(!hInfo[e][h_id] || hInfo[e][ih_x]==0.0 || !IsPlayerInRangeOfPoint(playerid,2,hInfo[e][h_x],hInfo[e][h_y],hInfo[e][h_z])) continue;
SetPlayerPos(playerid,hInfo[e][ih_x],hInfo[e][ih_y],hInfo[e][ih_z]);
SetPlayerInterior(playerid,hInfo[e][h_interior]);
SetPlayerVirtualWorld(playerid,e);
return 1;
}
for(new u; u<sizeof(bInfo); u++)
{
if(!bInfo[u][b_id]||bInfo[u][ibx]==0.0||!IsPlayerInRangeOfPoint(playerid,2,bInfo[u][bx],bInfo[u][by],bInfo[u][bz]))continue;
SetPlayerPos(playerid,bInfo[u][ibx],bInfo[u][iby],bInfo[u][ibz]);
SetPlayerInterior(playerid,bInfo[u][b_interior]);
SetPlayerVirtualWorld(playerid,u);
return 1;
}
return SendClientMessage(playerid,-1,"* Sie befinden sich an keinem Eingang!");
}
ocmd:exit(playerid, params[])
{
for(new x; x<sizeof(fmInfo); x++)
{
if(GetPlayerVirtualWorld(playerid)!=x || !IsPlayerInRangeOfPoint(playerid,2,fmInfo[x][fhi_x],fmInfo[x][fhi_y],fmInfo[x][fhi_z]))continue;
SetPlayerPos(playerid, fmInfo[x][fhx], fmInfo[x][fhy], fmInfo[x][fhz]);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
return 1;
}
if(GetPlayerInterior(playerid) != 0)
{
for(new i; i<sizeof(sbInfo); i++)
{
if(!IsPlayerInRangeOfPoint(playerid, 5.0, sbInfo[i][isbx], sbInfo[i][isby], sbInfo[i][isbz])) continue;
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, sbInfo[i][sbx], sbInfo[i][sby], sbInfo[i][sbz]);
SetPlayerVirtualWorld(playerid, 0);
return 1;
}
}
for(new e; e<sizeof(hInfo); e++)
{
if(GetPlayerVirtualWorld(playerid)!=e || !IsPlayerInRangeOfPoint(playerid,2,hInfo[e][ih_x],hInfo[e][ih_y],hInfo[e][ih_z]))continue;
SetPlayerPos(playerid, hInfo[e][h_x], hInfo[e][h_y], hInfo[e][h_z]);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
return 1;
}
for(new u; u<sizeof(bInfo); u++)
{
if(GetPlayerVirtualWorld(playerid)!=u || !IsPlayerInRangeOfPoint(playerid,2,bInfo[u][ibx],bInfo[u][iby],bInfo[u][ibz]))continue;
SetPlayerPos(playerid, bInfo[u][bx], bInfo[u][by], bInfo[u][bz]);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
return 1;
}
if(IsPlayerInRangeOfPoint(playerid, 5.0, 866.91089, 1857.31665, -30.40188))//Stadthallen Exit
{
SetPlayerPos(playerid, 1481.0325,-1772.2615,18.7958);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
return 1;
}
return SendClientMessage(playerid,-1,"* Sie befinden sich an keinem Exit Punkt!");
}
Alles anzeigen
PS: Du kannst in den Schleifen auch die Variablen alle gleich nennen (nur so als Tipp) ist n bisschen übersichtlicher 