Enter und Exit System

Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
  • Hey Leute


    Ich frage mich wie ich das Hinbekomme das mit dem Enter klappt ja schon mal ganz gut aber mit dem Exit habe ich so meine Problem....
    z.B ich Betrete die Ballas Base. Verlasse die Ballas Base.... Fahre zur Hitman Base und betrete sie, verlasse sie und im Chat steht du hast die Ballas Base verlassen und bin an der Ballas Base hat einer einen Plan? :huh::rolleyes:


    Hier mein Enter&Exit


    ocmd:exit(playerid,params[])
    {
    if(IsPlayerInRangeOfPoint(playerid,3,2807.5945,-1174.7563,1025.5703))
    {
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid,1085.0936,-1226.3617,15.8203);
    SetPlayerVirtualWorld(playerid,0);
    SetCameraBehindPlayer(playerid);
    SetPlayerFacingAngle(playerid,90);
    SendClientMessage(playerid,ROT,"Du hast die Ballas Base verlassen!");
    }
    else if(IsPlayerInRangeOfPoint(playerid,3,2807.5945,-1174.7563,1025.5703))
    {
    SetPlayerInterior(playerid, 0);
    SetPlayerVirtualWorld(playerid,0);
    SetPlayerPos(playerid,);
    SetCameraBehindPlayer(playerid);
    SetPlayerFacingAngle(playerid,90);
    SendClientMessage(playerid,ROT,"Du hast die Hitman Base verlassen!");
    }
    else if(IsPlayerInRangeOfPoint(playerid,3,2807.5945,-1174.7563,1025.5703))
    {
    SetPlayerInterior(playerid, 0);
    SetPlayerVirtualWorld(playerid,0);
    SetPlayerPos(playerid,);
    SetCameraBehindPlayer(playerid);
    SetPlayerFacingAngle(playerid,90);
    SendClientMessage(playerid,ROT,"Du hast die Groove Street Base verlassen!");
    }
    return 1;
    }


    ocmd:enter(playerid,params[])
    {
    if(IsPlayerInRangeOfPoint(playerid,2,1083.0112,-1226.5582,15.8203)) //BallasBase
    {
    SetPlayerInterior(playerid, 8);
    SetPlayerPos(playerid,2807.619873,-1171.899902,1025.570312);
    SetPlayerVirtualWorld(playerid,1);
    SetCameraBehindPlayer(playerid);
    SetPlayerFacingAngle(playerid,0);
    SendClientMessage(playerid,GELB,"Du hast die Ballas Base betreten!");
    }
    else if(IsPlayerInRangeOfPoint(playerid,2,2141.0938,-1802.1365,16.1475)) //HitmanBase
    {
    SetPlayerInterior(playerid,8);
    SetPlayerPos(playerid,2807.619873,-1171.899902,1025.570312);
    SetPlayerVirtualWorld(playerid,2);
    SetCameraBehindPlayer(playerid);
    SetPlayerFacingAngle(playerid,0);
    SendClientMessage(playerid,GELB,"Du hast die Hitman Base betreten!");
    }
    else if(IsPlayerInRangeOfPoint(playerid,2,2495.4326,-1691.1399,14.7656))//GrooveBase
    {
    SetPlayerInterior(playerid,8);
    SetPlayerPos(playerid,2807.619873,-1171.899902,1025.570312);
    SetPlayerVirtualWorld(playerid,3);
    SetCameraBehindPlayer(playerid);
    SetPlayerFacingAngle(playerid,0);
    SendClientMessage(playerid,GELB,"Du hast die Groove Street Base betreten!");
    }
    else if(IsPlayerInRangeOfPoint(playerid,2,-2719.3291,-319.1255,7.8438))//TriadenBase
    {
    SetPlayerInterior(playerid,8);
    SetPlayerPos(playerid,2807.619873,-1171.899902,1025.570312);
    SetPlayerVirtualWorld(playerid,4);
    SetCameraBehindPlayer(playerid);
    SetPlayerFacingAngle(playerid,0);
    SendClientMessage(playerid,GELB,"Du hast die Triaden Base betreten!");
    }
    else if(IsPlayerInRangeOfPoint(playerid,2,-2624.6082,1412.7472,7.0938))//RedSoldiersBase
    {
    SetPlayerInterior(playerid,8);
    SetPlayerPos(playerid,2807.619873,-1171.899902,1025.570312);
    SetPlayerVirtualWorld(playerid,5);
    SetCameraBehindPlayer(playerid);
    SetPlayerFacingAngle(playerid,0);
    SendClientMessage(playerid,GELB,"Du hast die Red Soldiers Base betreten!");
    }
    else if(IsPlayerInRangeOfPoint(playerid,2,918.8733,-1252.2760,16.2109))//O-AMTBASE
    {
    SetPlayerInterior(playerid,5);
    SetPlayerPos(playerid,322.1354,304.2434,999.1484);
    SetCameraBehindPlayer(playerid);
    SetPlayerFacingAngle(playerid,0);
    SendClientMessage(playerid,GELB,"Du hast die O-Amt Base betreten!");
    }
    else
    {
    SendClientMessage(playerid,ROT,"Du kannst hier nichts betreten!");
    }
    return 1;
    }

  • Wenn du mehrfach das gleiche interior verwenden willst musst du beim rausgehen abfragen ob er in dieser Virtuelworld ist.



    [list=1][*]if(IsPlayerInRangeOfPoint(playerid,3,2807.5945,-1174.7563,1025.5703))
    [*]{
    [*]if(!GetPlayerVirtualWorld(playerid,1))return 1;
    [*]SetPlayerInterior(playerid, 0);
    [*]SetPlayerPos(playerid,1085.0936,-1226.3617,15.8203);
    [*]SetPlayerVirtualWorld(playerid,0);
    [*]SetCameraBehindPlayer(playerid);
    [*]SetPlayerFacingAngle(playerid,90);
    [*]SendClientMessage(playerid,ROT,"Du hast die Ballas Base verlassen!");
    [*]}
    [/list]

  • Code
    if(IsPlayerInRangeOfPoint(playerid,3,2807.5945,-1174.7563,1025.5703))
    {
       if(!GetPlayerVirtualWorld(playerid,1))return 1;
       SetPlayerInterior(playerid, 0);
       SetPlayerPos(playerid,1085.0936,-1226.3617,15.8203);
       SetPlayerVirtualWorld(playerid,0);
       SetCameraBehindPlayer(playerid);
       SetPlayerFacingAngle(playerid,90);
       SendClientMessage(playerid,ROT,"Du hast die Ballas Base verlassen!");
    }
  • @Daniel_Waynee erstmal danke an dich aber bekomme diese Warnings


    C:\Users\Dustin\Desktop\SA-MP Server\gamemodes\German-Reallife.pwn(921) : warning 202: number of arguments does not match definition
    C:\Users\Dustin\Desktop\SA-MP Server\gamemodes\German-Reallife.pwn(931) : warning 202: number of arguments does not match definition
    C:\Users\Dustin\Desktop\SA-MP Server\gamemodes\German-Reallife.pwn(941) : warning 202: number of arguments does not match definition
    Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    3 Warnings.


    ocmd:exit(playerid,params[])
    {
    if(IsPlayerInRangeOfPoint(playerid,3,2807.5945,-1174.7563,1025.5703))
    {
    if(!GetPlayerVirtualWorld(playerid,1))return 1; //921
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid,1085.0936,-1226.3617,15.8203);
    SetPlayerVirtualWorld(playerid,0);
    SetCameraBehindPlayer(playerid);
    SetPlayerFacingAngle(playerid,90);
    SendClientMessage(playerid,ROT,"Du hast die Ballas Base verlassen!");
    }
    else if(IsPlayerInRangeOfPoint(playerid,3,2807.5945,-1174.7563,1025.5703))
    {
    if(!GetPlayerVirtualWorld(playerid,2))return 1; //931
    SetPlayerInterior(playerid, 0);
    SetPlayerVirtualWorld(playerid,0);
    SetPlayerPos(playerid,143.6633,-1802.3103,16.1406);
    SetCameraBehindPlayer(playerid);
    SetPlayerFacingAngle(playerid,90);
    SendClientMessage(playerid,ROT,"Du hast die Hitman Base verlassen!");
    }
    else if(IsPlayerInRangeOfPoint(playerid,3,2807.5945,-1174.7563,1025.5703))
    {
    if(!GetPlayerVirtualWorld(playerid,1))return 1; //941
    SetPlayerInterior(playerid, 0);
    SetPlayerVirtualWorld(playerid,0);
    SetPlayerPos(playerid,2495.4055,-1687.8857,13.5166);
    SetCameraBehindPlayer(playerid);
    SetPlayerFacingAngle(playerid,90);
    SendClientMessage(playerid,ROT,"Du hast die Groove Street Base verlassen!");
    }
    return 1;
    }


  • @Daniel_Waynee
    Also statt
    if(!GetPlayerVirtualWorld(playerid,1))return 1; //941


    das hier?
    if(GetPlayerVirtualWorld(playerid,!=1))return 1; //941


    weil wenn Ja dann kriege ich das hier:


    C:\Users\Dustin\Desktop\SA-MP Server\gamemodes\German-Reallife.pwn(921) : error 029: invalid expression, assumed zero
    C:\Users\Dustin\Desktop\SA-MP Server\gamemodes\German-Reallife.pwn(921) : warning 215: expression has no effect
    C:\Users\Dustin\Desktop\SA-MP Server\gamemodes\German-Reallife.pwn(921) : error 001: expected token: ";", but found ")"
    C:\Users\Dustin\Desktop\SA-MP Server\gamemodes\German-Reallife.pwn(921) : error 029: invalid expression, assumed zero
    C:\Users\Dustin\Desktop\SA-MP Server\gamemodes\German-Reallife.pwn(921) : fatal error 107: too many error messages on one line


    Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    4 Errors.

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen
  • Sieht bei mir genau so aus:
    ocmd:exit(playerid,params[])
    {
    if(IsPlayerInRangeOfPoint(playerid,3,2807.5945,-1174.7563,1025.5703))
    {
    if(GetPlayerVirtualWorld(playerid) != 1)return 1;
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid,1085.0936,-1226.3617,15.8203);
    SetPlayerVirtualWorld(playerid,0);
    SetCameraBehindPlayer(playerid);
    SetPlayerFacingAngle(playerid,90);
    SendClientMessage(playerid,ROT,"Du hast die Ballas Base verlassen!");
    }
    else if(IsPlayerInRangeOfPoint(playerid,3,2807.5945,-1174.7563,1025.5703))
    {
    if(GetPlayerVirtualWorld(playerid) != 2)return 1;
    SetPlayerInterior(playerid, 0);
    SetPlayerVirtualWorld(playerid,0);
    SetPlayerPos(playerid,143.6633,-1802.3103,16.1406);
    SetCameraBehindPlayer(playerid);
    SetPlayerFacingAngle(playerid,90);
    SendClientMessage(playerid,ROT,"Du hast die Hitman Base verlassen!");
    }
    else if(IsPlayerInRangeOfPoint(playerid,3,2807.5945,-1174.7563,1025.5703))
    {
    if(GetPlayerVirtualWorld(playerid) != 3)return 1;
    SetPlayerInterior(playerid, 0);
    SetPlayerVirtualWorld(playerid,0);
    SetPlayerPos(playerid,2495.4055,-1687.8857,13.5166);
    SetCameraBehindPlayer(playerid);
    SetPlayerFacingAngle(playerid,90);
    SendClientMessage(playerid,ROT,"Du hast die Groove Street Base verlassen!");
    }
    return 1;
    }

  • Bin nicht der beste aber versuch das mal so.



  • do.de - Domain-Offensive - Domains für alle und zu super Preisen