/buylicenses Befehl

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
  • Du hast doch schon ein Lizens System oder?
    Such uns die Zielen, wo deine Lizensen usw. gespeiechert wrden in der Spielerdatei.

  • da steht if(strcmp(cmd,"/licenses",true)==0)
    {
    if(IsPlayerConnected(playerid))
    {
    new text1[20];
    new text3[20];
    new text4[20];
    new text5[20];
    new text6[20];
    new text7[20];
    new text8[20];
    new text9[20];
    if(PlayerInfo[playerid][pCarLic]) { text1 = "bestanden"; } else { text1 = "nicht bestanden"; }
    if(PlayerInfo[playerid][pFlyLic]) { text3 = "bestanden"; } else { text3 = "nicht bestanden"; }
    if(PlayerInfo[playerid][pBoatLic]) { text4 = "bestanden"; } else { text4 = "nicht bestanden"; }
    if(PlayerInfo[playerid][pFishLic]) { text5 = "bestanden"; } else { text5 = "nicht bestanden"; }
    if(PlayerInfo[playerid][pGunLic]) { text6 = "bestanden"; } else { text6 = "nicht bestanden"; }
    if(PlayerInfo[playerid][pMotoLic]) { text7 = "bestanden"; } else { text7 = "nicht bestanden"; }
    if(PlayerInfo[playerid][pLKWLic]) { text8 = "bestanden"; } else { text8 = "nicht bestanden"; }
    if(PlayerInfo[playerid][pRollerLic]) { text9 = "bestanden"; } else { text9 = "nicht bestanden"; }
    SendClientMessage(playerid, COLOR_WHITE, "|__________________ Lizenzen __________________|");
    format(string, sizeof(string), "** Führerschein: %s.", text1);
    SendClientMessage(playerid, COLOR_GREY, string);
    format(string, sizeof(string), "** Fluglizenz: %s.", text3);
    SendClientMessage(playerid, COLOR_GREY, string);
    format(string, sizeof(string), "** Segelschein: %s.", text4);
    SendClientMessage(playerid, COLOR_GREY, string);
    format(string, sizeof(string), "** Angelschein: %s.", text5);
    SendClientMessage(playerid, COLOR_GREY, string);
    format(string, sizeof(string), "** Waffenschein: %s.", text6);
    SendClientMessage(playerid, COLOR_GREY, string);
    format(string, sizeof(string), "** Motorradschein: %s.", text7);
    SendClientMessage(playerid, COLOR_GREY, string);
    format(string, sizeof(string), "** LKW Schein: %s.", text8);
    SendClientMessage(playerid, COLOR_GREY, string);
    format(string, sizeof(string), "** Rollerschein: %s.", text9);
    SendClientMessage(playerid, COLOR_GREY, string);
    SendClientMessage(playerid, COLOR_WHITE, "|______________________________________________|");
    }
    return 1;
    }
    if(strcmp(cmd,"/licensepreise",true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if(IsPlayerInFrac(playerid,11) || PlayerInfo[playerid][pAdmin] >= 1)
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_WHITE, "Benutzung: /licensepreise [Spieler ID / Name]");
    return 1;
    }
    giveplayerid = ReturnUser(tmp);
    if(IsPlayerConnected(giveplayerid))
    {
    if(giveplayerid != INVALID_PLAYER_ID)
    {
    if(ProxDetectorS(8.0, playerid, giveplayerid))
    {
    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "* %s zeigt %s die Lizens-Preise.",sendername,giveplayer);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    SendClientMessage(giveplayerid,COLOR_GRAD1," Führerschein: 3.000$ [Level 1]");
    SendClientMessage(giveplayerid,COLOR_GRAD1," Angelschein: 1.000$ [Level 1]");
    SendClientMessage(giveplayerid,COLOR_GRAD1," Segelschein: 24.000$ [Level 1]");
    SendClientMessage(giveplayerid,COLOR_GRAD1," Flugschein: 56.000$ [Level 3]");
    SendClientMessage(giveplayerid,COLOR_GRAD1," Waffenschein: 30.000$ [Level 5, Staatsfraktionen 15.000$]");
    SendClientMessage(giveplayerid,COLOR_GRAD1," LKW-Schein: 13.500$ [Level 1]");
    SendClientMessage(giveplayerid,COLOR_GRAD1," Motorradschein: 6.800$ [Level 1]");
    SendClientMessage(giveplayerid,COLOR_GRAD1," Rollerschein: 1.000$ [Level 1]");
    return 1;
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, " Dieser Spieler ist nicht in deiner Nähe !");
    return 1;
    }
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, " Dieser Spieler ist Offline !");
    return 1;
    }
    }
    }
    return 1;
    }



    if(strcmp(cmd,"/showlicenses",true)==0)
    {
    if(IsPlayerConnected(playerid))
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_WHITE, "BENUTZUNG: /showlicenses [playerid/Name]");
    return 1;
    }
    giveplayerid = ReturnUser(tmp);
    if(IsPlayerConnected(giveplayerid))
    {
    if(giveplayerid != INVALID_PLAYER_ID)
    {
    if (ProxDetectorS(8.0, playerid, giveplayerid))
    {
    if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "Du kannst dir deine Lizenzen nicht selber zeigen, gib /licenses ein für Hilfe!"); return 1; }
    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
    GetPlayerName(playerid, sendername, sizeof(sendername));
    new text1[20];
    new text3[20];
    new text4[20];
    new text5[20];
    new text6[20];
    new text9[20];
    new text10[20];
    new text12[20];
    if(PlayerInfo[playerid][pCarLic]) { text1 = "bestanden"; } else { text1 = "nicht bestanden"; }
    if(PlayerInfo[playerid][pFlyLic]) { text3 = "bestanden"; } else { text3 = "nicht bestanden"; }
    if(PlayerInfo[playerid][pBoatLic]) { text4 = "bestanden"; } else { text4 = "nicht bestanden"; }
    if(PlayerInfo[playerid][pFishLic]) { text5 = "bestanden"; } else { text5 = "nicht bestanden"; }
    if(PlayerInfo[playerid][pLKWLic]) { text9 = "bestanden"; } else { text9 = "nicht bestanden"; }
    if(PlayerInfo[playerid][pMotoLic]) { text10 = "bestanden"; } else { text10 = "nicht bestanden"; }
    if(PlayerInfo[playerid][pGunLic]) { text6 = "bestanden"; } else { text6 = "nicht bestanden"; }
    if(PlayerInfo[playerid][pRollerLic]) { text12 = "bestanden"; } else { text12 = "nicht bestanden"; }
    format(string, sizeof(string), "|__________ Lizenzen von %s __________|", sendername);
    SendClientMessage(giveplayerid, COLOR_WHITE, string);
    format(string, sizeof(string), "** Führerschein: %s.", text1);
    SendClientMessage(giveplayerid, COLOR_GREY, string);
    format(string, sizeof(string), "** Fluglizenz: %s.", text3);
    SendClientMessage(giveplayerid, COLOR_GREY, string);
    format(string, sizeof(string), "** Segelschein: %s.", text4);
    SendClientMessage(giveplayerid, COLOR_GREY, string);
    format(string, sizeof(string), "** Angelschein: %s.", text5);
    SendClientMessage(giveplayerid, COLOR_GREY, string);
    format(string, sizeof(string), "** Waffenschein: %s.", text6);
    SendClientMessage(giveplayerid, COLOR_GREY, string);
    format(string, sizeof(string), "** LKW Schein: %s.", text9);
    SendClientMessage(giveplayerid, COLOR_GREY, string);
    format(string, sizeof(string), "** Motorradschein: %s.", text10);
    SendClientMessage(giveplayerid, COLOR_GREY, string);
    format(string, sizeof(string), "** Rollerschein: %s.", text12);
    SendClientMessage(giveplayerid, COLOR_GREY, string);
    format(string, sizeof(string), "* %s hat dir seine Lizenzen gezeigt.", sendername);
    SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
    format(string, sizeof(string), "* Du hast deine Lizenzen %s gezeigt.", giveplayer);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, " Dieser Spieler ist nicht in deiner Nähe !");
    return 1;
    }
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, " Dieser Spieler ist Offline !");
    return 1;
    }
    }
    return 1;
    }

  • omcd:buylicense(playerid,params[])
    {
    ShowPlayerDialog(playerid, DIALOG_LICENSES, DIALOG_STYLE_LIST, "Lizensen", "Autolizens\nFluglizens\nBootlizens\nLKW-Lizens\nWaffenschein", "Kaufen", "Abbrechen");
    return 1;
    }


    if(dialogid == DIALOG_LICENSES)
    {
    if(response)
    {
    if(listitem == 0)
    {
    PlayerInfo[playerid][pCarLic] = 1;
    SendClientMessage(COLOR_GRAD1, "Du hast dir einen Auto-Führerschein gekauft!");
    }
    if(listitem == 1)
    {
    PlayerInfo[playerid][pFlyLic] = 1;
    SendClientMessage(COLOR_GRAD1, "Du hast dir einen Flugschein gekauft!");
    }
    if(listitem == 2)
    {
    PlayerInfo[playerid][pBoatLic] = 1;
    SendClientMessage(COLOR_GRAD1, "Du hast dir einen Bootsschein gekauft!");
    }
    if(listitem == 3)
    {
    PlayerInfo[playerid][pLKWLic] = 1;
    SendClientMessage(COLOR_GRAD1, "Du hast dir einen LKW-Führerschein gekauft!");
    }
    if(listitem == 4)
    {
    PlayerInfo[playerid][pGunLic] = 1;
    SendClientMessage(COLOR_GRAD1, "Du hast dir einen Waffenschein gekauft!");
    }
    }
    return 1;
    }


    Ganz simpel, einfach ausbauen mit Ortsangabe etc.

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


    bekomme errors C:\Users\Trixib\Desktop\Server\Server\gamemodes\Release.pwn(56967) : warning 217: loose indentation
    C:\Users\\Desktop\Server\Server\gamemodes\Release.pwn(56967) : error 017: undefined symbol "buylicense"
    C:\Users\Trixib\Desktop\Server\Server\gamemodes\Release.pwn(56968) : warning 217: loose indentation
    C:\Users\Trixib\Desktop\Server\Server\gamemodes\Release.pwn(56969) : error 017: undefined symbol "DIALOG_LICENSES"
    C:\Users\Trixib\Desktop\Server\Server\gamemodes\Release.pwn(56972) : warning 225: unreachable code
    C:\Users\Trixib\Desktop\Server\Server\gamemodes\Release.pwn(56972) : error 017: undefined symbol "DIALOG_LICENSES"
    C:\Users\Trixib\Desktop\Server\Server\gamemodes\Release.pwn(56977) : error 035: argument type mismatch (argument 2)
    C:\Users\Trixib\Desktop\Server\Server\gamemodes\Release.pwn(56982) : error 035: argument type mismatch (argument 2)
    C:\Users\Trixib\Desktop\Server\Server\gamemodes\Release.pwn(56987) : error 035: argument type mismatch (argument 2)
    C:\Users\Trixib\Desktop\Server\Server\gamemodes\Release.pwn(56992) : error 035: argument type mismatch (argument 2)
    C:\Users\TrixibDesktop\Server\Server\gamemodes\Release.pwn(56997) : error 035: argument type mismatch (argument 2)
    C:\Users\Trixib\Desktop\Server\Server\gamemodes\Release.pwn(56967) : warning 203: symbol is never used: "omcd"

  • habe ich jetz sinds 5 errors
    C:\Users\Trixib\Desktop\Server\Server\gamemodes\Release.pwn(56968) : error 017: undefined symbol "buylicense"
    C:\Users\Trixib\Desktop\Server\Server\gamemodes\Release.pwn(56970) : error 029: invalid expression, assumed zero
    C:\Users\Trixib\Desktop\Server\Server\gamemodes\Release.pwn(56970) : error 001: expected token: ";", but found ")"
    C:\Users\Trixibc\Desktop\Server\Server\gamemodes\Release.pwn(56970) : error 029: invalid expression, assumed zero
    C:\Users\Trixib\Desktop\Server\Server\gamemodes\Release.pwn(56970) : fatal error 107: too many error messages on one line