Beiträge von Sharpadox

    WEnn ich es so mache, bekomme ich keine Errors ;)
    Also versuch es mal so


    #include <a_samp>


    new tanzflaeche[131];
    new flaechetanz = 0;


    public OnGameModeInit()
    {
    tanzflaeche[0] = CreateObject(19128, -2055.19, 1653.23, 6.10, 0.00, 0.00, 0.00);
    //..........
    tanzflaeche[130] = CreateObject(19128, -2067.11, 1657.22, 6.10, 0.00, 0.00, 0.00);
    }


    public OnPlayerCommandText(playerid,cmdtext[])
    {
    if (strcmp("/disco", cmdtext, true, 10) == 0)
    {
    for(new i = 0; i < sizeof (tanzflaeche); i++)
    {
    if(flaechetanz == 0)
    {
    new Float:x,Float:y,Float:z;
    GetObjectPos( tanzflaeche[i], x,y,z);
    MoveObject( tanzflaeche[i], x,y,z+1,2);
    flaechetanz = 1;
    }
    if(flaechetanz == 1)
    {
    new Float:x,Float:y,Float:z;
    GetObjectPos( tanzflaeche[i], x,y,z);
    MoveObject( tanzflaeche[i], x,y,z-1,2);
    flaechetanz = 0;
    }
    }
    return 1;
    }
    return 0;
    }


    Sorry, hab dir KLammerfehler geschickt. So sollte es gehen :P


    public streak()
    {
    for(new i = 0; i<MAX_PLAYERS; i++)
    {
    if(GetPVarInt(i,"kills")==3)
    {
    SendClientMessage(i,Orange,"Du hast den 1 Killstreak!");
    }
    else if(GetPVarInt(i,"kills")==6)
    {
    SendClientMessage(i,Orange,"Du hast den 2 Killstreak!");
    }
    else if(GetPVarInt(i,"kills")==8)
    {
    SendClientMessage(i,Orange,"Du hast den 3 Killstreak!");
    }
    else if(GetPVarInt(i,"kills")==13)
    {
    SendClientMessage(i,Orange,"Du hast den 4 Killstreak!");
    }
    return 1;
    }
    return 1;
    }

    Und ausserdem sind deine Anderen abfrage nichtmehr in der for-Schleife ;)
    Versuch es so:


    public streak()
    {
    for(new i = 0; i<MAX_PLAYERS; i++)
    {
    if(GetPVarInt(i,"kills")==3))
    {
    SendClientMessage(i,Orange,"Du hast den 1 Killstreak!");
    }
    else if(GetPVarInt(i,"kills")==6))
    {
    SendClientMessage(i,Orange,"Du hast den 2 Killstreak!");
    }
    else if(GetPVarInt(i,"kills")==8))
    {
    SendClientMessage(i,Orange,"Du hast den 3 Killstreak!");
    }
    else if(GetPVarInt(i,"kills")==13))
    {
    SendClientMessage(i,Orange,"Du hast den 4 Killstreak!");
    }
    }
    return 1;
    }

    Ganz normale Abfragen? :huh:


    So würde ich es spontan machen



    ocmd:mv(playerid,params[])
    {
    #define MAX_FRAKS 5 //Anzahl der bestehenden Fraktionen
    new gvar[MAX_FRAKS];
    new Float:oX, Float:oY, Float:oZ;
    if(Fraktion[playerid] == 1) // LSPD
    {
    if(gvar[1] == 0)
    {
    GetObjectPos(fbitor,oX,oY,oZ);
    MoveObjekt(lspdtor,oX,oY,oZ-10,3); //LSPD Tor auf
    gvar[1] = 1; // 1 ist die FraktionsID, also LSPD
    }
    if(gvar[1] == 1)
    {
    GetObjectPos(fbitor,oX,oY,oZ);
    MoveObjekt(lspdtor,oX,oY,oZ+10,3); //LSPD Tor zu
    gvar[1] = 0;
    }
    return 1;
    }
    if(Fraktion[playerid] == 2) // FBI
    {
    if(gvar[2] == 0)
    {
    GetObjectPos(fbitor,oX,oY,oZ);
    MoveObjekt(fbitor,oX,oY,oZ-10,3); //FBI Tor auf
    gvar[1] = 1; // 1 ist die FraktionsID, also LSPD
    }
    if(gvar[2] == 1)
    {
    GetObjectPos(fbitor,oX,oY,oZ);
    MoveObjekt(fbitor,oX,oY,oZ+10,3); //FBI Tor zu
    gvar[1] = 0;
    }
    return 1;
    }
    return 1;
    }

    Also das hier hab ich nun in der SA:MP Wiki gefunden, aber ich checks immernoch nicht, wie man eigene natives mit Funktionen macht 8|



    http://wiki.sa-mp.com/wiki/Keywords:Initialisers#native

    Hey,


    was bringt die Funktion Native`?
    Denn ich wollte mir mal die a_samp.inc anschauen,
    doch da drin sind alles nur defines und natives :huh:


    // Util
    native print(const string[]);
    native printf(const format[], {Float,_}:...);
    native format(output[], len, const format[], {Float,_}:...);
    native SendClientMessage(playerid, color, const message[]);
    native SendClientMessageToAll(color, const message[]);
    native SendPlayerMessageToPlayer(playerid, senderid, const message[]);
    native SendPlayerMessageToAll(senderid, const message[]);
    native SendDeathMessage(killer,killee,weapon);
    native GameTextForAll(const string[],time,style);
    native GameTextForPlayer(playerid,const string[],time,style);
    native SetTimer(funcname[], interval, repeating);
    native SetTimerEx(funcname[], interval, repeating, const format[], {Float,_}:...);
    native KillTimer(timerid);
    native GetTickCount();
    native GetMaxPlayers();
    native CallRemoteFunction(const function[], const format[], {Float,_}:...);
    native CallLocalFunction(const function[], const format[], {Float,_}:...);
    native Float:asin(Float:value);
    native Float:acos(Float:value);
    native Float:atan(Float:value);
    native Float:atan2(Float:x, Float:y);


    // Game
    native SetGameModeText(const string[]);
    native SetTeamCount(count);
    native AddPlayerClass(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
    native AddPlayerClassEx(teamid, modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
    native AddStaticVehicle(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2);
    native AddStaticVehicleEx(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2, respawn_delay);
    native AddStaticPickup(model, type, Float:X, Float:Y, Float:Z, virtualworld = 0);
    native CreatePickup(model, type, Float:X, Float:Y, Float:Z, virtualworld = 0);
    native DestroyPickup(pickup);
    native ShowNameTags(show);
    native ShowPlayerMarkers(mode);
    native GameModeExit();
    native SetWorldTime(hour);
    native GetWeaponName(weaponid, const weapon[], len);
    native EnableTirePopping(enable);
    native AllowInteriorWeapons(allow);
    native SetWeather(weatherid);
    native SetGravity(Float:gravity);
    native AllowAdminTeleport(allow);
    native SetDeathDropAmount(amount);
    native CreateExplosion(Float:X, Float:Y, Float:Z, type, Float:Radius);
    native EnableZoneNames(enable);
    native UsePlayerPedAnims(); // Will cause the players to use CJ running/walking animations
    native DisableInteriorEnterExits(); // will disable all interior enter/exits in the game.
    native SetNameTagDrawDistance(Float:distance); // Distance at which nametags will start rendering on the client.
    native DisableNameTagLOS(); // Disables the nametag Line-Of-Sight checking
    native LimitGlobalChatRadius(Float:chat_radius);
    native LimitPlayerMarkerRadius(Float:marker_radius);


    // Npc
    native ConnectNPC(name[], script[]);
    native IsPlayerNPC(playerid);

    Definiere die Symbole doch einfach 8|


    Aber ich denke mal, dass es GF ist, da solltest du
    vielleicht in der Godfather Sektion fragen, ob sie
    das Script ohne Errors haben ;)