Beiträge von Fabi.StaR

    Warum geht dieses standart public net:


    Spoiler anzeigen
    public OnPlayerStateChange(playerid, newstate, oldstate)
    {
    new modelid = GetVehicleModel(GetPlayerVehicleID(playerid));
    if(newstate == PLAYER_STATE_DRIVER)
    {
    for(new i=0; i<sizeof(FsAutos); i++)
    {
    new carid = GetPlayerVehicleID(playerid);
    if(carid == FsAutos[i])
    {
    if(AutoFSaktiv[playerid] == 1 && EinsteigTut[playerid] == 1)
    {
    for (new MSG=0; MSG<=11; MSG++) SendClientMessageToAll(0xFFFFFFAA," ");
    SendClientMessage(playerid,0xA0A0A0FF,"Willkommen zur praktischen Prüfung. Als erstes musst du den Motor anlassen.");
    SendClientMessage(playerid,0xA0A0A0FF,"Das machst du mit /engine. Abschalten kannst du den Motor mit dem gleichen Befehl.");
    SendClientMessage(playerid,0xA0A0A0FF,"Wenn es dunkel ist, schalte mit /lights das Licht an. Mit diesem Befehl kannst du es");
    SendClientMessage(playerid,0xA0A0A0FF,"bei Bedarf auch wieder abschalten.");
    SendClientMessage(playerid,0xA0A0A0FF,"");
    SendClientMessage(playerid,0xA0A0A0FF,"Starte jetzt bitte den Motor.");
    EinsteigTut[playerid] = 0;
    MotorAnlasenTut[playerid] = 1;
    }
    else if(AutoFSaktiv[playerid] == 0 && EinsteigTut[playerid] == 0)
    {
    SendClientMessage(playerid,0xA0A0A0FF,"Du bist in keiner Prüfung.");
    RemovePlayerFromVehicle(playerid);
    }
    }
    }
    }
    if(newstate == PLAYER_STATE_DRIVER)
    {
    for(new i=0; i<sizeof(RentBike); i++) {
    if(BikerKey[playerid] == RentBike[i][bikerrentkey]) {
    return 1;
    }
    else
    {
    if(GetPlayerVehicleID(playerid)==RentBike[i][vehid]) {
    if(GetPlayerScore(playerid) >= 3) {
    SendClientMessage(playerid,Gelb,"[Info]: Wir vermieten diese Fahrzeuge nur an Player bis Level 3!");
    RemovePlayerFromVehicle(playerid);
    return 1;
    }
    else {
    SendClientMessage(playerid,Rot,"Dieses Fahrzeug kannst du mieten! Tippe /rentbike, wenn du nicht möchtest, dann /exit.");
    TogglePlayerControllable(playerid,0);
    return 1;
    }
    }
    }
    }
    }
    if(newstate == PLAYER_STATE_DRIVER)
    {
    for(new i=0; i<sizeof(RentCar); i++) {
    if(Key[playerid] == RentCar[i][rentkey])return 1;
    else {
    if(GetPlayerVehicleID(playerid)==RentCar[i][vehid]) {
    formatEx(playerid,Gelb,"Fahrzeug Name: %s",RentCar[i][CarName]);
    formatEx(playerid,Gelb,"Fahrzeug Preis: %i",RentCar[i][VCarPreis]);
    SendClientMessage(playerid,Rot,"Dieses Fahrzeug kannst du mieten! Tippe /rentcar, wenn du nicht möchtest, dann /exit.");
    TogglePlayerControllable(playerid,0);
    return 1;
    }
    }
    }
    }
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
    if(modelid == 472 || modelid == 473 || modelid == 493 || modelid == 595 || modelid == 484 || modelid == 430 || modelid == 453 || modelid == 452 || modelid == 446 || modelid == 454 ) {
    if(PlayerInfo[playerid][pBootschein] == 0) {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid, Rot, "Du hast keine Bootschein!");
    return 1;
    }
    }
    else if(modelid == 592 || modelid == 577 || modelid == 511 || modelid == 512 || modelid == 593 || modelid == 520 || modelid == 553 || modelid == 476 || modelid == 519 || modelid == 460 || modelid == 513 || modelid == 548 || modelid == 425 || modelid == 417 || modelid == 487 || modelid == 488 || modelid == 497 || modelid == 563 || modelid == 447 || modelid == 469 )
    {
    if(PlayerInfo[playerid][pFlugschein] == 0) {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid, Rot, "Du hast keinen Flugschein!");
    return 1;
    }
    }
    else if(modelid == 522)
    {
    if(PlayerInfo[playerid][pMotorradschein] == 0)
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid, Rot, "Du hast keinen Motorradschein!");
    return 1;
    }
    }
    else if(modelid == 481 || modelid == 509 || modelid == 510){return 1;}
    else
    {
    new carid = GetPlayerVehicleID(playerid);
    if(IsAFsAuto(carid))return 1;
    else
    {
    for(new i=0; i<sizeof(autokauf); i++)
    {
    if(PlayerInfo[playerid][pAutoschein] == 0 && GetPlayerVehicleID(playerid)!=autokauf[i][VEHID])
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid, Rot, "Du hast keinen Führerschein!");
    }
    }
    }
    }
    }
    if(newstate == PLAYER_STATE_DRIVER)
    {
    new Vehicle = GetPlayerVehicleID(playerid);
    for(new i=0; i<sizeof(OamtCars); i++)
    {
    if(Vehicle == OamtCars[i])
    {
    if(PlayerInfo[playerid][pFraktionsLeader] == 4 || PlayerInfo[playerid][pFraktionsMember] == 4)return 1;
    else{
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid, Rot, "Dieses Fahrzeug gehört dem SA-Ordnungsamt!");
    }
    return 1;
    }
    }
    }
    if(newstate == PLAYER_STATE_DRIVER)
    {
    for(new i=0; i<sizeof(autokauf); i++) {
    if(GetPlayerVehicleID(playerid)==autokauf[i][VEHID]) {
    TogglePlayerControllable(playerid,0);
    SCM(playerid, Gelb, "~*~ Autohaus ~*~");
    formatEx(playerid, Gelb,"Name: %s",autokauf[i][FahrzeugName]);
    formatEx(playerid, Gelb,"Preis: $%i",autokauf[i][CarPreis]);
    formatEx(playerid, Gelb,"Reparaturkosten: $%i",autokauf[i][RepPreis]);
    SCM(playerid, Gruen, "Um es zu kaufen, benutze: /buycar");
    SCM(playerid, Gelb,"Um das Fahrzeug zu verlassen /exit");
    }
    }
    }
    if(newstate == PLAYER_STATE_DRIVER)
    {
    new avehid = GetPlayerVehicleID(playerid), ocar = IsPlayerInAFBuyAbleCar(avehid);
    if(ocar != -1) {
    for(new i = 0; i < sizeof(fCarDealerCars); i++) {
    if(avehid==fCarDealerCars[i][fVehid]) {
    if(PlayerInfo[playerid][pFraktionsLeader] >= 8) {
    SendClientMessage(playerid, Gruen, "==============[ Fraktion´s Autohaus ]===============");
    formatEx(playerid, Weiss, "Model: %s", fCarDealerCars[i][fName]);
    formatEx(playerid, Weiss, "Preis: %d$", fCarDealerCars[i][fPrice]);
    SendClientMessage(playerid, Weiss, "Du kannst dieses Fahrzeug mit \"/buyfcar\" kaufen oder einfach wieder verlassen.");
    SendClientMessage(playerid, Gruen, "====================================================");
    return 1;
    }
    else {
    SendClientMessage(playerid, Rot, "Info: Du bist kein Leader einer Fraktion.");
    RemovePlayerFromVehicle(playerid);
    return 1;
    }
    }
    }
    }
    ocar = IsPlayerInAFactionCar(avehid);
    if(ocar != -1) {
    if(GetPlayerLeaderID(playerid) != FactionCars[ocar][fFaction]) {
    SendClientMessage(playerid, Rot, "Info: Du befindest dich nicht in der richtigen Fraktion.");
    RemovePlayerFromVehicle(playerid);
    return 1;
    }
    }
    }
    if(newstate == PLAYER_STATE_DRIVER)
    {
    if(PlayerInfo[playerid][pAdminLevel] >= 1){
    for(new f=0; f<MAX_PLAYERS; f++){
    if(GetPlayerVehicleID(playerid) == PlayerInfo[f][AdminCar]){
    return 1;}
    }
    }else{SCM(playerid,Rot,"Du bist kein Support/Admin!");}
    }
    return 1;
    }


    mfg. Fabi.StaR

    Mach doch einfach in einem stock hir ma so eine vorlage:



    stock frakname(frak)
    {
    new lol[259];
    switch(frak) {
    case 0:{lol="Zivilist";}
    case 1:{lol="LSPD";}
    }
    }


    und du frägst dann so ab:


    z.b. frakname(playerid)


    müsste gehen ^^