Nur CJ trotz mehrfacher spawns auswählbar

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
  • Hi Leutz,
    Ich hab folgendes Problem:
    Ich habe in meinem Script Mehrere Spawns aber kann weder Spawnen noch kann ich nen anderen Skin auswählen.
    mein OnGameModeInit:



    public OnGameModeInit()
    {


    SetGameModeText("Einzigartig's Script");
    ShowPlayerMarkers(1);
    ShowNameTags(1);
    AllowAdminTeleport(1);



    //Autos
    AddStaticVehicle(427,1530.5726,-1645.1350,6.0268,180.4013,0,1); // Enforcer LSPD 1
    AddStaticVehicle(427,1534.8274,-1645.2985,6.0498,179.8951,0,1); // Enforcer LSPD 2
    AddStaticVehicle(427,1538.7780,-1645.2235,6.0347,177.5352,0,1); // Enforcer LSPD 3
    AddStaticVehicle(523,1565.3114,-1710.3883,5.4565,353.4855,0,0); // PD Bike 1
    AddStaticVehicle(523,1563.3840,-1710.5404,5.4568,358.0430,0,0); // PD Bike 2
    AddStaticVehicle(523,1561.5129,-1710.4884,5.4503,358.6494,0,0); // PD Bike 3
    AddStaticVehicle(523,1559.6121,-1710.6447,5.4543,358.6886,0,0); // PD Bike 4
    AddStaticVehicle(523,1557.8912,-1710.6707,5.4537,359.6606,0,0); // PD Bike 5
    AddStaticVehicle(528,1545.2303,-1651.0017,5.9342,90.1886,0,0); // SwatVan 1
    AddStaticVehicle(528,1544.9811,-1654.8018,5.9335,89.1882,0,0); // SwatVan 2
    AddStaticVehicle(596,1570.1146,-1710.1862,5.6113,359.4335,0,1); // LSPD car 1
    AddStaticVehicle(596,1574.3903,-1709.5844,5.6105,359.0913,0,1); // LSPD car 2
    AddStaticVehicle(596,1578.4991,-1709.7551,5.6110,359.8535,0,1); // LSPD car 3
    AddStaticVehicle(596,1583.6681,-1710.0450,5.6122,359.1732,0,1); // LSPD car 4
    AddStaticVehicle(596,1587.5540,-1710.4807,5.6106,359.1119,0,1); // LSPD car 5
    AddStaticVehicle(596,1591.4539,-1709.8148,5.6123,358.8456,0,1); // LSPD car 6
    AddStaticVehicle(596,1595.5105,-1709.9706,5.6118,0.1923,0,1); // LSPD car 7
    AddStaticVehicle(596,1600.8456,-1704.2832,5.6116,89.4852,0,1); // LSPD car 8
    AddStaticVehicle(497,1566.3271,-1650.0699,28.5767,91.5854,0,1); // LSPD Helicopter
    AddStaticVehicle(522,756.2055,-1354.7485,13.0776,318.2639,3,8); // NRG1 Ab hier Gang!
    AddStaticVehicle(522,754.4647,-1353.7637,13.0670,327.0181,8,82); // NRG2
    AddStaticVehicle(522,751.3757,-1354.6395,13.0623,323.9637,8,82); // NRG2(!)
    AddStaticVehicle(522,748.8428,-1354.3342,13.0632,319.1028,36,105); // NRG4(!)
    AddStaticVehicle(522,746.8588,-1354.0972,13.0686,320.6178,7,79); // NRG5(!)
    AddStaticVehicle(522,744.7500,-1354.1030,13.0692,325.3074,51,118); // NRG6(!)
    AddStaticVehicle(522,742.7025,-1353.9644,13.0697,327.6125,39,106); // NRG7(!)
    AddStaticVehicle(560,736.6791,-1334.1742,13.2467,212.4891,9,39); // Sultan1(!)
    AddStaticVehicle(560,741.1111,-1333.1355,13.2482,212.8756,41,29); // Sultan(2)
    AddStaticVehicle(560,746.4879,-1333.1659,13.2482,214.1816,56,29); // Sultan(3)
    AddStaticVehicle(560,751.2743,-1332.8427,13.2493,213.7561,52,39); // Sultan(4)
    AddStaticVehicle(560,756.5333,-1332.6675,13.2498,216.4197,9,39); // Sultan(5)
    AddStaticVehicle(548,741.4977,-1368.2910,27.3409,303.9230,0,0); // Cargoboy
    //OBJEKTE
    pd1_gate = CreateObject(974, 1588.3318+3,-1637.8712,13.4276, 0.000000, 0.000000, 0.000000);
    pd2_gate = CreateObject(974, 1588.3318-3,-1637.8712,13.4276, 0.000000, 0.000000, 0.000000);
    gang1_gate = CreateObject(969, 773.29473876953, -1384.7893066406, 13.531056404114, 0, 0, 0.10000610351563);
    gang2_gate = CreateObject(969, 773.4580078125, -1330.1999511719, 13.359999656677, 0, 0, 359);
    //Spawns
    AddPlayerClass(280,1552.7234,-1694.6600,6.2188,175.7105,24,250,29,1500,25,150); //COP
    AddPlayerClass(281,1552.7234,-1694.6600,6.2188,175.7105,24,250,29,1500,25,150); //COP
    AddPlayerClass(282,1552.7234,-1694.6600,6.2188,175.7105,24,250,29,1500,25,150); //COP
    AddPlayerClass(283,1552.7234,-1694.6600,6.2188,175.7105,24,250,29,1500,25,150); //COP
    AddPlayerClass(288,1552.7234,-1694.6600,6.2188,175.7105,24,250,29,1500,25,150); //COP
    AddPlayerClass(284,1552.7234,-1694.6600,6.2188,175.7105,24,250,29,1500,25,150); //COP
    AddPlayerClass(285,1552.7234,-1694.6600,6.2188,175.7105,24,250,29,1500,25,150); //COP
    AddPlayerClass(283,1567.3881,-1695.1967,5.8906,174.3132,0,0,0,0,0,0); // spawn PD Garage4 (5 6 12-15 PD Skins) 4
    AddPlayerClass(282,1567.3881,-1695.1967,5.8906,174.3132,0,0,0,0,0,0); // 5
    AddPlayerClass(281,1567.3881,-1695.1967,5.8906,174.3132,0,0,0,0,0,0); // 6
    AddPlayerClass(144,738.3148,-1344.4114,13.5186,265.8338,0,0,0,0,0,0); // Gangspawn 7-10 7
    AddPlayerClass(180,738.3148,-1344.4114,13.5186,265.8338,0,0,0,0,0,0); // Gangspawn 7-10 8
    AddPlayerClass(19,738.3148,-1344.4114,13.5186,265.8338,0,0,0,0,0,0); // Gangspawn 7-10 9
    AddPlayerClass(21,738.3148,-1344.4114,13.5186,265.8338,0,0,0,0,0,0); // Gangspawn 7-10 10
    return 1;
    }


    Wisst ihr ne Lösung?
    Danke im vorraus :)


    mfg

  • Ich Poste ma das Ganze Script xD ist net so lang aber ohne Includes/defines



    new pd1_gate;
    new pd2_gate;
    new gang1_gate;
    new gang2_gate;


    main()
    {
    print("\n----------------------------------");
    print(" Bare Script\n");
    print("----------------------------------\n");
    }


    public OnPlayerConnect(playerid)
    {
    GameTextForPlayer(playerid,"~w~Einzigartig's Script",5000,5);
    return 1;
    }


    public OnGameModeInit()
    {


    SetGameModeText("Einzigartig's Script");
    ShowPlayerMarkers(1);
    ShowNameTags(1);
    AllowAdminTeleport(1);



    //Autos
    AddStaticVehicle(427,1530.5726,-1645.1350,6.0268,180.4013,0,1); // Enforcer LSPD 1
    AddStaticVehicle(427,1534.8274,-1645.2985,6.0498,179.8951,0,1); // Enforcer LSPD 2
    AddStaticVehicle(427,1538.7780,-1645.2235,6.0347,177.5352,0,1); // Enforcer LSPD 3
    AddStaticVehicle(523,1565.3114,-1710.3883,5.4565,353.4855,0,0); // PD Bike 1
    AddStaticVehicle(523,1563.3840,-1710.5404,5.4568,358.0430,0,0); // PD Bike 2
    AddStaticVehicle(523,1561.5129,-1710.4884,5.4503,358.6494,0,0); // PD Bike 3
    AddStaticVehicle(523,1559.6121,-1710.6447,5.4543,358.6886,0,0); // PD Bike 4
    AddStaticVehicle(523,1557.8912,-1710.6707,5.4537,359.6606,0,0); // PD Bike 5
    AddStaticVehicle(528,1545.2303,-1651.0017,5.9342,90.1886,0,0); // SwatVan 1
    AddStaticVehicle(528,1544.9811,-1654.8018,5.9335,89.1882,0,0); // SwatVan 2
    AddStaticVehicle(596,1570.1146,-1710.1862,5.6113,359.4335,0,1); // LSPD car 1
    AddStaticVehicle(596,1574.3903,-1709.5844,5.6105,359.0913,0,1); // LSPD car 2
    AddStaticVehicle(596,1578.4991,-1709.7551,5.6110,359.8535,0,1); // LSPD car 3
    AddStaticVehicle(596,1583.6681,-1710.0450,5.6122,359.1732,0,1); // LSPD car 4
    AddStaticVehicle(596,1587.5540,-1710.4807,5.6106,359.1119,0,1); // LSPD car 5
    AddStaticVehicle(596,1591.4539,-1709.8148,5.6123,358.8456,0,1); // LSPD car 6
    AddStaticVehicle(596,1595.5105,-1709.9706,5.6118,0.1923,0,1); // LSPD car 7
    AddStaticVehicle(596,1600.8456,-1704.2832,5.6116,89.4852,0,1); // LSPD car 8
    AddStaticVehicle(497,1566.3271,-1650.0699,28.5767,91.5854,0,1); // LSPD Helicopter
    AddStaticVehicle(522,756.2055,-1354.7485,13.0776,318.2639,3,8); // NRG1 Ab hier Gang!
    AddStaticVehicle(522,754.4647,-1353.7637,13.0670,327.0181,8,82); // NRG2
    AddStaticVehicle(522,751.3757,-1354.6395,13.0623,323.9637,8,82); // NRG2(!)
    AddStaticVehicle(522,748.8428,-1354.3342,13.0632,319.1028,36,105); // NRG4(!)
    AddStaticVehicle(522,746.8588,-1354.0972,13.0686,320.6178,7,79); // NRG5(!)
    AddStaticVehicle(522,744.7500,-1354.1030,13.0692,325.3074,51,118); // NRG6(!)
    AddStaticVehicle(522,742.7025,-1353.9644,13.0697,327.6125,39,106); // NRG7(!)
    AddStaticVehicle(560,736.6791,-1334.1742,13.2467,212.4891,9,39); // Sultan1(!)
    AddStaticVehicle(560,741.1111,-1333.1355,13.2482,212.8756,41,29); // Sultan(2)
    AddStaticVehicle(560,746.4879,-1333.1659,13.2482,214.1816,56,29); // Sultan(3)
    AddStaticVehicle(560,751.2743,-1332.8427,13.2493,213.7561,52,39); // Sultan(4)
    AddStaticVehicle(560,756.5333,-1332.6675,13.2498,216.4197,9,39); // Sultan(5)
    AddStaticVehicle(548,741.4977,-1368.2910,27.3409,303.9230,0,0); // Cargoboy
    //OBJEKTE
    pd1_gate = CreateObject(974, 1588.3318+3,-1637.8712,13.4276, 0.000000, 0.000000, 0.000000);
    pd2_gate = CreateObject(974, 1588.3318-3,-1637.8712,13.4276, 0.000000, 0.000000, 0.000000);
    gang1_gate = CreateObject(969, 773.29473876953, -1384.7893066406, 13.531056404114, 0, 0, 0.10000610351563);
    gang2_gate = CreateObject(969, 773.4580078125, -1330.1999511719, 13.359999656677, 0, 0, 359);
    //Spawns
    AddPlayerClass(280,1552.7234,-1694.6600,6.2188,175.7105,24,250,29,1500,25,150); //COP
    AddPlayerClass(281,1552.7234,-1694.6600,6.2188,175.7105,24,250,29,1500,25,150); //COP
    AddPlayerClass(282,1552.7234,-1694.6600,6.2188,175.7105,24,250,29,1500,25,150); //COP
    AddPlayerClass(283,1552.7234,-1694.6600,6.2188,175.7105,24,250,29,1500,25,150); //COP
    AddPlayerClass(288,1552.7234,-1694.6600,6.2188,175.7105,24,250,29,1500,25,150); //COP
    AddPlayerClass(284,1552.7234,-1694.6600,6.2188,175.7105,24,250,29,1500,25,150); //COP
    AddPlayerClass(285,1552.7234,-1694.6600,6.2188,175.7105,24,250,29,1500,25,150); //COP
    AddPlayerClass(283,1567.3881,-1695.1967,5.8906,174.3132,0,0,0,0,0,0); // spawn PD Garage4 (5 6 12-15 PD Skins) 4
    AddPlayerClass(282,1567.3881,-1695.1967,5.8906,174.3132,0,0,0,0,0,0); // 5
    AddPlayerClass(281,1567.3881,-1695.1967,5.8906,174.3132,0,0,0,0,0,0); // 6
    AddPlayerClass(144,738.3148,-1344.4114,13.5186,265.8338,0,0,0,0,0,0); // Gangspawn 7-10 7
    AddPlayerClass(180,738.3148,-1344.4114,13.5186,265.8338,0,0,0,0,0,0); // Gangspawn 7-10 8
    AddPlayerClass(19,738.3148,-1344.4114,13.5186,265.8338,0,0,0,0,0,0); // Gangspawn 7-10 9
    AddPlayerClass(21,738.3148,-1344.4114,13.5186,265.8338,0,0,0,0,0,0); // Gangspawn 7-10 10
    return 1;
    }


    public OnPlayerCommandText(playerid, cmdtext[])
    {
    new idx;
    new cmd[256];


    cmd = strtok(cmdtext, idx);

    if (strcmp(cmdtext, "/weapons", true) == 0)
    {
    GivePlayerWeapon(playerid, WEAPON_DEAGLE, 70);
    GivePlayerWeapon(playerid, WEAPON_NITESTICK, 1);
    GivePlayerWeapon(playerid, WEAPON_M4, 500);
    GivePlayerWeapon(playerid, WEAPON_SPRAYCAN, 1500);
    GivePlayerWeapon(playerid, WEAPON_MP5, 2000);
    return 1;
    }


    if (strcmp(cmdtext, "/cmds", true) == 0)
    {
    SendClientMessage(playerid,COLOR_GREEN, "\n1Commands:\n1/weapons Fuer Waffen\n1/lspd zum LSPD");
    return 1;
    }


    if (strcmp(cmd, "/lspddach", true))
    {
    if(IsPlayerInRangeOfPoint(playerid,2.0, 1579.9001,-1634.9612,13.5615))
    {
    SetPlayerPos(playerid,1564.6764,-1665.1993,28.3956);
    SendClientMessage(playerid,COLOR_GRAD1, "Du wurdest teleportiert!");

    }
    return 1;
    }



    if (strcmp(cmd, "/lspdhof", true))
    {
    if(IsPlayerInRangeOfPoint(playerid,3.0, 1564.6764,-1665.1993,28.3956))
    {
    SetPlayerPos(playerid,1579.9001,-1634.9612,13.5615);
    SendClientMessage(playerid,COLOR_GRAD1, "Du wurdest teleportiert!");
    }
    return 1;
    }


    //TORE


    if (strcmp(cmd, "/pdopen", true))
    {
    if(IsPlayerInRangeOfPoint(playerid, 30.0, 1588.4207, -1638.1235, 13.4103))
    {
    MoveObject(pd1_gate,1588.2275+3,-1637.8712,13.4223-8,4);
    MoveObject(pd2_gate,1588.3318-3,-1637.8712,13.4276-8,4);
    SendClientMessage(playerid, COLOR_YELLOW,"ACHTUNG: Polizei Gelände!");
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD1,"Du bist zu weit weg oder nicht bei den Cops!");
    }
    return 1;
    }


    if (strcmp(cmd, "/pdclose", true))
    {
    if(IsPlayerInRangeOfPoint(playerid,30.0, 1588.4207,-1638.1235,13.4103))
    {
    MoveObject(pd1_gate,1588.2275+3,-1637.8712,13.4223,4);
    MoveObject(pd2_gate,1588.3318-3,-1637.8712,13.4276,4);
    SendClientMessage(playerid, COLOR_YELLOW,"ACHTUNG: Polizei Gelände!");
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD1,"Du bist zu weit oder nicht bei den Cops!");

    }
    return 1;
    }


    if (strcmp(cmd, "/gangopen", true))
    {
    if(IsPlayerInRangeOfPoint(playerid, 30.0, 778.2847, -1330.0176, 13.5503))
    {
    MoveObject(gang1_gate,773.29473876953, -1384.7893066406, 13.531056404114-8,4);
    MoveObject(gang2_gate,773.4580078125, -1330.1999511719, 13.359999656677-8,4);
    SendClientMessage(playerid, COLOR_YELLOW,"ACHTUNG: Gang Gelände!");
    }
    else if(IsPlayerInRangeOfPoint(playerid,30.0, 777.8217,-1385.0905,13.7197))
    {
    MoveObject(gang1_gate,773.29473876953, -1384.7893066406, 13.531056404114-8,4);
    MoveObject(gang2_gate,773.4580078125, -1330.1999511719, 13.359999656677-8,4);
    SendClientMessage(playerid, COLOR_YELLOW,"ACHTUNG: Gang Gelände!");
    }
    return 1;
    }



    if (strcmp(cmd, "/gangclose", true))
    {
    MoveObject(gang1_gate,773.29473876953, -1384.7893066406, 13.531056404114,4);
    MoveObject(gang2_gate,773.4580078125, -1330.1999511719, 13.359999656677,4);
    SendClientMessage(playerid, COLOR_YELLOW,"ACHTUNG: Gang Gelände!");
    return 1;
    }
    return 0;
    }


    public OnPlayerSpawn(playerid)
    {
    SetPlayerInterior(playerid,0);
    TogglePlayerClock(playerid,0);
    ResetPlayerMoney(playerid);
    GivePlayerMoney(playerid, 30000);
    SetPlayerSkillLevel(playerid,WEAPONSKILL_PISTOL,300);
    SetPlayerSkillLevel(playerid,WEAPONSKILL_PISTOL_SILENCED,300);
    SetPlayerSkillLevel(playerid,WEAPONSKILL_MICRO_UZI,300);
    SetPlayerSkillLevel(playerid,WEAPONSKILL_MP5,300);
    SetPlayerSkillLevel(playerid,WEAPONSKILL_AK47,300);
    SetPlayerSkillLevel(playerid,WEAPONSKILL_M4,300);
    GivePlayerWeapon(playerid,WEAPON_COLT45,100);
    GivePlayerWeapon(playerid,WEAPON_M4,300);
    GivePlayerWeapon(playerid,WEAPON_MP5,500);


    return 0;
    }


    public OnPlayerRequestClass(playerid,classid)
    {
    PlayerPlaySound(playerid, 1187, 0.0, 0.0, 0.0);
    SetPlayerInterior(playerid,11);
    SetPlayerPos(playerid,508.7362,-87.4335,998.9609);
    SetPlayerFacingAngle(playerid,0.0);
    SetPlayerCameraPos(playerid,508.7362,-83.4335,998.9609);
    SetPlayerCameraLookAt(playerid,508.7362,-87.4335,998.9609);



    return 0;
    }


    public OnPlayerUpdate(playerid)
    {
    if(!IsPlayerConnected(playerid)) return 0;


    // No weapons in interiors
    if(GetPlayerInterior(playerid) != 0 && GetPlayerWeapon(playerid) != 0) {
    SetPlayerArmedWeapon(playerid,0); // fists
    return 0; // no syncing until they change their weapon
    }


    // Don't allow minigun
    if(GetPlayerWeapon(playerid) == WEAPON_MINIGUN) {
    Kick(playerid);
    return 0;
    }


    // No jetpacks allowed
    if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK) {
    Kick(playerid);
    return 0;
    }


    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;
    }