/DMV

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
  • Ich hab gerade nen Blackout sorry. Kann mir jemand bitte miene Fehler sagen. Ich gebe /dmv driving 10 ein :D und es geht trotzdem:


    if(strcmp(cmd, "/dmv", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if(!PlayerToPoint(2.0, playerid, -2033.1744,-117.2761,1035.1719)) return SendClientMessage(playerid, COLOR_GRAD2," You are not at the driving school !");
    if(Instructor >= 1) { return 1; }
    new x_nr[256];
    x_nr = strtok(cmdtext, idx);
    if(!strlen(x_nr))
    {
    SendClientMessage(playerid, COLOR_DRED, "|______DMV- Information______|");
    SendClientMessage(playerid, COLOR_WHITE, "Drivng license ($1500)");
    SendClientMessage(playerid, COLOR_GRAD2, "Type in /dmv driving !");
    SendClientMessage(playerid, COLOR_DRED, "|____________________________|");
    SendClientMessage(playerid, COLOR_WHITE, "USAGE: /dmv [name]");
    SendClientMessage(playerid, COLOR_WHITE, "Available names: Driving.");
    return 1;
    }
    if(strcmp(x_nr,"Driving",true) == 0)
    {
    //tmp = strtok(cmdtext, idx);
    if(!strlen(x_nr))
    {
    SendClientMessage(playerid, COLOR_WHITE, "USAGE: /dmv driving");
    return 1;
    }
    if(PlayerInfo[playerid][pCarLic] == 1) { SendClientMessage(playerid, COLOR_GRAD2," You have already a driving license !"); return 1;}
    if(GetPlayerMoney(playerid) < 2000) { SendClientMessage(playerid, COLOR_GRAD2, " You have not enough money !"); return 1;}
    SendClientMessage(playerid, COLOR_RED2, "|______DMV - Introduction______|");
    SendClientMessage(playerid, COLOR_WHITE, "If you want to park your, just remember to park on the pavement.");
    SendClientMessage(playerid, COLOR_WHITE, "Please drive slow to avoid crashes / accidents later on !");
    SendClientMessage(playerid, COLOR_WHITE, "If you are calling s.o. or writing please park your car on the pavement.");
    SendClientMessage(playerid, COLOR_WHITE, "At least please do not watch out for the traffix lights.");
    SendClientMessage(playerid, COLOR_WHITE, "We hope you enjoy playing on our Server.");
    PlayerInfo[playerid][pCarLic] = 1;
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You have bought your driving license *");
    return 1;
    }
    else
    {
    SendClientMessage(playerid, COLOR_WHITE, "USAGE: /dmv [name]");
    SendClientMessage(playerid, COLOR_WHITE, "Available names: Driving.");
    return 1;
    }
    }//not connected
    return 1;
    }

  • Also ich kann /dmv driving eingeben dann funzt es
    ich kann aber genauso /dmv drign 1 oder /dmv drivng 100000 eingeben, funzt trotzdem.^^

  • jaaa^^. Ich kann / weiß nicht wo der fehler ist -.-

  • Should work:
    if(strcmp(cmd, "/dmv", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if(!PlayerToPoint(2.0, playerid, -2033.1744,-117.2761,1035.1719)) return SendClientMessage(playerid, COLOR_GRAD2," You are not at the driving school !");
    if(Instructor >= 1) { return 1; }
    new x_nr[256];
    x_nr = strtok(cmdtext, idx);
    if(!strlen(x_nr))
    {
    SendClientMessage(playerid, COLOR_DRED, "|______DMV- Information______|");
    SendClientMessage(playerid, COLOR_WHITE, "Drivng license ($1500)");
    SendClientMessage(playerid, COLOR_GRAD2, "Type in /dmv driving !");
    SendClientMessage(playerid, COLOR_DRED, "|____________________________|");
    SendClientMessage(playerid, COLOR_WHITE, "USAGE: /dmv [name]");
    SendClientMessage(playerid, COLOR_WHITE, "Available names: Driving.");
    return 1;
    }
    if(strcmp(x_nr,"Driving",true) == 0)
    {
    //tmp = strtok(cmdtext, idx);
    if(x_nr[0] == '\0')
    {
    SendClientMessage(playerid, COLOR_WHITE, "USAGE: /dmv driving");
    return 1;
    }
    if(x_nr[8] != '\0')
    {
    return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /dmv driving");
    }
    if(PlayerInfo[playerid][pCarLic] == 1) { SendClientMessage(playerid, COLOR_GRAD2," You have already a driving license !"); return 1;}
    if(GetPlayerMoney(playerid) < 2000) { SendClientMessage(playerid, COLOR_GRAD2, " You have not enough money !"); return 1;}
    SendClientMessage(playerid, COLOR_RED2, "|______DMV - Introduction______|");
    SendClientMessage(playerid, COLOR_WHITE, "If you want to park your, just remember to park on the pavement.");
    SendClientMessage(playerid, COLOR_WHITE, "Please drive slow to avoid crashes / accidents later on !");
    SendClientMessage(playerid, COLOR_WHITE, "If you are calling s.o. or writing please park your car on the pavement.");
    SendClientMessage(playerid, COLOR_WHITE, "At least please do not watch out for the traffix lights.");
    SendClientMessage(playerid, COLOR_WHITE, "We hope you enjoy playing on our Server.");
    PlayerInfo[playerid][pCarLic] = 1;
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You have bought your driving license *");
    return 1;
    }
    else
    {
    SendClientMessage(playerid, COLOR_WHITE, "USAGE: /dmv [name]");
    SendClientMessage(playerid, COLOR_WHITE, "Available names: Driving.");
    return 1;
    }
    }//not connected
    return 1;
    }

  • Nein immernoch nciht. Ich gebe /dmv driving 11 ein uns ich bekomm ihn trotzdemn.^^
    Jemand ne Idee?

    Einmal editiert, zuletzt von Cardoso ()

  • Ich benutze GF und moechte eig dabei bleiben. aber poste mal wenns geht lass ichs so.^^

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen
  • Hier müsste gehen,
    wenn nein pls errors posten


    dcmd_dmv(playerid, params[])
    {
    new auswahl[20];
    if(sscanf(params,"s",auswahl))
    {
    SendClientMessage(playerid, COLOR_DRED, "|______DMV- Information______|");
    SendClientMessage(playerid, COLOR_WHITE, "Drivng license ($1500)");
    SendClientMessage(playerid, COLOR_GRAD2, "Type in /dmv driving !");
    SendClientMessage(playerid, COLOR_DRED, "|____________________________|");
    SendClientMessage(playerid, COLOR_WHITE, "USAGE: /dmv [name]");
    SendClientMessage(playerid, COLOR_WHITE, "Available names: Driving.");
    return 1;
    }
    else
    {
    if(strcmp(auswahl,"Driving",true)==0)
    {
    if(PlayerInfo[playerid][pCarLic] == 1) { SendClientMessage(playerid, COLOR_GRAD2," You have already a driving license !"); return 1;}
    if(GetPlayerMoney(playerid) < 2000) { SendClientMessage(playerid, COLOR_GRAD2, " You have not enough money !"); return 1;}
    SendClientMessage(playerid, COLOR_RED2, "|______DMV - Introduction______|");
    SendClientMessage(playerid, COLOR_WHITE, "If you want to park your, just remember to park on the pavement.");
    SendClientMessage(playerid, COLOR_WHITE, "Please drive slow to avoid crashes / accidents later on !");
    SendClientMessage(playerid, COLOR_WHITE, "If you are calling s.o. or writing please park your car on the pavement.");
    SendClientMessage(playerid, COLOR_WHITE, "At least please do not watch out for the traffix lights.");
    SendClientMessage(playerid, COLOR_WHITE, "We hope you enjoy playing on our Server.");
    PlayerInfo[playerid][pCarLic] = 1;
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You have bought your driving license *");
    }
    else
    SendClientMessage(playerid, COLOR_WHITE, "USAGE: /dmv [name]");
    }
    return 1;
    }

  • #define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
    Hab nur die von dcmd da, sscanf is iwo im Include bei mir :S