Beiträge von Sharpadox

    Also jetzt habe ich es so, und der zeigt immernoch Permanent 1% an:


    //ZUSTAND
    new Float:hp, VHealth[64];
    format(VHealth,sizeof(VHealth),"Zustand: %d%",GetVehicleHealth(GetPlayerVehicleID(i),hp));
    TextDrawSetString(Zustand[i],VHealth);

    Ein dickes fettes DANKE an BOMBER !!
    Er hat mir über TV geholfen, und nun funktioniert es mit dem Namen ;)


    Aber nun das nächste Problem :D
    Mein Fahrzeugzustand steht immer auf 1%...
    Wass muss ich machen? Will dass es auf 1000% steht
    und wenn ich Schaden bekomme, soll es auch runter gehen x.x


    //ZUSTAND
    new Float:hp, zst = GetVehicleHealth(GetPlayerVehicleID(i),hp), VHealth[64];
    format(VHealth,sizeof(VHealth),"Zustand: %d%",zst);
    TextDrawSetString(Zustand[i],VHealth);

    Naja ich will es aber lieber mit dem i^^


    Hier ist mal der Code:



    //======= OnGameModeInit ===========


    Speed[i] = TextDrawCreate(501.000000, 351.000000, "Speed: %d");
    TextDrawBackgroundColor(Speed[i], 255);
    TextDrawFont(Speed[i], 2);
    TextDrawLetterSize(Speed[i], 0.260000, 1.100000);
    TextDrawColor(Speed[i], -36241153);
    TextDrawSetOutline(Speed[i], 1);
    TextDrawSetProportional(Speed[i], 0);
    TextDrawUseBox(Speed[i], 1);
    TextDrawBoxColor(Speed[i], 255);
    TextDrawTextSize(Speed[i], 628.000000, 0.000000);


    FName[i] = TextDrawCreate(500.000000, 338.000000, "Fahrzeug: %s");
    TextDrawBackgroundColor(FName[i], 255);
    TextDrawFont(FName[i], 2);
    TextDrawLetterSize(FName[i], 0.200000, 1.000000);
    TextDrawColor(FName[i], -16843010);
    TextDrawSetOutline(FName[i], 0);
    TextDrawSetProportional(FName[i], 0);
    TextDrawSetShadow(FName[i], 1);


    //==================================


    public UpdateTacho()
    {
    for(new i = 0;i<MAX_PLAYERS;i++)
    {
    if(IsPlayerConnected(i) && GetPlayerState(i) == PLAYER_STATE_DRIVER && !IsPlayerNPC(i))
    {
    // SPEED
    new Float:Strecke,Float:Geschwindigkeit;
    GetVehiclePos(GetPlayerVehicleID(i),X1[i],Y1[i],Z1[i]);
    Strecke = floatsqroot(floatpower(floatabs(floatsub(X1[i],X2[i])),2)+floatpower(floatabs(floatsub(Y1[i],Y2[i])),2)+floatpower(floatabs(floatsub(Z1[i],Z2[i])),2));
    Geschwindigkeit = (Strecke / (TACHOTIMER/1000)) * 3.6;
    new String[50];
    format(String,sizeof(String),"Speed: %d",floatround(Geschwindigkeit));
    TextDrawSetString(Speed[i],String);
    GetVehiclePos(GetPlayerVehicleID(i),X2[i],Y2[i],Z2[i]);
    TextDrawShowForPlayer(i,Speed[i]);
    // FAHRZEUGNAME
    new VehName = VehicleName[GetPlayerVehicleID(i)]-400, VName[64];
    format(VName,sizeof(VName),"Fahrzeug: %s",VehName);
    TextDrawSetString(FName[i],VName);
    TextDrawShowForPlayer(i,FName[i]);
    }
    else
    {
    TextDrawHideForPlayer(i,Speed[i]);
    TextDrawHideForPlayer(i,Zustand[i]);
    TextDrawHideForPlayer(i,Tank[i]);
    TextDrawHideForPlayer(i,FName[i]);
    }
    }
    return 1;
    }

    Hey,


    wie finde ich den Fahrzeugnamen herraus?
    Ich habe es so versucht:
    Aber da bekomme ich Errors!


    new VehName = VehicleName[MAX_VEHICLES]-400;


    new VehicleName[][]={
    "Landstalker","Bravura","Buffalo","Linerunner","Perrenial","Sentinel",
    "Dumper","Firetruck","Trashmaster","Stretch","Manana","Infernus",
    "Voodoo","Pony","Mule","Cheetah","Ambulance","Leviathan","Moonbeam",
    "Esperanto","Taxi","Washington","Bobcat","Whoopee","BF Injection",
    "Hunter","Premier","Enforcer","Securicar","Banshee","Predator","Bus",
    "Rhino","Barracks","Hotknife","Trailer","Previon","Coach","Cabbie",
    "Stallion","Rumpo","RC Bandit","Romero","Packer","Monster","Admiral",
    "Squalo","Seasparrow","Pizzaboy","Tram","Trailer","Turismo","Speeder",
    "Reefer", "Tropic", "Flatbed", "Yankee", "Caddy", "Solair", "Berkley's RC Van",
    "Skimmer", "PCJ-600", "Faggio", "Freeway", "RC Baron", "RC Raider", "Glendale",
    "Oceanic","Sanchez", "Sparrow", "Patriot", "Quad", "Coastguard", "Dinghy",
    "Hermes", "Sabre", "Rustler", "ZR-350", "Walton", "Regina", "Comet", "BMX",
    "Burrito", "Camper", "Marquis", "Baggage", "Dozer", "Maverick", "News Chopper",
    "Rancher", "FBI Rancher", "Virgo", "Greenwood", "Jetmax", "Hotring", "Sandking",
    "Blista Compact", "Police Maverick", "Boxvillde", "Benson", "Mesa", "RC Goblin",
    "Hotring Racer A", "Hotring Racer B", "Bloodring Banger", "Rancher", "Super GT",
    "Elegant", "Journey", "Bike", "Mountain Bike", "Beagle", "Cropduster", "Stunt",
    "Tanker", "Roadtrain", "Nebula", "Majestic", "Buccaneer", "Shamal", "Hydra",
    "FCR-900", "NRG-500", "HPV1000", "Cement Truck", "Tow Truck", "Fortune",
    "Cadrona", "FBI Truck", "Willard", "Forklift", "Tractor", "Combine", "Feltzer",
    "Remington", "Slamvan", "Blade", "Freight", "Streak", "Vortex", "Vincent",
    "Bullet", "Clover", "Sadler", "Firetruck", "Hustler", "Intruder", "Primo",
    "Cargobob", "Tampa", "Sunrise", "Merit", "Utility", "Nevada", "Yosemite",
    "Windsor", "Monster", "Monster", "Uranus", "Jester", "Sultan", "Stratum",
    "Elegy", "Raindance", "RC Tiger", "Flash", "Tahoma", "Savanna", "Bandito",
    "Freight Flat", "Streak Carriage", "Kart", "Mower", "Dune", "Sweeper",
    "Broadway","Tornado","AT-400","DFT-30","Huntley","Stafford","BF-400",
    "News Van","Tug","Trailer","Emperor","Wayfarer","Euros","Hotdog","Club",
    "Freight Box","Trailer","Andromada","Dodo","RC Cam","Launch","Police Car",
    "Police Car","Police Car","Police Ranger","Picador","S.W.A.T","Alpha",
    "Phoenix","Glendale Shit","Sadler Shit","Luggage","Luggage","Stairs","Boxville",
    "Tiller","Utility Trailer"
    };



    Zeile (1370) : Der benutzte Array-Index ist größer als die Variable definiert wurde (variable "VehicleName")
    Zeile (1370) : Array-Index fehlt (bspw. Array[1], Name: "VehicleName")


    2 Errors, 0 Warnungen
    Du hast Errors im Skript. Kompilierung abgebrochen


    PWNMod Compiler Version 1.2
    (c) Trooper[Y]
    In Kooperation mit GTA-Servers.de

    Hier ist ein Beispiel für Stats ;)


    Abfrage für Fraktion:
    ´ocmd:stats(playerid,params[])
    {
    new str[64], Frak[30];
    switch(PlayerInfo[playerid][pMember] || PlayerInfo[playerid][pLeader])
    {
    case 0:{Frak="Zivilist"}
    case 1:{Frak="LSPD"}
    case 2:{Frak="FBI"}
    }
    format(str,sizeof(str),"Fraktion: %s",Frak);
    SendClientMessage(playerid,0xFEFEFEFE,str);
    return 1;
    }

    Hey,


    warum lädt meine Map nicht?^^
    Mein Filterscript ist so aufgebaut:



    // This is a comment
    // uncomment the line below if you want to write a filterscript
    //#define FILTERSCRIPT


    #include <a_samp>


    #if defined FILTERSCRIPT


    public OnFilterScriptInit()
    {
    CreateObject(1344, x, x, x, 0, 0, 0);
    CreateObject(12843, x, x, x, 0, 0, 0);
    CreateObject(12844, x, x, x, 0, 0, 0);
    CreateObject(997, x, x, x, 0, 0, 90);
    CreateObject(997, x, x, x, 0, 0, 90);
    CreateObject(997, x, x, x, 0, 0, 90);
    CreateObject(997, x, x, x, 0, 0, 90);
    CreateObject(1215, x,x, x, 0, 0, 0);
    CreateObject(1215, x, x, x, 0, 0, 0);
    CreateObject(1258, x, x, x, 0, 0, 0);
    CreateObject(1263, x, x, x, 0, 0, 0);
    CreateObject(1797, x, x, x, 0, 0, 0);
    CreateObject(1797, x, x, x, 0, 0, 0);
    CreateObject(1797, x, x, x, 0, 0, 0);
    CreateObject(2127, x, x, x, 0, 0, 270);
    CreateObject(2132, x, x, x, 0, 0, 270);
    CreateObject(2224, x, x, x, 0, 0, 216.25);
    print("[MAP]: Zivispawn Airport geladen!");
    return 1;
    }


    public OnFilterScriptExit()
    {
    return 1;
    }


    #else


    #endif

    Das ist dann aber komisch, denn das kann doch unmöglich ein Fehler sein :huh:


    Wenn ich Definition + Objekte in mein Skript mache:


    0 Errors, 0 Warnungen
    Kompilierung erfolgreich


    PWNMod Compiler Version 1.2
    (c) Trooper[Y]
    In Kooperation mit GTA-Servers.de


    Wo hast du denn gstorauf definiert?
    Und wo hast du das Objekt erstellt?

    Die Fehlermeldung kommt immernoch + Die Sirene wird an jedem Auto erstellt


    Code:

    ocmd:ss(playerid,params[])
    {
    if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 451){SendClientMessage(playerid,Grau,"Dieser Befehl ist nur in einem Sultan möglich!");}
    new objectid = CreateObject(19419,0,0,0,0,0,0);
    new vehicleid = GetPlayerVehicleID(playerid);
    AttachObjectToVehicle(objectid, vehicleid, -0.024999, -0.105000, 0.819999, 0.000000, 0.000000, 0.000000); //Object Model: 19419 |
    return 1;
    }


    //EDIT: Falsch ausgedrück.. Die Fehlermeldung komm immer, in jedem Car.. Bei jedem Car kann man mit /ss Sirene platzieren
    //EDIT 2:: wtf .. war mein Fehler ^^ muss ja bei der "451" eine "560" hinmachen :x und Prototype hatte auch recht, da gehört ein Return 1; hin