[SAMMELTHREAD] Kleine Scripting Fragen

Dein Problem konnte durch einen User gelöst werden? Bedank dich bei ihm indem du seinen Beitrag als Hilfreich markierst sowie einen Daumen oben dalässt
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

  • hätte gerne das man das hier nur als Admin ausführen kann dafür ja:

    Code
    IsPlayerAdmin(playerid);


    aber trotzdem kannes jeder der nicht im Rcon eingeloggt ist benutzen -..-
    help pls :)
    MfG
    NIklas

  • new checks = PlayerInfo[i][pPayCheck] / 5;


    Was bedeutet hier "/ 5"? Ist das geteilt durch 5?

    How do I post wrong?


    After successfully ignoring Google, the FAQ, Stickies and the Search button, I create two to five new threads in the wrong section, with creative titles and unclear text that everybody can imagine something different from.

  • Spider
    if (strcmp("/fix", cmdtext, true, 7) == 0)
    {
    if(IsPlayerAdmin(playerid))
    {
    if(IsPlayerInAnyVehicle(playerid))
    {
    new fix[50];
    fix ="~g~FIX~w~ED";
    new vehid = GetPlayerVehicleID(playerid);
    GameTextForPlayer(playerid,fix,2,1);
    PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
    RepairVehicle(vehid);
    }
    }
    return 1;
    }
    versuchs mal so

    526C4Hj.png Mit freundlichen Grüßen,
    Noneatme

  • Welches ist eigentlich das sozusagen beste System um Daten zu speichern im Hinblick auf Geschwindigkeit, Handhabung, ...?


    Bei Dini habe ich das Problem, dass ich die Dateien gar nicht sehe, wenn ich den Ordner ganz normal öffne.

    Dann machst du was falsch, mir werden die Accountdateien angezeigt in dem Ordner. ^^

  • die Daten werden gespeichert, denn wenn ich den server wieder betrete spawnt man an der stelle wo man den Server verlassen hat
    aber wenn ich den Ordner öffne sehe ich überhaupt keine Dateien, obwohl ich das als .ini im Script definiert habe

  • Ich möchte, dass wenn man in einer Fraktion ist und man in den Binco geht, dass man gleich zu der Kleidung der Fraktion springt. Hier der Befehl
    if(strcmp(cmd, "/clothes", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if(IsAtClothShop(playerid))
    {
    if(PlayerInfo[playerid][pMember] == 0 || PlayerInfo[playerid][pLeader] == 0) { ChosenSkin[playerid] = 248; SetPlayerSkin(playerid, 248); }
    else if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1) { ChosenSkin[playerid] = 280; SetPlayerSkin(playerid, 280); }
    else if(PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2) { ChosenSkin[playerid] = 286; SetPlayerSkin(playerid, 286); }
    else if(PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3) { ChosenSkin[playerid] = 287; SetPlayerSkin(playerid, 287); }
    else if(PlayerInfo[playerid][pMember] == 4 || PlayerInfo[playerid][pLeader] == 4) { ChosenSkin[playerid] = 70; SetPlayerSkin(playerid, 70); }
    else if(PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pLeader] == 5) { ChosenSkin[playerid] = 258; SetPlayerSkin(playerid, 120); }
    else if(PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6) { ChosenSkin[playerid] = 120; SetPlayerSkin(playerid, 258); }
    else if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8) { ChosenSkin[playerid] = 127; SetPlayerSkin(playerid, 127); }
    else if(PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pLeader] == 9) { ChosenSkin[playerid] = 148; SetPlayerSkin(playerid, 148); }
    else if(PlayerInfo[playerid][pMember] == 10 || PlayerInfo[playerid][pLeader] == 10) { ChosenSkin[playerid] = 255; SetPlayerSkin(playerid, 255); }
    else if(PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11) { ChosenSkin[playerid] = 59; SetPlayerSkin(playerid, 59); }
    else { return 1; }
    GetPlayerPos(playerid, ChangePos[playerid][0],ChangePos[playerid][1],ChangePos[playerid][2]);
    ChangePos2[playerid][0] = GetPlayerInterior(playerid);
    ChangePos2[playerid][1] = 1;
    SetPlayerInterior(playerid,0);
    new rand = random(sizeof(gInviteSpawns));
    SetPlayerPos(playerid, gInviteSpawns[rand][0], gInviteSpawns[rand][1], gInviteSpawns[rand][2]); // Warp the player
    SetPlayerFacingAngle(playerid, gInviteSpawns[rand][3]);
    SetPlayerCameraPos(playerid,gInviteSpawns[rand][0] + 3, gInviteSpawns[rand][1], gInviteSpawns[rand][2]);
    SetPlayerCameraLookAt(playerid,gInviteSpawns[rand][0], gInviteSpawns[rand][1], gInviteSpawns[rand][2]);
    TogglePlayerControllable(playerid, 0);
    SelectChar[playerid] = 255;
    SelectCharID[playerid] = PlayerInfo[playerid][pMember];
    SelectCharPlace[playerid] = 1;
    PlayerInfo[playerid][pModel] = ChosenSkin[playerid];
    PlayerInfo[playerid][pChar] = ChosenSkin[playerid];
    SendClientMessage(playerid, COLOR_LIGHTRED, "* Nutze 'weiter' um mehrere Skins anzuschauen.");
    SendClientMessage(playerid, COLOR_LIGHTRED, "* Wenn du den Skin gefunden hast tippe 'fertig'.");
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD2, " Du bist nicht in einem Kleidungsladen !");
    return 1;
    }
    }
    return 1;
    }


    das ist unter Onplayertext
    if(SelectChar[playerid] == 255)
    {
    new idx;
    tmp = strtok(text, idx);
    if ((strcmp("weiter", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("weiter")))
    {
    switch (SelectCharID[playerid])
    {
    case 0: //Police Force
    {
    if(SelectCharPlace[playerid] == 1) { SetPlayerSkin(playerid, Peds[208][0]); SelectCharPlace[playerid] = 2; ChosenSkin[playerid] = Peds[208][0]; }
    else if(SelectCharPlace[playerid] == 2) { SetPlayerSkin(playerid, Peds[14][0]); SelectCharPlace[playerid] = 3; ChosenSkin[playerid] = Peds[14][0]; }
    else if(SelectCharPlace[playerid] == 3) { SetPlayerSkin(playerid, Peds[15][0]); SelectCharPlace[playerid] = 4; ChosenSkin[playerid] = Peds[15][0]; }
    else if(SelectCharPlace[playerid] == 4) { SetPlayerSkin(playerid, Peds[16][0]); SelectCharPlace[playerid] = 5; ChosenSkin[playerid] = Peds[16][0]; }
    else if(SelectCharPlace[playerid] == 5) { SetPlayerSkin(playerid, Peds[17][0]); SelectCharPlace[playerid] = 6; ChosenSkin[playerid] = Peds[17][0]; }
    else if(SelectCharPlace[playerid] == 6) { SetPlayerSkin(playerid, Peds[18][0]); SelectCharPlace[playerid] = 7; ChosenSkin[playerid] = Peds[18][0]; }
    else if(SelectCharPlace[playerid] == 7) { SetPlayerSkin(playerid, Peds[19][0]); SelectCharPlace[playerid] = 8; ChosenSkin[playerid] = Peds[19][0]; }
    else if(SelectCharPlace[playerid] == 8) { SetPlayerSkin(playerid, Peds[20][0]); SelectCharPlace[playerid] = 9; ChosenSkin[playerid] = Peds[20][0]; }
    else if(SelectCharPlace[playerid] == 9) { SetPlayerSkin(playerid, Peds[21][0]); SelectCharPlace[playerid] = 10; ChosenSkin[playerid] = Peds[21][0]; }
    else if(SelectCharPlace[playerid] == 10) { SetPlayerSkin(playerid, Peds[22][0]); SelectCharPlace[playerid] = 11; ChosenSkin[playerid] = Peds[22][0]; }
    else if(SelectCharPlace[playerid] == 11) { SetPlayerSkin(playerid, Peds[23][0]); SelectCharPlace[playerid] = 12; ChosenSkin[playerid] = Peds[23][0]; }
    else if(SelectCharPlace[playerid] == 12) { SetPlayerSkin(playerid, Peds[24][0]); SelectCharPlace[playerid] = 13; ChosenSkin[playerid] = Peds[24][0]; }
    else if(SelectCharPlace[playerid] == 13) { SetPlayerSkin(playerid, Peds[25][0]); SelectCharPlace[playerid] = 14; ChosenSkin[playerid] = Peds[25][0]; }
    else if(SelectCharPlace[playerid] == 14) { SetPlayerSkin(playerid, Peds[26][0]); SelectCharPlace[playerid] = 3; ChosenSkin[playerid] = Peds[26][0]; }
    else if(SelectCharPlace[playerid] == 15) { SetPlayerSkin(playerid, Peds[27][0]); SelectCharPlace[playerid] = 4; ChosenSkin[playerid] = Peds[27][0]; }
    else if(SelectCharPlace[playerid] == 16) { SetPlayerSkin(playerid, Peds[28][0]); SelectCharPlace[playerid] = 5; ChosenSkin[playerid] = Peds[28][0]; }
    else if(SelectCharPlace[playerid] == 17) { SetPlayerSkin(playerid, Peds[29][0]); SelectCharPlace[playerid] = 6; ChosenSkin[playerid] = Peds[29][0]; }
    else if(SelectCharPlace[playerid] == 18) { SetPlayerSkin(playerid, Peds[30][0]); SelectCharPlace[playerid] = 7; ChosenSkin[playerid] = Peds[30][0]; }
    }
    case 1: //Police Force
    {
    if(SelectCharPlace[playerid] == 1) { SetPlayerSkin(playerid, JoinPed[0][0]); SelectCharPlace[playerid] = 2; ChosenSkin[playerid] = JoinPed[0][0]; }
    else if(SelectCharPlace[playerid] == 2) { SetPlayerSkin(playerid, JoinPed[1][0]); SelectCharPlace[playerid] = 3; ChosenSkin[playerid] = JoinPed[1][0]; }
    else if(SelectCharPlace[playerid] == 3) { SetPlayerSkin(playerid, JoinPed[2][0]); SelectCharPlace[playerid] = 4; ChosenSkin[playerid] = JoinPed[2][0]; }
    else if(SelectCharPlace[playerid] == 4) { SetPlayerSkin(playerid, JoinPed[3][0]); SelectCharPlace[playerid] = 5; ChosenSkin[playerid] = JoinPed[3][0]; }
    else if(SelectCharPlace[playerid] == 5) { SetPlayerSkin(playerid, JoinPed[4][0]); SelectCharPlace[playerid] = 6; ChosenSkin[playerid] = JoinPed[4][0]; }
    else if(SelectCharPlace[playerid] == 6) { SetPlayerSkin(playerid, JoinPed[5][0]); SelectCharPlace[playerid] = 7; ChosenSkin[playerid] = JoinPed[5][0]; }
    else if(SelectCharPlace[playerid] == 7) { SetPlayerSkin(playerid, JoinPed[6][0]); SelectCharPlace[playerid] = 8; ChosenSkin[playerid] = JoinPed[6][0]; }
    else if(SelectCharPlace[playerid] == 8) { SetPlayerSkin(playerid, JoinPed[7][0]); SelectCharPlace[playerid] = 9; ChosenSkin[playerid] = JoinPed[7][0]; }
    else if(SelectCharPlace[playerid] == 9) { SetPlayerSkin(playerid, JoinPed[8][0]); SelectCharPlace[playerid] = 10; ChosenSkin[playerid] = JoinPed[8][0]; }
    else if(SelectCharPlace[playerid] == 10) { SetPlayerSkin(playerid, JoinPed[9][0]); SelectCharPlace[playerid] = 11; ChosenSkin[playerid] = JoinPed[9][0]; }
    else if(SelectCharPlace[playerid] == 11) { SetPlayerSkin(playerid, JoinPed[10][0]); SelectCharPlace[playerid] = 1; ChosenSkin[playerid] = JoinPed[10][0]; }
    }
    case 2: //FBI/ATF
    {
    if(SelectCharPlace[playerid] == 1) { SetPlayerSkin(playerid, JoinPed[11][0]); SelectCharPlace[playerid] = 2; ChosenSkin[playerid] = JoinPed[11][0]; }
    else if(SelectCharPlace[playerid] == 2) { SetPlayerSkin(playerid, JoinPed[12][0]); SelectCharPlace[playerid] = 3; ChosenSkin[playerid] = JoinPed[12][0]; }
    else if(SelectCharPlace[playerid] == 3) { SetPlayerSkin(playerid, JoinPed[13][0]); SelectCharPlace[playerid] = 1; ChosenSkin[playerid] = JoinPed[13][0]; }
    }
    case 3: //Bundeswehr
    {
    if(SelectCharPlace[playerid] == 1) { SetPlayerSkin(playerid, JoinPed[14][0]); SelectCharPlace[playerid] = 2; ChosenSkin[playerid] = JoinPed[14][0]; }
    else if(SelectCharPlace[playerid] == 2) { SetPlayerSkin(playerid, JoinPed[15][0]); SelectCharPlace[playerid] = 1; ChosenSkin[playerid] = JoinPed[15][0]; }
    }
    usw.
    }


    ist da was falsch=

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen

  • bin in deutsch nicht so gut ;/ obwohl ich ne 3 hab
    Gebrauchten oder Brauchen?

    "Die Bank ist auch für was anderes zu gebrauchen ! "
    klingt besser als "Gebrauchbar"


    Nicht jeder, der sich für super hält, ist ein Superheld. :love:
    ------------------------------------------------------------------------------------------------

  • Hmm immer wenn ich meinen Server starte bekomme ich diesen Fehler:
    "Script[gamemodes/derby.amx]: Run time error 20: "Invalid index paramter <bad entry point>"
    Was bedeuted er? Wie kann ich ihn fixxen? Woher soll ich wissen woran der fehler liegt?
    Dank diesem Fehler läuft mein Server nur auf Windows, problemlos. Aber bei Linux schmiert er einfach ab.

  • symbol is never used = Variable wird nie benutzt. Da kannst du entweder

    • Variable löschen
    • #pragma unused Variablenname