gekauftes Auto bei TüV Anmelden

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
  • Ok habs überarbeitet musst du komplett einfügen da da mit strtok gearbeitet wird und nich wie du das gemacht hast aber bei mir funkts jetzt
    public OnPlayerCommandText(playerid, cmdtext[])
    {
    new tmp[256];
    new idx;
    new cmd[256];
    cmd = strtok(cmdtext, idx);
    if(!strcmp(cmd ,"/changeplate",true, 14))
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)) {
    SendClientMessage(playerid, 0xaaffaaff, "Benutze: /changeplate [KFZ-Kennzeichen]");
    return 1;
    }
    else
    {

    if(IsPlayerInAnyVehicle(playerid) == 1)
    {
    new carstr[48];
    new vehiclefid = GetPlayerVehicleID(playerid);
    new pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pname,sizeof(pname));
    format(carstr,sizeof(carstr),"/Cars/%s.ini",tmp);
    new string[9];
    format(string,sizeof(string),"%s",tmp);
    new Float: vX,Float: vY,Float: vZ;
    GetPlayerPos(playerid,vX,vY,vZ);

    if(dini_Exists(carstr))
    {
    SendClientMessage(playerid,0xffaaffaa,"Server {DDFFAA} Dieses Kennzeichen ist schon Registriert ");
    }
    else
    {
    dini_Create(carstr);
    dini_IntSet(carstr,"Vehicleid",GetVehicleModel(vehiclefid));
    dini_FloatSet(carstr,"Posx",vX);
    dini_FloatSet(carstr,"Posy",vY);
    dini_FloatSet(carstr,"Posz",vZ);
    new Float:roat;
    GetPlayerFacingAngle(playerid,roat);
    dini_FloatSet(carstr,"Roatation",roat);
    dini_Set(carstr,"Schild",string);
    SendClientMessage(playerid,0xffaaffaa,"Server {DDAAFF} Dieses Kennzeichen ist nun Registriert ");
    SetVehicleNumberPlate(vehiclefid, string);
    SetVehicleToRespawn(vehiclefid);
    SetVehiclePos(vehiclefid,vX,vY,vZ);
    PutPlayerInVehicle(playerid,vehiclefid,0);
    }
    return 1;
    }
    else
    {
    SendClientMessage(playerid,0xffaaffaa,"Du musst dafür in einem Auto sitzen.");
    }
    }
    return 1;
    }
    return 0;
    }
    strtok(const string[], &index)
    {
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' '))
    {
    index++;
    }


    new offset = index;
    new result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
    result[index - offset] = string[index];
    index++;
    }
    result[index - offset] = EOS;
    return result;
    }

  • new tmp[256]; new idx; new cmd[256]; cmd = strtok(cmdtext, idx); if(!strcmp(cmd ,"/changeplate",true, 14)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, 0xaaffaaff, "Benutze: /changeplate [KFZ-Kennzeichen]"); return 1; } else { if(IsPlayerInAnyVehicle(playerid) == 1) { new carstr[48]; new vehiclefid = GetPlayerVehicleID(playerid); new pname[MAX_PLAYER_NAME]; GetPlayerName(playerid,pname,sizeof(pname)); format(carstr,sizeof(carstr),"/Cars/%s.ini",tmp); new string[9]; format(string,sizeof(string),"%s",tmp); new Float: vX,Float: vY,Float: vZ; GetPlayerPos(playerid,vX,vY,vZ); if(dini_Exists(carstr)) { SendClientMessage(playerid,0xffaaffaa,"Server {DDFFAA} Dieses Kennzeichen ist schon Registriert "); } else { dini_Create(carstr); dini_IntSet(carstr,"Vehicleid",GetVehicleModel(vehiclefid)); dini_FloatSet(carstr,"Posx",vX); dini_FloatSet(carstr,"Posy",vY); dini_FloatSet(carstr,"Posz",vZ); new Float:roat; GetPlayerFacingAngle(playerid,roat); dini_FloatSet(carstr,"Roatation",roat); dini_Set(carstr,"Schild",string); SendClientMessage(playerid,0xffaaffaa,"Server {DDAAFF} Dieses Kennzeichen ist nun Registriert "); SetVehicleNumberPlate(vehiclefid, string); SetVehicleToRespawn(vehiclefid); SetVehiclePos(vehiclefid,vX,vY,vZ); PutPlayerInVehicle(playerid,vehiclefid,0); } return 1; } else { SendClientMessage(playerid,0xffaaffaa,"Du musst dafür in einem Auto sitzen."); } } return 1; } return 0; } strtok(const string[], &index) { new length = strlen(string); while ((index < length) && (string[index] <= ' ')) { index++; } new offset = index; new result[20]; while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1))) { result[index - offset] = string[index]; index++; } result[index - offset] = EOS; return result; }



    geht Net Dann stürzt meiN pawno Compiler ab beim Compilen !

  • FAil geht net Hab es so :


    //---------------------------<[ OnPlayerCommandText ]>-------------------------------------------------------- <mark>




    public OnPlayerCommandText(playerid, cmdtext[])
    {
    new tmp[256];
    new idx;
    new cmd[256];
    cmd = strtok(cmdtext, idx);
    if(!strcmp(cmd ,"/changeplate",true, 14))
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)) {
    SendClientMessage(playerid, 0xaaffaaff, "Benutze: /changeplate [KFZ-Kennzeichen]");
    return 1;
    }
    else
    {


    if(IsPlayerInAnyVehicle(playerid) == 1)
    {
    new carstr[48];
    new vehiclefid = GetPlayerVehicleID(playerid);
    new pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pname,sizeof(pname));
    format(carstr,sizeof(carstr),"/Cars/%s.ini",tmp);
    new string[9];
    format(string,sizeof(string),"%s",tmp);
    new Float: vX,Float: vY,Float: vZ;
    GetPlayerPos(playerid,vX,vY,vZ);


    if(dini_Exists(carstr))
    {
    SendClientMessage(playerid,0xffaaffaa,"Server {DDFFAA} Dieses Kennzeichen ist schon Registriert ");
    }
    else
    {
    dini_Create(carstr);
    dini_IntSet(carstr,"Vehicleid",GetVehicleModel(vehiclefid));
    dini_FloatSet(carstr,"Posx",vX);
    dini_FloatSet(carstr,"Posy",vY);
    dini_FloatSet(carstr,"Posz",vZ);
    new Float:roat;
    GetPlayerFacingAngle(playerid,roat);
    dini_FloatSet(carstr,"Roatation",roat);
    dini_Set(carstr,"Schild",string);
    SendClientMessage(playerid,0xffaaffaa,"Server {DDAAFF} Dieses Kennzeichen ist nun Registriert ");
    SetVehicleNumberPlate(vehiclefid, string);
    SetVehicleToRespawn(vehiclefid);
    SetVehiclePos(vehiclefid,vX,vY,vZ);
    PutPlayerInVehicle(playerid,vehiclefid,0);
    }
    return 1;
    }
    else
    {
    SendClientMessage(playerid,0xffaaffaa,"Du musst dafür in einem Auto sitzen.");
    }
    }
    return 1;
    }
    return 0;
    }




    if (strcmp("/hotdog", cmdtext, true) == 0)


    und das ganz unten ins Script eingefügt:
    strtok(const string[], &index)
    {
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' '))
    {
    index++;
    }


    new offset = index;
    new result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
    result[index - offset] = string[index];
    index++;
    }
    result[index - offset] = EOS;
    return result;
    }


    Aber dann komt Paawno Compiler funktoniert nicht mehr

  • OK Auf Anfrage Machen wir das eben mal
    Bevor wir bearbeiten sieht es so aus:


    #include <a_samp>
    public OnGameModeInit()
    {
    // Don't use these lines if it's a filterscript
    SetGameModeText("Blank Script");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    return 1;
    }


    public OnGameModeExit()
    {
    return 1;
    }


    public OnPlayerRequestClass(playerid, classid)
    {
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    return 1;
    }


    public OnPlayerConnect(playerid)
    {
    return 1;
    }


    public OnPlayerDisconnect(playerid, reason)
    {
    return 1;
    }


    public OnPlayerSpawn(playerid)
    {
    return 1;
    }


    public OnPlayerDeath(playerid, killerid, reason)
    {
    return 1;
    }


    public OnVehicleSpawn(vehicleid)
    {
    return 1;
    }


    public OnVehicleDeath(vehicleid, killerid)
    {
    return 1;
    }


    public OnPlayerText(playerid, text[])
    {
    return 1;
    }


    public OnPlayerCommandText(playerid, cmdtext[])
    {
    if (strcmp("/mycommand", cmdtext, true, 10) == 0)
    {
    return 1;
    }
    return 0;
    }


    public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
    {
    return 1;
    }


    public OnPlayerExitVehicle(playerid, vehicleid)
    {
    return 1;
    }


    public OnPlayerStateChange(playerid, newstate, oldstate)
    {
    return 1;
    }


    public OnPlayerEnterCheckpoint(playerid)
    {
    return 1;
    }


    public OnPlayerLeaveCheckpoint(playerid)
    {
    return 1;
    }


    public OnPlayerEnterRaceCheckpoint(playerid)
    {
    return 1;
    }


    public OnPlayerLeaveRaceCheckpoint(playerid)
    {
    return 1;
    }


    public OnRconCommand(cmd[])
    {
    return 1;
    }


    public OnPlayerRequestSpawn(playerid)
    {
    return 1;
    }


    public OnObjectMoved(objectid)
    {
    return 1;
    }


    public OnPlayerObjectMoved(playerid, objectid)
    {
    return 1;
    }


    public OnPlayerPickUpPickup(playerid, pickupid)
    {
    return 1;
    }


    public OnVehicleMod(playerid, vehicleid, componentid)
    {
    return 1;
    }


    public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
    {
    return 1;
    }


    public OnVehicleRespray(playerid, vehicleid, color1, color2)
    {
    return 1;
    }


    public OnPlayerSelectedMenuRow(playerid, row)
    {
    return 1;
    }


    public OnPlayerExitedMenu(playerid)
    {
    return 1;
    }


    public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
    {
    return 1;
    }


    public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
    {
    return 1;
    }


    public OnRconLoginAttempt(ip[], password[], success)
    {
    return 1;
    }


    public OnPlayerUpdate(playerid)
    {
    return 1;
    }


    public OnPlayerStreamIn(playerid, forplayerid)
    {
    return 1;
    }


    public OnPlayerStreamOut(playerid, forplayerid)
    {
    return 1;
    }


    public OnVehicleStreamIn(vehicleid, forplayerid)
    {
    return 1;
    }


    public OnVehicleStreamOut(vehicleid, forplayerid)
    {
    return 1;
    }


    public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
    {
    return 1;
    }


    public OnPlayerClickPlayer(playerid, clickedplayerid, source)
    {
    return 1;
    }


    zuerst ersetzten wir diesen Teil
    public OnPlayerCommandText(playerid, cmdtext[])
    {
    if (strcmp("/mycommand", cmdtext, true, 10) == 0)
    {
    return 1;
    }
    return 0;
    }

    durch diesen:


    public OnPlayerCommandText(playerid, cmdtext[])
    {
    new tmp[256];
    new idx;
    new cmd[256];
    cmd = strtok(cmdtext, idx);
    if(!strcmp(cmd ,"/changeplate",true, 14))
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)) {
    SendClientMessage(playerid, 0xaaffaaff, "Benutze: /changeplate [KFZ-Kennzeichen]");
    return 1;
    }
    else
    {


    if(IsPlayerInAnyVehicle(playerid) == 1)
    {
    new carstr[48];
    new vehiclefid = GetPlayerVehicleID(playerid);
    new pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pname,sizeof(pname));
    format(carstr,sizeof(carstr),"/Cars/%s.ini",tmp);
    new string[9];
    format(string,sizeof(string),"%s",tmp);
    new Float: vX,Float: vY,Float: vZ;
    GetPlayerPos(playerid,vX,vY,vZ);


    if(dini_Exists(carstr))
    {
    SendClientMessage(playerid,0xffaaffaa,"Server {DDFFAA} Dieses Kennzeichen ist schon Registriert ");
    }
    else
    {
    dini_Create(carstr);
    dini_IntSet(carstr,"Vehicleid",GetVehicleModel(vehiclefid));
    dini_FloatSet(carstr,"Posx",vX);
    dini_FloatSet(carstr,"Posy",vY);
    dini_FloatSet(carstr,"Posz",vZ);
    new Float:roat;
    GetPlayerFacingAngle(playerid,roat);
    dini_FloatSet(carstr,"Roatation",roat);
    dini_Set(carstr,"Schild",string);
    SendClientMessage(playerid,0xffaaffaa,"Server {DDAAFF} Dieses Kennzeichen ist nun Registriert ");
    SetVehicleNumberPlate(vehiclefid, string);
    SetVehicleToRespawn(vehiclefid);
    SetVehiclePos(vehiclefid,vX,vY,vZ);
    PutPlayerInVehicle(playerid,vehiclefid,0);
    }
    return 1;
    }
    else
    {
    SendClientMessage(playerid,0xffaaffaa,"Du musst dafür in einem Auto sitzen.");
    }
    }
    return 1;
    }
    return 0;
    }





    und dann gehen wir in die Letzte Zeile:



    public OnPlayerStreamOut(playerid, forplayerid)
    {
    return 1;
    }


    public OnVehicleStreamIn(vehicleid, forplayerid)
    {
    return 1;
    }


    public OnVehicleStreamOut(vehicleid, forplayerid)
    {
    return 1;
    }


    public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
    {
    return 1;
    }


    public OnPlayerClickPlayer(playerid, clickedplayerid, source)
    {
    return 1;
    }
    das sind die Letzten zeilen und setzten dahinter einfach so das strtok:


    public OnPlayerStreamOut(playerid, forplayerid)
    {
    return 1;
    }


    public OnVehicleStreamIn(vehicleid, forplayerid)
    {
    return 1;
    }


    public OnVehicleStreamOut(vehicleid, forplayerid)
    {
    return 1;
    }


    public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
    {
    return 1;
    }


    public OnPlayerClickPlayer(playerid, clickedplayerid, source)
    {
    return 1;
    }
    strtok(const string[], &index)
    {
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' '))
    {
    index++;
    }


    new offset = index;
    new result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
    result[index - offset] = string[index];
    index++;
    }
    result[index - offset] = EOS;
    return result;
    }


    und fertig ist es :D
    Noch fragen :?:


    Gruß Blackybecks


  • emm ja So eina nfänger bin ich jetzut nicht kommt bei mir immernoch und why muss man vor else returnen?


    und apwno compiler error kommt immernoch


    Edit: yeah kommt 1 error das strtok schond efiniert ist ;(

    Einmal editiert, zuletzt von Vitalik19 ()

  • Blackybecks danke keine Errors nix schaue obs geht und emm könntest du mir per teamviewer in meinem Filterscript helfen Dankeschön wäre sehr nett weil da komm ich auch ent so ganz klar Danke ;) schireb dir Per Pn Tv Daten