Befehl exit funktioniert nicht.

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
  • Hallo Community,


    ich habe mir mal aus FUN ein DM Script für paar Kollegen als Homeserver geladen.


    Naya es funktioniert alles außer der Befehl exit.


    Hier ist der ocmd:




    ocmd:exit(playerid,params[])
    {
    if(GetPVarInt(playerid,"Duellieren")==0)return SendClientMessage(playerid,ROT,"FEHLER:Sie befinden sich in keiner Duel/Durby Arena.");
    {
    if(GetPVarInt(playerid,"DeagleDuel")==1)
    {
    ResetPlayerWeapons(playerid);
    SetPlayerPos(playerid,1310.1202,-1371.4332,13.5886);
    SetPVarInt(playerid,"Duellieren",0);
    SetPVarInt(playerid,"DeagleDuel",0);
    new aname[MAX_PLAYER_NAME],string[128];
    GetPlayerName(playerid, aname, sizeof(aname));
    format(string, sizeof(string), "{30FF56}%s {FFFFFF}hat die Deagle Arena {FF0000}verlassen!",aname);
    SendClientMessageToAll(WEISS,string);
    SetPVarInt(playerid,"Killstreak",0);
    }
    else if(GetPVarInt(playerid,"MP5Duel")==1)
    {
    ResetPlayerWeapons(playerid);
    SetPlayerPos(playerid,1310.1202,-1371.4332,13.5886);
    SetPVarInt(playerid,"Duellieren",0);
    SetPVarInt(playerid,"MP5Duel",0);
    new aname[MAX_PLAYER_NAME],string[128];
    GetPlayerName(playerid, aname, sizeof(aname));
    format(string, sizeof(string), "{30FF56}%s {FFFFFF}hat die MP5 Arena {FF0000}verlassen!",aname);
    SendClientMessageToAll(WEISS,string);
    SetPVarInt(playerid,"Killstreak",0);
    }
    else if(GetPVarInt(playerid,"AK47Duel")==1)
    {
    ResetPlayerWeapons(playerid);
    SetPlayerPos(playerid,1310.1202,-1371.4332,13.5886);
    SetPVarInt(playerid,"Duellieren",0);
    SetPVarInt(playerid,"AK47Duel",0);
    new aname[MAX_PLAYER_NAME],string[128];
    GetPlayerName(playerid, aname, sizeof(aname));
    format(string, sizeof(string), "{30FF56}%s {FFFFFF}hat die AK47 + Deagle Arena {FF0000}verlassen!",aname);
    SendClientMessageToAll(WEISS,string);
    SetPVarInt(playerid,"Killstreak",0);
    }
    /*else if(GetPVarInt(playerid,"M4A1Duel")==1)
    {
    ResetPlayerWeapons(playerid);
    GivePlayerWeapon(playerid,0,0);
    SetPlayerPos(playerid,1310.1202,-1371.4332,13.5886);
    SetPVarInt(playerid,"Duellieren",0);
    SetPVarInt(playerid,"M4A1Duel",0);
    new aname[MAX_PLAYER_NAME],string[128];
    GetPlayerName(playerid, aname, sizeof(aname));
    format(string, sizeof(string), "{30FF56}%s {FFFFFF}hat die M4A1 + Deagle Arena {FF0000}verlassen!",aname);
    SendClientMessageToAll(WEISS,string);
    }*/
    else if(GetPVarInt(playerid,"DurbyArena")==1)
    {
    ResetPlayerWeapons(playerid);
    SetPlayerPos(playerid,1310.1202,-1371.4332,13.5886);
    SetPVarInt(playerid,"DurbyArena",0);
    SetPVarInt(playerid,"Duellieren",0);
    new name[MAX_PLAYER_NAME], string[128];
    GetPlayerName(playerid,name,sizeof(name));
    format(string,sizeof(string),"{FF806A}[DURBY:]{00FF00}%s {FFFFFF}hat die {00FF00}Durby Arena One {FFFFFF}verlassen.",name);
    SendClientMessageToAll(WEISS,string);
    SetPVarInt(playerid,"Killstreak",0);
    }
    else if(GetPVarInt(playerid,"DurbyArena2")==1)
    {
    ResetPlayerWeapons(playerid);
    SetPlayerPos(playerid,1310.1202,-1371.4332,13.5886);
    SetPlayerInterior(playerid,0);
    SetPVarInt(playerid,"DurbyArena2",0);
    SetPVarInt(playerid,"Duellieren",0);
    new name[MAX_PLAYER_NAME], string[128];
    GetPlayerName(playerid,name,sizeof(name));
    format(string,sizeof(string),"{FF806A}[DURBY:]{00FF00}%s {FFFFFF}hat die {00FF00}Durby Arena Two {FFFFFF}verlassen.",name);
    SendClientMessageToAll(WEISS,string);
    SetPVarInt(playerid,"Killstreak",0);
    }
    }
    return 1;
    }

  • So fern kein Unknown Command kommt im Chat wird es daran liegen
    if(GetPVarInt(playerid,"DeagleDuel")==1)

    das die Spielervariabel DeagleDuel nicht auf 1 gesetzt wurde.
    Leicht kann man das überprüfen in dem man dort eine nachricht zurück geben lässt

    if(GetPVarInt(playerid,"DeagleDuel")!=1)return SendClientMessage(playerid,-1,"Du bist in keinem Deagleduel!");