Spieler wird nicht aus Auto geschmissen?

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
  • HeyHoo,


    ja, wie es oben schon steht, wird der Spieler nicht aus dem Auto geschmissen.
    Hier der Code:

    Spoiler anzeigen
    public OnPlayerStateChange(playerid, newstate, oldstate)
    {
    if(newstate == PLAYER_STATE_DRIVER)
    {
    new vehicle = GetPlayerVehicleID(playerid);
    new carid = GetPlayerVehicleID(playerid);
    if(!IsPlayerNPC(playerid))
    {
    if(IsAnCar(carid))
    {
    if(SpielerInfo[playerid][pFuehrerschein] != 1)
    {
    RemovePlayerFromVehicle(playerid);
    GameTextForPlayer(playerid,"Du hast keinen Fuehrerschein!",2000,3);
    }
    }
    else if(IsAnLKW(carid))
    {
    if(SpielerInfo[playerid][pLKWschein] != 1)
    {
    RemovePlayerFromVehicle(playerid);
    GameTextForPlayer(playerid,"Du hast keinen LKW-Schein!",2000,3);
    }
    }
    else if(IsAnMoped(carid))
    {
    if(SpielerInfo[playerid][pMotorradschein] != 1)
    {
    RemovePlayerFromVehicle(playerid);
    GameTextForPlayer(playerid,"Du hast keinen Motorradschein!",2000,3);
    }
    }
    else if(IsAnPlane(carid))
    {
    if(SpielerInfo[playerid][pFlugschein] != 1)
    {
    RemovePlayerFromVehicle(playerid);
    GameTextForPlayer(playerid,"Du hast keinen Flugschein!",2000,3);
    }
    }
    else if(IsAnBoat(carid))
    {
    if(SpielerInfo[playerid][pBootschein] != 1)
    {
    RemovePlayerFromVehicle(playerid);
    GameTextForPlayer(playerid,"Du hast keinen Bootschein!",2000,3);
    }
    }
    if(Ticket[vehicle] == 0)
    {
    TextDrawShowForPlayer(playerid, Tacho[playerid]);
    GetVehicleParamsEx(vehicle,engine,lights,alarm,doors,bonnet,boot,objective);
    if(GetVehicleModel(vehicle) == 509 || GetVehicleModel(vehicle) == 481 || GetVehicleModel(vehicle) == 510)
    {
    SetVehicleParamsEx(vehicle,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
    }
    else
    {
    SendClientMessage(playerid, info, "Du kannst den Motor mit der rechten STRG-Taste ein, bzw. ausschalten!");
    }
    if(Motor[vehicle] == false)
    {
    SetVehicleParamsEx(vehicle,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
    }
    if(Tank[vehicle] < 1)
    {
    Motor[vehicle] = false;
    SetVehicleParamsEx(vehicle,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
    SendClientMessage(playerid,COLOR_LIGHTRED,"Der Tank deines Fahrzeuges ist leer!");
    SendClientMessage(playerid,COLOR_LIGHTRED,"Du musst es mit einem Kanister befüllen oder einen Mechaniker rufen!");
    }
    }
    else if(Ticket[vehicle] == 1)
    {
    new ticketpreis = Ticketpreis[vehicle];
    new str[128];
    Motor[vehicle] = false;
    SetVehicleParamsEx(vehicle,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
    format(str,sizeof(str),"Dieses Fahrzeug wurde mit einem Ticket versehen! Kosten: %d€",ticketpreis);
    SCM(playerid,COLOR_DARKRED,str);
    SCM(playerid,COLOR_DARKRED,"Du kannst das Fahrzeug mit dem Befehl /accept carticket freikaufen!");
    return 1;
    }
    }
    }
    return 1;
    }

  • Zeig mal deine Funktionen:


    IsAnCar(vehicleid)
    IsAnLKW(vehicleid)
    ...



    denke da liegt der Fehler


    ach und bekommst due den GameText angezeigt?


    We are Anonymous.


    We are Legion.


    We do not forgive.


    We do not forget.


    Expect us.

  • ach und bekommst due den GameText angezeigt?


    Nein.


    Hier die Codes:

    Spoiler anzeigen
    public IsAnLKW(carid)
    {
    new modelid = GetVehicleModel(carid);
    if(modelid == 403 || modelid == 406 || modelid == 407 || modelid == 408 || modelid == 413 || modelid == 414 || modelid == 416 || modelid == 427 || modelid == 428)
    if(modelid == 431 || modelid == 432 || modelid == 433 || modelid == 437 || modelid == 443 || modelid == 440 || modelid == 444 || modelid == 455 || modelid == 456)
    if(modelid == 459 || modelid == 478 || modelid == 482 || modelid == 486 || modelid == 498 || modelid == 499 || modelid == 514 || modelid == 515 || modelid == 524)
    if(modelid == 556 || modelid == 557 || modelid == 573 || modelid == 578 || modelid == 609)
    {
    return 1;
    }
    return 0;
    }

    Spoiler anzeigen
    public IsAnBoat(carid)
    {
    new modelid = GetVehicleModel(carid);
    if(modelid == 472 || modelid == 473 || modelid == 493 || modelid == 595 || modelid == 484 || modelid == 430 || modelid == 453 || modelid == 452 || modelid == 446 )
    if(modelid == 454 )
    {
    return 1;
    }
    return 0;
    }

    Spoiler anzeigen
    public IsAnCar(carid)
    {
    new modelid = GetVehicleModel(carid);
    if(modelid == 566 || modelid == 480 || modelid == 533 || modelid == 439 || modelid == 555 || modelid == 422 || modelid == 582 || modelid == 600 || modelid == 543 )
    if(modelid == 576 || modelid == 605 || modelid == 531 || modelid == 552 || modelid == 554 || modelid == 536 || modelid == 575 || modelid == 567 || modelid == 535 )
    if(modelid == 412 || modelid == 568 || modelid == 424 || modelid == 579 || modelid == 400 || modelid == 500 || modelid == 470 || modelid == 489 || modelid == 505 )
    if(modelid == 495 || modelid == 438 || modelid == 490 || modelid == 528 || modelid == 544 || modelid == 596 || modelid == 598 || modelid == 597 || modelid == 599 )
    if(modelid == 601 || modelid == 420 || modelid == 445 || modelid == 504 || modelid == 401 || modelid == 518 || modelid == 527 || modelid == 542 || modelid == 507 )
    if(modelid == 562 || modelid == 585 || modelid == 419 || modelid == 526 || modelid == 604 || modelid == 466 || modelid == 492 || modelid == 474 || modelid == 546 )
    if(modelid == 517 || modelid == 410 || modelid == 551 || modelid == 516 || modelid == 467 || modelid == 405 || modelid == 580 || modelid == 426 || modelid == 436 )
    if(modelid == 602 || modelid == 547 || modelid == 560 || modelid == 550 || modelid == 549 || modelid == 540 || modelid == 491 || modelid == 529 || modelid == 421 )
    if(modelid == 429 || modelid == 496 || modelid == 402 || modelid == 541 || modelid == 415 || modelid == 589 || modelid == 587 || modelid == 565 || modelid == 494 )
    if(modelid == 502 || modelid == 503 || modelid == 411 || modelid == 559 || modelid == 603 || modelid == 475 || modelid == 506 || modelid == 451 || modelid == 558 )
    if(modelid == 447 || modelid == 418 || modelid == 404 || modelid == 479 || modelid == 479 || modelid == 458 || modelid == 561 )
    {
    return 1;
    }
    return 0;
    }

    Spoiler anzeigen
    public IsAnMoped(carid)
    {
    new modelid = GetVehicleModel(carid);
    if(modelid == 462 || modelid == 448 || modelid == 581 || modelid == 522 || modelid == 461 || modelid == 521 || modelid == 523 || modelid == 463 || modelid == 468 )
    if(modelid == 471 )
    {
    return 1;
    }
    return 0;
    }

    Spoiler anzeigen
    public IsAnPlane(carid)
    {
    new modelid = GetVehicleModel(carid);
    if(modelid == 417 || modelid == 425 || modelid == 447 || modelid == 460 || modelid == 469 || modelid == 476 || modelid == 487 || modelid == 488 || modelid == 497 )
    if(modelid == 511 || modelid == 512 || modelid == 513 || modelid == 519 || modelid == 520 || modelid == 548 || modelid == 553 || modelid == 563 || modelid == 577 )
    if(modelid == 592 || modelid == 593 )
    {
    return 1;
    }
    return 0;
    }

  • So so sollte die Abfrage stimmen


    public IsAnLKW(carid)
    {
    new modelid = GetVehicleModel(carid);
    if(modelid == 403 || modelid == 406 || modelid == 407 || modelid == 408 || modelid == 413 || modelid == 414 || modelid == 416 || modelid == 427 || modelid == 428 ||
    modelid == 431 || modelid == 432 || modelid == 433 || modelid == 437 || modelid == 443 || modelid == 440 || modelid == 444 || modelid == 455 || modelid == 456 ||
    modelid == 459 || modelid == 478 || modelid == 482 || modelid == 486 || modelid == 498 || modelid == 499 || modelid == 514 || modelid == 515 || modelid == 524 ||
    modelid == 556 || modelid == 557 || modelid == 573 || modelid == 578 || modelid == 609)
    {
    return 1;
    }
    else // Wichitg else, ansonsten return nach der abfrage auch wenn er in dem Auto sitz 0
    {
    return 0;
    }
    }


    public IsAnBoat(carid)
    {
    new modelid = GetVehicleModel(carid);
    if(modelid == 472 || modelid == 473 || modelid == 493 || modelid == 595 || modelid == 484 || modelid == 430 || modelid == 453 || modelid == 452 || modelid == 446 ||
    modelid == 454 )
    {
    return 1;
    }
    else
    {
    return 0;
    }
    }


    public IsAnCar(carid)
    {
    new modelid = GetVehicleModel(carid);
    if(modelid == 566 || modelid == 480 || modelid == 533 || modelid == 439 || modelid == 555 || modelid == 422 || modelid == 582 || modelid == 600 || modelid == 543 ||
    modelid == 576 || modelid == 605 || modelid == 531 || modelid == 552 || modelid == 554 || modelid == 536 || modelid == 575 || modelid == 567 || modelid == 535 ||
    modelid == 412 || modelid == 568 || modelid == 424 || modelid == 579 || modelid == 400 || modelid == 500 || modelid == 470 || modelid == 489 || modelid == 505 ||
    modelid == 495 || modelid == 438 || modelid == 490 || modelid == 528 || modelid == 544 || modelid == 596 || modelid == 598 || modelid == 597 || modelid == 599 ||
    modelid == 601 || modelid == 420 || modelid == 445 || modelid == 504 || modelid == 401 || modelid == 518 || modelid == 527 || modelid == 542 || modelid == 507 ||
    modelid == 562 || modelid == 585 || modelid == 419 || modelid == 526 || modelid == 604 || modelid == 466 || modelid == 492 || modelid == 474 || modelid == 546 ||
    modelid == 517 || modelid == 410 || modelid == 551 || modelid == 516 || modelid == 467 || modelid == 405 || modelid == 580 || modelid == 426 || modelid == 436 ||
    modelid == 602 || modelid == 547 || modelid == 560 || modelid == 550 || modelid == 549 || modelid == 540 || modelid == 491 || modelid == 529 || modelid == 421 ||
    modelid == 429 || modelid == 496 || modelid == 402 || modelid == 541 || modelid == 415 || modelid == 589 || modelid == 587 || modelid == 565 || modelid == 494 ||
    modelid == 502 || modelid == 503 || modelid == 411 || modelid == 559 || modelid == 603 || modelid == 475 || modelid == 506 || modelid == 451 || modelid == 558 ||
    modelid == 447 || modelid == 418 || modelid == 404 || modelid == 479 || modelid == 479 || modelid == 458 || modelid == 561 )
    {
    return 1;
    }
    else
    {
    return 0;
    }
    }


    public IsAnMoped(carid)
    {
    new modelid = GetVehicleModel(carid);
    if(modelid == 462 || modelid == 448 || modelid == 581 || modelid == 522 || modelid == 461 || modelid == 521 || modelid == 523 || modelid == 463 || modelid == 468 ||
    modelid == 471 )
    {
    return 1;
    }
    else
    {
    return 0;
    }
    }


    public IsAnPlane(carid)
    {
    new modelid = GetVehicleModel(carid);
    if(modelid == 417 || modelid == 425 || modelid == 447 || modelid == 460 || modelid == 469 || modelid == 476 || modelid == 487 || modelid == 488 || modelid == 497 ||
    modelid == 511 || modelid == 512 || modelid == 513 || modelid == 519 || modelid == 520 || modelid == 548 || modelid == 553 || modelid == 563 || modelid == 577 ||
    modelid == 592 || modelid == 593 )
    {
    return 1;
    }
    else
    {
    return 0;
    }
    }


    We are Anonymous.


    We are Legion.


    We do not forgive.


    We do not forget.


    Expect us.

  • Wenn du es nicht ausprobierst kann ich dir nicht weiter helfen.


    ICh müsste um es auszurpobieren nochmal paar Sachen dazu scripten... ;)


    We are Anonymous.


    We are Legion.


    We do not forgive.


    We do not forget.


    Expect us.

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