Beiträge von Hagi

    Hallo Breadfisher.


    Ich habe hier so cars erstellt


    new policecar[23];



    policecar[0] = AddStaticVehicleEx(497,-1679.4922,712.8502,30.7782,90.8441,1,86,120); // Police Maverick //
    policecar[1] = AddStaticVehicleEx(497,-1679.6609,699.1047,30.7791,88.4598,1,86,120); // Police Maverick


    policecar[2] = AddStaticVehicleEx(490,-1632.4399,693.0427,-6.1152,178.7706,1,86,120); // FBI Ranger
    policecar[3] = AddStaticVehicleEx(490,-1628.7793,693.0427,-6.1143,179.2127,1,86,120); // FBI Ranger
    policecar[4] = AddStaticVehicleEx(490,-1624.8285,693.0427,-6.1148,181.7789,1,86,120); // FBI Ranger
    policecar[5] = AddStaticVehicleEx(490,-1620.7037,693.0427,-6.1135,180.6329,1,86,120); // FBI Ranger //


    policecar[6] = AddStaticVehicleEx(470,-1623.1862,649.5843,-5.2463,90.2505,1,86,120); // Patriot
    policecar[7] = AddStaticVehicleEx(470,-1623.1862,653.7045,-5.2512,91.0673,1,86,120); // Patriot
    policecar[8] = AddStaticVehicleEx(470,-1640.4189,649.7290,-5.2491,269.8438,1,86,120); // Patriot
    policecar[9] = AddStaticVehicleEx(470,-1640.4189,653.8616,-5.2473,270.1785,1,86,120); // Patriot //


    policecar[10] = AddStaticVehicleEx(523,-1600.4772,693.0427,-6.1104,179.5813,1,86,120); // HPV-1000
    policecar[11] = AddStaticVehicleEx(523,-1604.5778,693.0427,-6.1034,179.8792,1,86,120); // HPV-1000 //
    policecar[12] = AddStaticVehicleEx(523,-1608.4570,693.0427,-6.0872,179.1897,1,86,120); // HPV-1000
    policecar[13] = AddStaticVehicleEx(523,-1612.4811,693.0427,-6.1000,181.1917,1,86,120); // HPV-1000


    policecar[14] = AddStaticVehicleEx(447,-1610.5566,671.5421,7.3638,91.3163,1,86,120); // sparrow
    policecar[15] = AddStaticVehicleEx(447,-1593.3519,671.5200,7.3661,91.5293,1,86,120); // sparrow


    policecar[16] = AddStaticVehicleEx(597,-1572.1472,718.6272,-5.4765,89.9670,1,86,120); // Copcar SF 77
    policecar[17] = AddStaticVehicleEx(597,-1572.1472,722.3386,-5.4719,91.1193,1,86,120); // Copcar SF
    policecar[18] = AddStaticVehicleEx(597,-1572.1472,726.4766,-5.4724,89.4934,1,86,120); // Copcar SF
    policecar[19] = AddStaticVehicleEx(597,-1572.1472,730.8532,-5.4715,88.5915,1,86,120); // Copcar SF
    policecar[20] = AddStaticVehicleEx(597,-1572.1472,734.9302,-5.4738,89.4898,1,86,120); // Copcar SF
    policecar[21] = AddStaticVehicleEx(597,-1572.1472,738.8535,-5.4732,89.0372,1,86,120); // Copcar SF
    policecar[22] = AddStaticVehicleEx(597,-1572.1472,743.0928,-5.4743,88.8292,1,86,120); // Copcar SF


    Jetzt wollte ich so Abfragen, ob der Spieler in das Auto darf


    if(newstate == PLAYER_STATE_DRIVER)
    {
    // Police


    for(new pol = 0;pol<27;pol++)
    if(GetPlayerVehicleID(playerid) == policecar[pol])
    {
    if(gTeam[playerid] == TEAM_POLICE || adminlebencheck[playerid] == 1)
    {
    return 1;
    }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,rot,"Fehler: Du bist nicht Teil der Polizei");
    return 1;
    }
    }
    }


    Allerdings funktioniert es nicht.Jeder kann in das Auto. Weiß vllt jemand wie es funktionieren könnte ?

    Du erstellt array .


    Probiere es so



    new ArmyCar[7];
    ArmyCar[0] = AddStaticVehicle(520,2392.9043,-3161.3936,1.4392,272.8591,1,1);//Hydra
    ArmyCar[1] = AddStaticVehicle(520,2393.7998,-3150.3640,1.6423,271.6057,1,1);//Hydra
    ArmyCar[2] = AddStaticVehicle(520,2420.8149,-3163.3464,9.2512,267.5324,1,1);//Hydra
    ArmyCar[3] = AddStaticVehicle(520,2419.2703,-3155.7310,9.4992,269.4124,1,1);//Hydra
    ArmyCar[4] = AddStaticVehicle(425,2455.9512,-3192.8477,10.1950,267.1956,1,1);//Hunter
    ArmyCar[5] = AddStaticVehicle(425,2454.5784,-3167.3953,10.1951,265.6289,1,1);//Hunter
    ArmyCar[6] = AddStaticVehicle(493,2402.8916,-3082.0464,-0.9214,85.4839,1,1);//JetMax BOOT

    Erstell dir ne Variable


    new isindm[MAX_PLAYERS]


    Nun setzt du die variable "isindm[playerid] = 1;" auf 1 wenn man /dm oder so macht.


    Bei onplayerspawn überprüftst du ob die variable 1 ist. sollte dies der fall sein, wird man wieder zu dm teleportiert


    if(isindm[playerid] == 1)
    {
    SetPlayerPos(playerid,x,y,z);
    return 1;
    }

    Zu deinem zweiten Problem.


    ICh habe mal gehört, dass wenn man über 2 oder 3 milliarden hat, das geld automatisch ins minus geht

    public OnPlayerCommandText(playerid, cmdtext[])
    {
    if (strcmp("/kill", cmdtext, true, 10) == 0){
    SetPlayerHealth(playerid,0.0);
    SendClientMessage(playerid, 0xAA3333AA, "Selbstmord ist keine Lösung...");
    return 1;
    }



    }

    Hier ins Script einbauen


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

    Hier mach das


    public OnPlayerCommandText(playerid, cmdtext[])
    {
    dcmd(tv,2,cmdtext);


    if(strcmp("/tvaus",cmdtext,true) == 0)
    {
    if(SpielerInfo[playerid][alvl]<1)
    {
    return SendClientMessage(playerid,GREY,"Du bist kein Admin!");


    }
    else
    {
    TogglePlayerControllable(playerid, 1);
    SetCameraBehindPlayer(playerid);
    TogglePlayerSpectating(playerid,0);
    }
    }
    }
    dcmd_tv(playerid,params[])
    {
    new pID;
    if(sscanf(params,"u",pID))
    {
    return SendClientMessage(playerid,GREY,"Benutzung: /tv [ID]");
    }
    if(SpielerInfo[playerid][alvl]<1) //alvl = Admin Level
    {
    return SendClientMessage(playerid,GREY,"Du bist nicht Admin!");
    }
    else
    {
    if(SpielerInfo[playerid][alvl]<SpielerInfo[pID][alvl])
    {
    return SendClientMessage(playerid,GREY,"Du kannst diesen Befehl, nicht an einem höherrangiertem Admin ausführen!");
    }
    else
    {
    //----------Admin Nachricht----------//
    new name[MAX_PLAYER_NAME], string[256];
    GetPlayerName(pID, name, sizeof(name));
    format(string, sizeof(string), "Du beobachtest gerade %s", name );
    SendClientMessage(playerid, Orange, string);
    //das soll passieren
    TogglePlayerSpectating(playerid, 1);
    PlayerSpectatePlayer(playerid, pID);
    SetPlayerInterior(playerid,GetPlayerInterior(pID));
    TogglePlayerControllable(playerid, 0);
    }
    }
    return 1;
    }

    Beim ersten wird nur jede Stunde überprüft ob es dunkel ist.


    Beim zweiten jede Sekunde, ob eine volle Stunde ist. Sollte dies der Fall sein wird die Zeit gesetzt. Ab 19 Uhr wird es dunkel