Beiträge von JustMe.77

    Huh, warum wird mir Ingame kein Dialog angezeigt :wacko:




    CMD:acmds(playerid) {



    new string[2048];
    {
    if(pData[playerid][P_Admin] < 1) return
    SendClientMessage(playerid, COLOR_RED, LV_Fail);
    }
    if(pData[playerid][P_Admin] >= 1)
    {
    format(string, sizeof(string), "%s{FF8000}/mute /unmute /kick /watch /reports /fixvw\n", string);
    }
    if(pData[playerid][P_Admin] >= 2)
    {
    format(string, sizeof(string), "%s{FF8000}/ban /unban /searchban /cuffed /aka /clearchat /hide\n", string);
    }
    if(pData[playerid][P_Admin] >= 3)
    {
    format(string, sizeof(string), "%s{FF8000}/banoff /slap /explode /cuff /uncuff /startmap /randommap\n", string);
    }
    if(pData[playerid][P_Admin] >= 4)
    {
    format(string, sizeof(string), "%s{FF8000}/lastunbans /announce\n", string);
    }
    if(pData[playerid][P_Admin] >= 5)
    {
    format(string, sizeof(string), "%s{FF8000}/savepos /gotopos /setskin /jetpack /givegun /vehicle /givevehicle /silentmode\n", string);
    }
    if(pData[playerid][P_Admin] >= 6)
    {
    format(string, sizeof(string), "%s{FF8000}/website /clearaka /changename /lock /tpgun\n", string);
    }
    if(CheckAccesName(playerid))
    {
    format(string, sizeof(string), "%s{FF0000}/giveweed /setleveloff /setlevel /exitmode /forcecmd /fakechat", string);
    }
    ShowPlayerDialog(playerid, D_AdminCmds, DIALOG_STYLE_MSGBOX, "Admin Commands", "", "Close", "");
    return 1;
    }

    @Jeffry


    Während du mir geantwortest hast, hatte ich doch eine Idee mit IsPlayerInRangeOfPoint. Ist deine Version effektiver?
    Meine sieht so aus (ungetestet):



    CMD:respawn(playerid, params[]) {



    new Float:hp;
    new playerID, Float:Pos[3] ;
    GetPlayerHealth(playerid,hp);
    GetPlayerPos(playerID,Pos[0],Pos[1],Pos[2]);
    if (hp < 70.0)
    {
    SendClientMessage(playerid, -1,"{FF1717}ERROR:{FFFFFF} You need at least {FF0000}70 HP{FFFFFF} to change your Spawn.");
    return 1;
    }
    if (IsPlayerInRangeOfPoint(playerid, 5.0, Pos[0], Pos[1], Pos[2]))
    {
    SendClientMessage(playerid, -1,"{FF1717}ERROR:{FFFFFF} You can't respawn yourself if a player is to close.");
    return 1;
    }
    else
    if(BlockRespawn[playerid] > gettime()) return
    SendClientMessage(playerid,-1, "{FF1717}ERROR:{FFFFFF} Wait {FF1717}60{FFFFFF} seconds till you can respawn yourself again.");
    {
    BlockRespawn[playerid] = gettime() + 60;
    SetPlayerRandomPos(playerid);
    SendClientMessage(playerid,-1, "Respawned succesfully.");
    }
    return 1;
    }

    Hi, habe ein Befehl erstellt womit man sich respawnen lässt. Der klappt eigentlich ganz gut, aber wenn der Spieler weniger als 70 HP hat, kann man sich trotzdem spawnen. (Error Nachricht erscheint).


    Was habe ich falsch gemacht?



    CMD:respawn(playerid, params[]) {



    new Float:hp;
    GetPlayerHealth(playerid,hp);
    if (hp < 70.0)
    {
    SendClientMessage(playerid, -1,"{FF1717}ERROR:{FFFFFF} You need at least {FF0000}70 HP{FFFFFF} to change your Spawn.");
    }
    else
    if(BlockRespawn[playerid] > gettime()) return
    SendClientMessage(playerid,-1, "{FF1717}ERROR:{FFFFFF} Wait {FF1717}60{FFFFFF} seconds till you can respawn yourself again.");
    {
    BlockRespawn[playerid] = gettime() + 60;
    SetPlayerRandomPos(playerid);
    }
    return 1;
    }

    Da erhalte ich 3 Warnings:



    C:\Users\David\Desktop\LnD\gamemodes\main.pwn(2408) : warning 213: tag mismatch
    C:\Users\David\Desktop\LnD\gamemodes\main.pwn(2408) : warning 213: tag mismatch
    C:\Users\David\Desktop\LnD\gamemodes\main.pwn(2408) : warning 202: number of arguments does not match definition



    SetPlayerProgressBarMaxValue(PB[playerid],1000.0);

    Ich habe das hier, aber ist ebenfalls auf 1000 @Jeffry
    Siehe erste Zeile.



    AtualizarPB(playerid) {
    SetPlayerProgressBarValue(playerid, PB[playerid], pData[playerid][P_Exp] / (pData[playerid][P_MExp] / 1000));
    new string[24];
    format(string, sizeof string, "%d/%d", pData[playerid][P_Exp],pData[playerid][P_MExp]);
    PlayerTextDrawSetString(playerid, ExpTexts[playerid][1], string);
    PlayerTextDrawShow(playerid, ExpTexts[playerid][1]);
    format(string, sizeof string, "Level: %d", pData[playerid][P_Level]);
    PlayerTextDrawSetString(playerid, ExpTexts[playerid][0], string);
    PlayerTextDrawShow(playerid, ExpTexts[playerid][0]);
    return 1;
    }

    Ich habe das Problem gelöst, nur ist ein kleines hinzu gekommen. Die Textdraws zeigen 0/1000 an, aber wenn sich die EXP Bar updatet, sind das immer noch 100. Weil wenn ich 50 EXP dazu erhalte, nimmt das schon die Hälfte weg weil es immer noch mit 100 kalkuliert. Weiß aber nicht wo genau ich das ändern soll, hat jemand eine Idee?

    @Jeffry


    Wieso tauchen Probleme auf wenn ich bei meiner EXP Bar die EXP von 100 auf 1000 erhöhe? Wenn ich das auf 1000 änder, sind die Login Textdraws verbuggt und noch viele mehr.


    (Sorry das einige Teile auf Portugiesisch sind)



    GivePlayerExp(playerid, exp) {
    pData[playerid][P_Exp] += exp;
    if(pData[playerid][P_Exp] >= pData[playerid][P_MExp]) {
    for(new i; i < 10; i++) {
    if(pData[playerid][P_Exp] >= pData[playerid][P_MExp]) {
    pData[playerid][P_Exp] -= pData[playerid][P_MExp];
    SetPlayerLevel(playerid, pData[playerid][P_Level]+1);
    pData[playerid][P_MExp] += 100;
    }
    else break;
    }
    }
    AtualizarPB(playerid);
    }



    AtualizarPB(playerid) {
    SetPlayerProgressBarValue(playerid, PB[playerid], pData[playerid][P_Exp] / (pData[playerid][P_MExp] / 100));
    new string[24];
    format(string, sizeof string, "%d/%d", pData[playerid][P_Exp],pData[playerid][P_MExp]);
    PlayerTextDrawSetString(playerid, ExpTexts[playerid][1], string);
    PlayerTextDrawShow(playerid, ExpTexts[playerid][1]);
    format(string, sizeof string, "Level: %d", pData[playerid][P_Level]);
    PlayerTextDrawSetString(playerid, ExpTexts[playerid][0], string);
    PlayerTextDrawShow(playerid, ExpTexts[playerid][0]);
    return 1;
    }


    Da wo 100 zweimal steht habe ich das auf 1000 geändert, dann tauchen die Probleme auf :(