Beiträge von Tony__Young

    Wie kann ich in diesen Befehl machen, dass man der Fraktion 1 und Fraktion 2 keine Wanteds geben kann?


    ocmd:su(playerid,params[])
    {
    new pID, anzahl, grund[128];
    if(!IstSpielerEinFrak(playerid,1) || !IstSpielerEinFrak(playerid,2))return SendClientMessage(playerid,Grau,"Du bist nicht beim SAPD/FBI.");
    if(!IsPlayerConnected(pID))return SendClientMessage(playerid,Grau,"Der Spieler ist nicht online.");
    if(sscanf(params,"uds",pID,anzahl,grund))return SendClientMessage(playerid,Grau,"Benutze: /su [ID/Teilname] [Anzahl] [Grund]");
    new string[128],string1[128];
    format(string,sizeof(string),"Du hast von %s %i Wanteds erhalten, Grund: %s",SpielerName(playerid),anzahl,grund);
    SendClientMessage(pID,Blau,string);
    format(string1,sizeof(string1),"Du hast %s %i Wanteds gegeben, Grund: %s",SpielerName(pID),anzahl,grund);
    SendClientMessage(playerid,Blau,string1);
    SetPVarInt(playerid,"Wanteds",GetPVarInt(playerid,"Wanteds")+anzahl);
    new sternstring[128];
    format(sternstring,sizeof(sternstring), "] %i", GetPVarInt(pID,"Wanteds"));
    TextDrawSetString(Wantedstern, sternstring);
    TextDrawShowForPlayer(pID, Wantedstern);
    return 1;
    }

    Hier der komplette Code


    OnGameModeInIt
    SAPDCars[0] = AddStaticVehicleEx(427,1585.3521,-1671.7161,6.0266,269.4905,1,2,-1); // SAPD CAR 1
    SAPDCars[1] = AddStaticVehicleEx(523,1604.0168,-1673.5220,5.4635,87.8114,1,2,-1); // SAPD CAR 2
    SAPDCars[2] = AddStaticVehicleEx(523,1603.9473,-1675.0229,5.4593,89.2389,1,2,-1); // SAPD CAR 3
    SAPDCars[3] = AddStaticVehicleEx(523,1603.8342,-1676.5393,5.4602,91.6941,1,2,-1); // SAPD CAR 4
    SAPDCars[4] = AddStaticVehicleEx(523,1603.7131,-1678.1115,5.4553,91.9154,1,2,-1); // SAPD CAR 5
    SAPDCars[5] = AddStaticVehicleEx(601,1601.3196,-1700.0739,5.6521,91.9271,1,2,-1); // SAPD CAR 6
    SAPDCars[6] = AddStaticVehicleEx(596,1587.6716,-1709.8430,5.6114,359.7715,1,2,-1); // SAPD CAR 8
    SAPDCars[7] = AddStaticVehicleEx(596,1583.2528,-1709.8262,5.6037,0.1638,1,2,-1); // SAPD CAR 9
    SAPDCars[8] = AddStaticVehicleEx(596,1578.4626,-1709.7686,5.6115,0.2349,1,2,-1); // SAPD CAR 10
    SAPDCars[9] = AddStaticVehicleEx(596,1574.6489,-1709.7987,5.6400,359.1296,1,2,-1); // SAPD CAR 11
    SAPDCars[10] = AddStaticVehicleEx(596,1570.3115,-1709.8374,5.6195,359.1169,1,2,-1); // SAPD CAR 12
    SAPDCars[11] = AddStaticVehicleEx(599,1566.7334,-1710.0837,6.0876,359.3888,1,2,-1); // SAPD CAR 13
    SAPDCars[12] = AddStaticVehicleEx(599,1562.9813,-1710.1597,6.0874,1.2267,1,2,-1); // SAPD CAR 14
    SAPDCars[13] = AddStaticVehicleEx(599,1558.5699,-1710.1663,6.0879,0.5421,1,2,-1); // SAPD CAR 15
    SAPDCars[14] = AddStaticVehicleEx(497,1568.5175,-1619.2268,13.7236,129.8424,1,2,-1); // SAPD CAR 16
    SAPDCars[15] = AddStaticVehicleEx(497,1560.4069,-1618.6384,13.7447,131.2911,1,2,-1); // SAPD CAR 17

    FBICars[0] = AddStaticVehicleEx(597,-1574.3102,706.1736,-5.4761,89.9321,0,0,-1); // FBI CAR 1
    FBICars[1] = AddStaticVehicleEx(597,-1574.4940,710.3939,-5.4720,90.6815,0,0,-1); // FBI CAR 2
    FBICars[2] = AddStaticVehicleEx(597,-1574.5251,714.3989,-5.4785,88.8003,0,0,-1); // FBI CAR 3
    FBICars[3] = AddStaticVehicleEx(597,-1574.6255,718.5075,-5.4748,90.8785,0,0,-1); // FBI CAR 4
    FBICars[4] = AddStaticVehicleEx(597,-1574.7290,722.7316,-5.4829,89.8444,0,0,-1); // FBI CAR 5
    FBICars[5] = AddStaticVehicleEx(597,-1574.7429,726.9222,-5.4726,89.1344,0,0,-1); // FBI CAR 6
    FBICars[6] = AddStaticVehicleEx(597,-1574.8400,731.1628,-5.5040,89.2827,0,0,-1);// FBI CAR 7
    FBICars[7] = AddStaticVehicleEx(490,-1574.2908,734.4969,-5.2369,91.1991,0,0,-1); // FBI CAR 8
    FBICars[8] = AddStaticVehicleEx(490,-1574.6464,738.6685,-5.1135,91.6001,0,0,-1); // FBI CAR 9
    FBICars[9] = AddStaticVehicleEx(490,-1574.8741,742.7114,-5.1145,90.3075,0,0,-1); // FBI CAR 10
    FBICars[10] = AddStaticVehicleEx(601,-1596.1523,749.1972,-5.4818,181.9035,0,0,-1);// FBI CAR 11
    FBICars[11] = AddStaticVehicleEx(601,-1600.2805,749.0811,-5.4825,180.0914,0,0,-1); // FBI CAR 12
    FBICars[12] = AddStaticVehicleEx(528,-1604.3785,748.5242,-5.1984,181.3626,0,0,-1); // FBI CAR 13
    FBICars[13] = AddStaticVehicleEx(528,-1608.5686,748.4879,-5.1960,180.9473,0,0,-1); // FBI CAR 14
    FBICars[14] = AddStaticVehicleEx(427,-1616.6077,733.2078,-5.1098,359.7618,0,0,-1); // FBI CAR 15
    FBICars[15] = AddStaticVehicleEx(427,-1612.2977,733.0470,-5.1096,1.1140,0,0,-1); // FBI CAR 16
    FBICars[16] = AddStaticVehicleEx(497,-1682.6982,701.0949,30.7158,90.7800,0,0,-1); // FBI CAR 17
    FBICars[17] = AddStaticVehicleEx(497,-1681.7643,713.3940,30.7148,91.8609,0,0,-1); // FBI CAR 18



    OAMTCars[0] = AddStaticVehicleEx(599,-2512.1951,418.6749,27.9717,324.1841,6,1,-1); // OAMT CAR 1
    OAMTCars[1] = AddStaticVehicleEx(599,-2508.7649,416.1867,27.9744,323.1884,6,1,-1); // OAMT CAR 2
    OAMTCars[2] = AddStaticVehicleEx(599,-2505.5142,413.4001,27.9764,323.9255,6,1,-1); // OAMT CAR 3
    OAMTCars[3] = AddStaticVehicleEx(599,-2501.9998,410.6679,27.9758,322.6888,6,1,-1);// OAMT CAR 4
    OAMTCars[4] = AddStaticVehicleEx(525,-2489.7695,400.6960,27.6599,322.0904,6,1,-1);// OAMT CAR 5
    OAMTCars[5] = AddStaticVehicleEx(525,-2486.4094,398.1165,27.6537,321.3663,6,1,-1); // OAMT CAR 6
    OAMTCars[6] = AddStaticVehicleEx(525,-2483.3093,395.6796,27.6593,321.5279,6,1,-1);// OAMT CAR 7
    OAMTCars[7] = AddStaticVehicleEx(525,-2480.3650,393.1850,27.6621,321.4998,6,1,-1); // OAMT CAR 8
    OAMTCars[8] = AddStaticVehicleEx(525,-2470.5171,407.3222,27.6505,137.6622,6,1,-1); // OAMT CAR 9
    OAMTCars[9] = AddStaticVehicleEx(525,-2473.6660,410.2736,27.6485,138.5091,6,1,-1); // OAMT CAR 10
    OAMTCars[10] = AddStaticVehicleEx(525,-2476.9709,413.1853,27.6513,136.72596,6,1,-1); // OAMT CAR 11
    OAMTCars[11] = AddStaticVehicleEx(525,-2480.2837,416.0178,27.6715,138.0964,6,1,-1); // OAMT CAR 12
    OAMTCars[12] = AddStaticVehicleEx(525,-2483.6772,419.0681,27.6443,139.0645,6,1,-1); // OAMT CAR 13

    SANICars[0] = AddStaticVehicleEx(598,1105.4741,-1313.7990,13.4301,176.6399,1,3,-1); // Sanitäter Fahrzeug 1
    SANICars[1] = AddStaticVehicleEx(598,1100.6111,-1313.4724,13.4258,178.3565,1,3,-1); // Sanitäter Fahrzeug 2
    SANICars[2] = AddStaticVehicleEx(598,1096.5953,-1313.5376,13.4278,179.3785,1,3,-1); // Sanitäter Fahrzeug 3
    SANICars[3] = AddStaticVehicleEx(598,1092.4199,-1313.6757,13.4274,180.3447,1,3,-1);// Sanitäter Fahrzeug 4
    SANICars[4] = AddStaticVehicleEx(416,1099.8782,-1330.0494,13.3093,359.6877,1,3,-1); // Sanitäter Fahrzeug 5
    SANICars[5] = AddStaticVehicleEx(416,1113.0802,-1330.0072,13.3150,0.8589,1,3,-1); // Sanitäter Fahrzeug 6
    SANICars[6] = AddStaticVehicleEx(416,1126.2831,-1330.3940,13.2814,1.1854,1,3,-1); // Sanitäter Fahrzeug 7
    SANICars[7] = AddStaticVehicleEx(416,1178.1516,-1308.6729,13.9995,269.4755,1,3,-1); // Sanitäter Fahrzeug 8
    SANICars[8] = AddStaticVehicleEx(416,1178.5493,-1338.6742,14.0143,269.9816,1,3,-1); // Sanitäter Fahrzeug 9
    SANICars[9] = AddStaticVehicleEx(487,1160.9934,-1318.7725,31.6696,266.3545,1,3,-1); // Sanitäter Fahrzeug 10

    SANNEWSCar[0] = AddStaticVehicleEx(582,-330.3810,1515.7723,75.4159,359.9931,1,6,-1); // San News 1
    SANNEWSCar[1] = AddStaticVehicleEx(582,-333.3504,1515.8738,75.4183,0.2379,1,6,-1); // San News 2
    SANNEWSCar[2] = AddStaticVehicleEx(582,-336.5885,1515.8445,75.4798,359.4250,1,6,-1); // San News 3
    SANNEWSCar[3] = AddStaticVehicleEx(582,-339.6913,1515.9750,75.4786,0.0370,1,6,-1); // San News 4
    SANNEWSCar[4] = AddStaticVehicleEx(582,-342.8029,1515.9719,75.4106,0.6382,1,6,-1); // San News 5
    SANNEWSCar[5] = AddStaticVehicleEx(582,-345.8575,1516.0381,75.4278,0.6969,1,6,-1); // San News 6
    SANNEWSCar[6] = AddStaticVehicleEx(488,-372.0678,1548.9928,75.7404,173.8108,1,6,-1); // San News 7

    HITMANCars[0] = AddStaticVehicleEx(487,-706.1685,972.3686,12.6273,124.4253,0,0,-1);// Hitman Car 1
    HITMANCars[1] = AddStaticVehicleEx(560,-704.5530,945.6820,12.1124,359.4291,0,0,-1); // Hitman Car 2
    HITMANCars[2] = AddStaticVehicleEx(560,-701.1177,945.7097,12.0583,359.3200,0,0,-1); // Hitman Car 3
    HITMANCars[3] = AddStaticVehicleEx(560,-697.7172,946.9893,12.0075,359.5901,0,0,-1); // Hitman Car 4
    HITMANCars[4] = AddStaticVehicleEx(560,-681.8445,947.0164,11.8573,358.8368,0,0,-1); // Hitman Car 5
    HITMANCars[5] = AddStaticVehicleEx(482,-678.7370,946.6522,12.3091,0.5173,0,0,-1); // Hitman Car 6
    HITMANCars[6] = AddStaticVehicleEx(482,-675.6043,946.0536,12.2664,357.1755,0,0,-1); // Hitman Car 7
    HITMANCars[7] = AddStaticVehicleEx(461,-670.7305,947.2611,11.7317,17.5150,0,0,-1); // Hitman Car 8
    HITMANCars[8] = AddStaticVehicleEx(461,-672.1148,947.4091,11.7054,16.3802,0,0,-1); // Hitman Car 9

    YAKUZACar[0] = AddStaticVehicleEx(461,2603.2454,1852.2365,10.4060,271.4685,0,0,-1); // Yakuza Car 1
    YAKUZACar[1] = AddStaticVehicleEx(461,2603.2620,1850.9357,10.4002,261.5122,0,0,-1); // Yakuza Car 1
    YAKUZACar[2] = AddStaticVehicleEx(461,2603.0657,1849.2218,10.4069,269.8260,0,0,-1); // Yakuza Car 3
    YAKUZACar[3] = AddStaticVehicleEx(560,2602.9370,1856.2314,10.5260,269.2234,0,0,-1); // Yakuza Car 4
    YAKUZACar[4] = AddStaticVehicleEx(560,2602.9988,1859.6107,10.5260,269.8380,0,0,-1); // Yakuza Car 5
    YAKUZACar[5] = AddStaticVehicleEx(560,2603.2710,1862.4814,10.5258,270.1390,0,0,-1); // Yakuza Car 6
    YAKUZACar[6] = AddStaticVehicleEx(560,2591.8250,1862.5389,10.4572,88.7292,0,0,-1); // Yakuza Car 7
    YAKUZACar[7] = AddStaticVehicleEx(560,2592.0317,1859.3348,10.5268,89.2080,0,0,-1); // Yakuza Car 8
    YAKUZACar[8] = AddStaticVehicleEx(560,2591.9348,1856.0990,10.5263,90.4305,0,0,-1); // Yakuza Car 9
    YAKUZACar[9] = AddStaticVehicleEx(482,2591.3767,1852.9430,10.9386,89.3847,0,0,-1); // Yakuza Car 10
    YAKUZACar[10] = AddStaticVehicleEx(482,2591.4368,1849.6564,10.9366,90.2349,0,0,-1); // Yakuza Car 11
    YAKUZACar[11] = AddStaticVehicleEx(487,2618.0459,1891.5485,10.9974,179.2839,0,0,-1); // Yakuza Car 12

    GROVECar[0] = AddStaticVehicleEx(487,2507.0342,-1684.0548,13.7302,41.6354,16,16,-1);// Grove Car 1
    GROVECar[1] = AddStaticVehicleEx(567,2492.1812,-1683.1298,13.2869,91.1192,16,16,-1); // Grove Car 2
    GROVECar[2] = AddStaticVehicleEx(567,2485.3689,-1683.1947,13.2890,89.6773,16,16,-1); // Grove Car 3
    GROVECar[3] = AddStaticVehicleEx(461,2475.7932,-1687.3566,13.0881,345.9627,16,16,-1); // Grove Car 4
    GROVECar[4] = AddStaticVehicleEx(461,2474.7759,-1687.1990,13.0941,347.0066,16,16,-1); // Grove Car 5
    GROVECar[5] = AddStaticVehicleEx(567,2485.0718,-1654.7982,13.2620,90.0917,16,16,-1); // Grove Car 6
    GROVECar[6] = AddStaticVehicleEx(567,2491.6458,-1654.5538,13.2696,91.1217,16,16,-1); // Grove Car 7

    RIFACar[0] = AddStaticVehicleEx(461,-1698.8738,1339.1226,6.7498,118.3082,2,2,-1); // Rifa Car 1
    RIFACar[1] = AddStaticVehicleEx(567,-1695.7762,1337.5426,7.0471,135.0337,2,2,-1); // Rifa Car 2
    RIFACar[2] = AddStaticVehicleEx(461,-1704.9875,1345.0643,6.7491,124.9062,2,2,-1); // Rifa Car 3
    RIFACar[3] = AddStaticVehicleEx(567,-1707.4805,1349.3831,7.0493,134.1317,2,2,-1); // Rifa Car 4
    RIFACar[4] = AddStaticVehicleEx(567,-1715.3076,1349.7472,7.0463,225.1569,2,2,-1); // Rifa Car 5
    RIFACar[5] = AddStaticVehicleEx(567,-1695.3544,1329.4346,7.0487,45.0307,2,2,-1); // Rifa Car 6
    RIFACar[6] = AddStaticVehicleEx(487,-1676.9773,1318.5215,7.3642,138.4042,2,2,-1); // Rifa Car 7


    public OnPlayerStateChange(playerid, newstate, oldstate)
    {
    if(newstate==PLAYER_STATE_DRIVER)
    {
    for(new i=0; i<sizeof(SAPDCars); i++)
    {
    if(GetPlayerVehicleID(playerid)==SAPDCars[i])
    {
    if(!IstSpielerEinFrak(playerid,1))
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,Grau,"Du bist nicht beim SAPD tätig.");
    }
    }
    }
    }
    if(newstate==PLAYER_STATE_DRIVER)
    {
    for(new i=0; i<sizeof(FBICars); i++)
    {
    if(GetPlayerVehicleID(playerid)==FBICars[i])
    {
    if(!IstSpielerEinFrak(playerid,2))
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,Grau,"Du bist nicht beim FBI tätig.");
    }
    }
    }
    }
    if(newstate==PLAYER_STATE_DRIVER)
    {
    for(new i=0; i<sizeof(OAMTCars); i++)
    {
    if(GetPlayerVehicleID(playerid)==OAMTCars[i])
    {
    if(!IstSpielerEinFrak(playerid,3))
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,Grau,"Du bist nicht beim Ordnungsamt tätig.");
    }
    }
    }
    }
    if(newstate==PLAYER_STATE_DRIVER)
    {
    for(new i=0; i<sizeof(SANICars); i++)
    {
    if(GetPlayerVehicleID(playerid)==SANICars[i])
    {
    if(!IstSpielerEinFrak(playerid,4))
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,Grau,"Du bist nicht bei den Sanitätern tätig.");
    }
    }
    }
    }
    if(newstate==PLAYER_STATE_DRIVER)
    {
    for(new i=0; i<sizeof(SANNEWSCar); i++)
    {
    if(GetPlayerVehicleID(playerid)==SANNEWSCar[i])
    {
    if(!IstSpielerEinFrak(playerid,5))
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,Grau,"Du bist nicht bei San News tätig.");
    }
    }
    }
    }
    if(newstate==PLAYER_STATE_DRIVER)
    {
    for(new i=0; i<sizeof(HITMANCars); i++)
    {
    if(GetPlayerVehicleID(playerid)==HITMANCars[i])
    {
    if(!IstSpielerEinFrak(playerid,6))
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,Grau,"Du bist nicht bei den Hitmans tätig.");
    }
    }
    }
    }
    if(newstate==PLAYER_STATE_DRIVER)
    {
    for(new i=0; i<sizeof(YAKUZACar); i++)
    {
    if(GetPlayerVehicleID(playerid)==YAKUZACar[i])
    {
    if(!IstSpielerEinFrak(playerid,7))
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,Grau,"Du bist nicht bei der Yakuza tätig.");
    }
    }
    }
    }
    if(newstate==PLAYER_STATE_DRIVER)
    {
    for(new i=0; i<sizeof(GROVECar); i++)
    {
    if(GetPlayerVehicleID(playerid)==GROVECar[i])
    {
    if(!IstSpielerEinFrak(playerid,8))
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,Grau,"Du bist nicht bei der Grove Street tätig.");
    }
    }
    }
    }
    if(newstate==PLAYER_STATE_DRIVER)
    {
    for(new i=0; i<sizeof(RIFACar); i++)
    {
    if(GetPlayerVehicleID(playerid)==RIFACar[i])
    {
    if(!IstSpielerEinFrak(playerid,9))
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,Grau,"Du bist nicht bei der S.F-Rifa tätig.");
    }
    }
    }
    }
    return 1;
    }


    Aber in meinen Userdaten habe ich die Fraktions von San News...

    Ich habe den Befehl nun so
    ocmd:news(playerid,params[])
    {
    new string[128], naricht[128];
    if(!IstSpielerEinFrak(playerid,5))return SendClientMessage(playerid,Grau,"Du bist kein News Reporter.");
    if(!IsPlayerInVehicle(playerid,582) || !IsPlayerInVehicle(playerid,488))
    {
    return SendClientMessage(playerid,Grau,"Du bist in keinem News Van/Helikopter.");
    }
    if(sscanf(params,"s",naricht))return SendClientMessage(playerid,Grau,"Benutze /news [Text]");
    format(string,sizeof(string),"[News Reporter %s]: %s",SpielerName(playerid),naricht);
    SendClientMessageToAll(Orange,string);
    return 1;
    }


    Es kommt trotzdem noch das ich nicht dadrin bin, obwohl ich in News Van sitze...

    Die Fahrzeugabfrage geht nicht richtig?
    Ich kann den Befehl auch nicht im Fahrzeug verwenden?


    if(!IsPlayerInVehicle(playerid,582) && !IsPlayerInVehicle(playerid,488))return SendClientMessage(playerid,Grau,"Du bist in keinem News Van/Helikopter.");