Beiträge von Pepex

    Hallo leute, ich habe ein kleines problem ..
    Wenn ich Privatfarzeuge kaufen, dann werden sie gespeichert aber beim erneuten joinen sind sie weg, auch nicht mehr unter /carkey zu finden, aber unter Scriptfiles/Autos stehen sie noch .. ich hoffe mir kann jemand helfen ...


    bei OnPlayerConnect
    for(new x=0;x<MaxVeh;x++)
    {
    Carlock[PlayerCar[playerid][PlayerKey[x]][CarId]] = 1;
    LockCar(PlayerCar[playerid][PlayerKey[x]][CarId]);
    PlayerHaveCar[playerid][x] = 0;
    LockCar(x);
    }
    OnPlayerCarLogin(playerid);
    for(new i=0;i<700;i++)
    {
    if(Carlock[i])
    {
    SetVehicleParamsForPlayer(i, playerid, 0,1);
    }
    }


    hier die Callbacks
    public OnPlayerCarLogin(playerid)
    {
    for(new x = 0; x < MaxVeh; x++)
    {
    if(!PlayerHaveCar[playerid][x])
    {
    new string2[128];
    new playername2[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername2, sizeof(playername2));
    format(string2, sizeof(string2), "/Autos/%s_Car_%d.ini", playername2,x);
    new File: UserFile = fopen(string2, io_read);
    if (UserFile)
    {
    PlayerHaveCar[playerid][x] = 1;
    new key[ 256 ] , val[ 256 ];
    new Data[ 256 ];
    while ( fread( UserFile , Data , sizeof( Data ) ) )
    {
    key = ini_GetKey( Data );
    if( strcmp( key , "CarId" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarId] = strval( val ); }
    if( strcmp( key , "CarModel" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarModel] = strval( val ); }
    if( strcmp( key , "CarPos_x" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarPos_x] = floatstr( val ); }
    if( strcmp( key , "CarPos_y" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarPos_y] = floatstr( val ); }
    if( strcmp( key , "CarPos_z" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarPos_z] = floatstr( val ); }
    if( strcmp( key , "CarRotate" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarRotate] = floatstr( val ); }
    if( strcmp( key , "CarNitro" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarNitro] = strval( val ); }
    if( strcmp( key , "CarHyd" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarHyd] = strval( val ); }
    if( strcmp( key , "CarWheel" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarWheel] = strval( val ); }
    if( strcmp( key , "CarAusp" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarAusp] = strval( val ); }
    if( strcmp( key , "CarSideL" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarSideL] = strval( val ); }
    if( strcmp( key , "CarSideR" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarSideR] = strval( val ); }
    if( strcmp( key , "CarFB" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarFB] = strval( val ); }
    if( strcmp( key , "CarRB" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarRB] = strval( val ); }
    if( strcmp( key , "CarSpoiler" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarSpoiler] = strval( val ); }
    if( strcmp( key , "CarRoof" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarRoof] = strval( val ); }
    if( strcmp( key , "CarHood" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarHood] = strval( val ); }
    if( strcmp( key , "CarVents" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarVents] = strval( val ); }
    if( strcmp( key , "CarLamps" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarLamps] = strval( val ); }
    if( strcmp( key , "CarPJ" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarPJ] = strval( val ); }
    if( strcmp( key , "CarC1" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarC1] = strval( val ); }
    if( strcmp( key , "CarC2" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarC2] = strval( val ); }
    if( strcmp( key , "Preis" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarPreis] = strval( val ); }
    if( strcmp( key , "CarTank" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarTank] = strval( val ); }
    if( strcmp( key , "CarMaxTank" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarMaxTank] = strval( val ); }
    if( strcmp( key, "CarState", true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarState] = strval( val ); }
    }
    fclose(UserFile);
    PlayerCarSpawn(playerid,x);
    }
    }
    }
    }
    public PlayerCarSpawn(playerid,Slot)
    {
    if(IsPlayerConnected(playerid))
    {
    if(PlayerHaveCar[playerid][Slot])
    {
    PlayerCar[playerid][Slot][CarId] = CreateVehicle(PlayerCar[playerid][Slot][CarModel],PlayerCar[playerid][Slot][CarPos_x],PlayerCar[playerid][Slot][CarPos_y],PlayerCar[playerid][Slot][CarPos_z],PlayerCar[playerid][Slot][CarRotate],PlayerCar[playerid][Slot][CarC1],PlayerCar[playerid][Slot][CarC2], 60000);/*vehicle spawn*/
    SetVehicleNumberPlate(PlayerCar[playerid][Slot][CarId], Name(playerid));
    ChangeVehicleColor(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarC1],PlayerCar[playerid][Slot][CarC2]);
    if(PlayerCar[playerid][Slot][CarPJ] >= 0) {ChangeVehiclePaintjob(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarPJ]);}
    if(PlayerCar[playerid][Slot][CarNitro] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarNitro]);}
    if(PlayerCar[playerid][Slot][CarHyd] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarHyd]);}
    if(PlayerCar[playerid][Slot][CarWheel] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarWheel]);}
    if(PlayerCar[playerid][Slot][CarAusp] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarAusp]);}
    if(PlayerCar[playerid][Slot][CarSideL] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarSideL]);}
    if(PlayerCar[playerid][Slot][CarSideR] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarSideR]);}
    if(PlayerCar[playerid][Slot][CarFB] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarFB]);}
    if(PlayerCar[playerid][Slot][CarRB] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarRB]);}
    if(PlayerCar[playerid][Slot][CarSpoiler] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarSpoiler]);}
    if(PlayerCar[playerid][Slot][CarRoof] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarRoof]);}
    if(PlayerCar[playerid][Slot][CarHood] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarHood]);}
    if(PlayerCar[playerid][Slot][CarVents] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarVents]);}
    if(PlayerCar[playerid][Slot][CarLamps] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarLamps]);}
    Carlock[PlayerCar[playerid][Slot][CarId]] = 1;
    LockCar(PlayerCar[playerid][Slot][CarId]);
    gGas[PlayerCar[playerid][Slot][CarId]] = PlayerCar[playerid][Slot][CarTank];
    gMaxGas[PlayerCar[playerid][Slot][CarId]] = PlayerCar[playerid][Slot][CarMaxTank];
    }
    }
    }


    Lg

    Hallo Leute,
    ich bekomme bei dem befehl /carkey errors, ich weiß aber nicht wieso :O
    - bitte um Hilfe
    (Errors)
    (14286) : error 032: array index out of bounds (variable "PlayerHaveCar")
    (14286) : error 032: array index out of bounds (variable "PlayerCar")
    (14288) : error 032: array index out of bounds (variable "PlayerHaveCar")
    (14288) : error 032: array index out of bounds (variable "PlayerCar")
    (14290) : error 032: array index out of bounds (variable "PlayerHaveCar")
    (14290) : error 032: array index out of bounds (variable "PlayerCar")


    (Befehl)
    if(strcmp(cmd, "/carkey", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    new c1[30], c2[30], c3[30], c4[30], c5[30], stringo[128];
    if(PlayerHaveCar[playerid][0]){ format(c1, sizeof(c1), "{FFFFFF}%s", CarName[PlayerCar[playerid][0][CarModel]-400]); }
    else { format(c1, sizeof(c1), "{FFFFFF}-------"); }
    if(PlayerHaveCar[playerid][1]){ format(c2, sizeof(c2), "{FFFFFF}%s", CarName[PlayerCar[playerid][1][CarModel]-400]); }
    else { format(c2, sizeof(c2), "{FFFFFF}-------"); }
    if(PlayerHaveCar[playerid][2]){ format(c3, sizeof(c3), "{FFFFFF}%s", CarName[PlayerCar[playerid][2][CarModel]-400]); } // zeile 14286
    else { format(c3, sizeof(c3), "{FFFFFF}-------"); }
    if(PlayerHaveCar[playerid][3]){ format(c4, sizeof(c4), "{FFFFFF}%s", CarName[PlayerCar[playerid][3][CarModel]-400]); }
    else { format(c4, sizeof(c4), "{FFFFFF}-------"); }
    if(PlayerHaveCar[playerid][4]){ format(c5, sizeof(c5), "{FFFFFF}%s", CarName[PlayerCar[playerid][4][CarModel]-400]); }
    else { format(c5, sizeof(c5), "{FFFFFF}-------"); }
    format(stringo, sizeof(stringo), "%s\n%s\n%s\n%s\n%s", c1, c2, c3, c4, c5);
    ShowPlayerDialog(playerid, DIALOG_CARKEY, DIALOG_STYLE_LIST, "Autoschlüssel", stringo, "Auswählen", "Abbrechen");
    }
    return 1;
    }
    Danke im Voraus =)

    mit Notepad++ kannst du checken, ob du überhaupt ein Klammerfehler hast, und dann musst du halt mal beim zuletzt gescripteten kucken ob da vllt. eine Klammer fehlt..

    oben im script
    new sound[MAX_PLAYERS];
    .. bei OnPlayerCommandText
    if(strcmp(cmdtext,"/hitsound",true) ==0)
    {
    if((sound[playerid]) == 1)
    {
    sound[playerid] = 0;
    SendClientMessage(playerid, COLOR_WHITE, "Du hast den Hitsound abgeschaltet!");
    }
    else if((sound[playerid]) == 0)
    {
    sound[playerid] = 1;
    SendClientMessage(playerid, COLOR_WHITE, "Du hast den Hitsound angeschaltet!");
    }
    }
    und dann einfach bei OnPlayerTakeDamage die if abfrage einbauen
    if((sound[playerid]) == 1)
    {
    PlayerPlaySound(issuerid,17802,0.0,0.0,0.0);
    PlayerPlaySound(playerid,17802,0.0,0.0,0.0);
    return 1;
    }
    return 1;


    (ungetestet)
    - Von Copy/Paste lernt man nichts, guck dir MrM Tutorials auf youtube an oder Nemesus =) so hab ich es gelernt..
    - LAde dir ein GF runter und gucke 3 stunden alles an, probiere aus, teste aus - schon weisst du mehr
    - (so habe ich es gelernt, nur so ne kleine info :D )

    einfach

    PlayerPlaySound(issuerid,17802,0.0,0.0,0.0);
    PlayerPlaySound(playerid,17802,0.0,0.0,0.0);
    return 1;

    bei
    ]public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
    einfügen


    (an/aus machst du einfach mit einer If abfrage)



    //E
    Vorposter war schneller :D

    Name:ImutebLP
    Hintergrund:Ordnungsamt (i.was thema oamt in samp)
    Effekte: (freie wahl)
    Figuren ( Oamtler *.* )
    Schriftart:freie wahl


    Freue mich auf eine überraschung.
    lg

    Du sollst Themen ansprechen, auch wenn es nicht zu dem game passt sag, was du lustiges in der werbung gesehen hast und ja, kp, wie geil das wäre wenn man Deoflaschen ingame als granaten werfen kann oderso :D (war nur n beispiel) ;D

    Hallo leute,
    wie aus der Überschrift schon zu entnehmen ist, brauche ich Tipps (wie, wo ich anfangen soll usw.) zum Scripten eines Taxometers..
    Bitte sendet mir keine links von Filterscripts oder sonstiges ( xD ) aus den gründen ..
    - möchte selber lernen
    - wenn ich nicht weiter komme, frage ich einfach ( xD )
    Danke im Voraus
    Lg.