Beiträge von RedStyle

    Hab schon ein recht gutes Tut gefunden.
    nur kann mir wer sagen wie ich die aktuelle veriable z.B für timeban in stunden und minuten mache ?


    EDIT: Link: [ SCRIPTING ] Benutzung TimeStamp


    EDIT: Wie kann ich das In Jahre / Monate / Tage / Stunden / Minuten umrechnen ?

    hi, ich hab mal versucht ein Zcmd Cmd zu erstellen nur kommt ingame Unlnown Command wenn ich /kick eingebe.
    woran kann das liegen ? ich habe den CMD nicht unter OnPlayerCommandText.


    CMD:kick(playerid,params[])
    {
    new pID,Grund[50];
    if(Acc[playerid][Adminlevel]<2) return SendClientMessage(playerid,COLOR_RED,"You cannot use this Command");
    else if(sscanf(params,"uz",pID,Grund)) return SendClientMessage(playerid,COLOR_ORANGE,"Usage: /kick [playerid] ([reason])");
    else if(pID == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"This Player is not Connected");
    else if(Acc[pID][Adminlevel] >3) return SendClientMessage(playerid,COLOR_RED,"You cannot kick this Admin");
    else
    {
    new Admin[24];
    GetPlayerName(playerid,Admin,sizeof Admin);
    new player[24];
    GetPlayerName(playerid,player,sizeof player);
    new s[100];
    format(s,sizeof s,"Server: %s (ID: %d) has kicked %s (ID: %d), reason: %s",Admin,playerid,player,pID,Grund[0] ? Grund : "No reason specified");
    SendClientMessageToAll(Color_AdmCmd,s);
    Kick(pID);
    }
    return 1;
    }


    ich bekomme keine warns/ errors

    lol dummheit von mir ^^ ich change und teste edit kommt gleich


    EDIT: [14:25:39] DEBUG: Starten...
    [14:25:39] DEBUG: Float
    [14:25:39] DEBUG: VirtualWorld
    [14:25:39] DEBUG: Position
    [14:25:39] DEBUG: Pickup erstellen
    [14:25:39] DEBUG: Welt speichern
    [14:25:39] DEBUG: Coords speichern
    [14:25:39] DEBUG: Name Speichern
    [14:25:39] DEBUG: health
    [14:25:39] DEBUG: armour
    [14:25:39] DEBUG: cash
    [14:25:39] DEBUG: score
    [14:25:39] DEBUG: weaponid
    [14:25:39] DEBUG: weaponammo


    und server crash ? einer eine idee ?

    hi leute ich wollte mir ein dynamic event system machen mit pickups.
    doch wenn ich den cmd eingebe kommt nix und server geht aus.
    kann jemand vil den code ansehen und korrigieren falls falsch?


    enum epickup
    {
    Name[20],
    Cash,
    health,
    armour,
    weapon,
    ammo,
    score,
    Float:x_pos,
    Float:y_pos,
    Float:z_pos,
    active,
    world
    }
    new EventPickup[MAX_PICKUPS][epickup];


    stock CreateEventPickup(playerid, pname, phealth, parmour, pcash, pscore, pweaponid, pweaponammo)
    {
    new Float:pos[3],s[50];
    print("DEBUG: Float");
    new Welt = GetPlayerVirtualWorld(playerid);
    print("DEBUG: VirtualWorld");
    GetPlayerPos(playerid,pos[0],pos[1],pos[2]);
    print("DEBUG: Position");
    new Pickup = CreatePickup(1582,1,pos[0],pos[1],pos[2],Welt);
    print("DEBUG: Pickup erstellen");
    EventPickup[Pickup][world] = Welt;
    print("DEBUG: Welt speichern");
    EventPickup[Pickup][x_pos] = pos[0];
    EventPickup[Pickup][y_pos] = pos[1];
    EventPickup[Pickup][z_pos] = pos[2];
    print("DEBUG: Coords speichern");
    format(EventPickup[Pickup][Name],20,"%s",pname);
    print("DEBUG: Name Speichern");
    EventPickup[Pickup][health] = phealth;
    print("DEBUG: health");
    EventPickup[Pickup][armour] = parmour;
    print("DEBUG: armour");
    EventPickup[Pickup][Cash] = pcash;
    print("DEBUG: cash");
    EventPickup[Pickup][score] = pscore;
    print("DEBUG: score");
    EventPickup[Pickup][weapon] = pweaponid;
    print("DEBUG: weaponid");
    EventPickup[Pickup][ammo] = pweaponammo;
    print("DEBUG: weaponammo");
    SetPlayerPos(playerid,pos[0]+5,pos[1]+5,pos[2]+10);
    format(s,sizeof s,"Event Pickup Name = %d",EventPickup[Pickup][Name]);
    SendClientMessage(playerid,Color_AdmCmd,s);
    format(s,sizeof s,"Event Pickup World = %d",EventPickup[Pickup][world]);
    SendClientMessage(playerid,Color_AdmCmd,s);
    format(s,sizeof s,"Event Pickup Health: %d | Armour: %d",EventPickup[Pickup][health],EventPickup[Pickup][armour]);
    SendClientMessage(playerid,Color_AdmCmd,s);
    format(s,sizeof s,"Event Pickup Weaponid: %d | ammo: %d",EventPickup[Pickup][weapon],EventPickup[Pickup][ammo]);
    SendClientMessage(playerid,Color_AdmCmd,s);
    format(s,sizeof s,"Event Pickup Cash: %d | Score: %d",EventPickup[Pickup][Cash],EventPickup[Pickup][score]);
    SendClientMessage(playerid,Color_AdmCmd,s);
    SendClientMessageToAll(Color_AdmCmd,"[EVENT] Event Pickup has been created. Find it and you get some Prices!");
    return 1;
    }


    CMD:createeventpickup(playerid,params[])
    {
    new oname, ohealth, oarmour, ocash, oscore, oweaponid, oweaponammo;
    if(Acc[playerid][Adminlevel] <5) return SendClientMessage(playerid,COLOR_RED,"You cannot use this Command");
    else if(sscanf(params,"sdddddd", oname, ohealth, oarmour, ocash, oscore, oweaponid, oweaponammo)) return SendClientMessage(playerid,COLOR_RED,"Usage: /createeventpickup <name> <Health> <Armour> <Cash> <Score> <weaponid> <weaponammo>");
    else
    {
    print("DEBUG: Starten...");
    CreateEventPickup(playerid, oname, ohealth, oarmour, ocash, oscore, oweaponid, oweaponammo);
    }
    return 1;
    }


    ps: ich benutze zcmd


    EDIT: DEBUG: Starte... wird nicht in den logs angezeigt

    Language Include byRedStyle v1.0
    Hallo liebe Breadfishers :)
    Ich hab mir mal überlegt, ein Language Funktion überlegt und dann eben gemacht.


    Zu den Funktionen


    GetPlayerLanguage(playerid); Gibt die Aktuelle Sprache aus
    Beispiel: new language = GetPlayerLanguage(playerid);


    SetPlayerLanguage(playerid,language); Ändert die Sprache des Spielers
    Beispiel: SetPlayerLanguage(playerid,German);


    SendLanguageMessage(playerid,color,English,German);
    Beispiel: SendLanguageMessage(playerid,0xFF0000FF,"English Text","German Text");


    ShowPlayerLanguageDialog(playerid); Zeigt das SprachDialog an


    WICHTIG: LoadDialog(playerid,dialogid,response,listitem); muss bei OnPlayerDialogResponse rein!


    Installation:
    1. Language.inc Datei in euren Pawn Include ornder packen.
    2. Script öffnen
    3. oben unter euren anderen includes

    #include <Language>
    4. Bei OnPlayerDialogResponse:
    LoadDialog(playerid,dialogid,response,listitem);
    5. Beim Connecten oder sonstwo das Dialog aufrufen mit
    ShowPlayerLanguageDialog(playerid);
    6. in eurem mehrsprachigen text aus SendClientMessage folgendes machen.

    SendLanguageMessage(playerid,COLOR,"Englischer Text","Deutscher Text");


    Download:
    Pastebin
    Download Language.rar


    PS: Es ist mein erstes Include!
    Bitte Bewerten,Vorschläge machen



    MFG:Redstyle



    public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
    {
    //anderer code
    LoadDialog();
    return 1;
    }


    kann man onplayerdialogresponse irgendwie im include machen ? das es z.B in include sien kann als auch im fs/gm

    Danke hab ich übersehen. nur bekomm ich nu in folgender zeile folgende fehler:

    C:\Users\Tieger\Desktop\Server\pawno\include\Language.inc(46) : Unbekannte Variable : "dialogid"
    C:\Users\Tieger\Desktop\Server\pawno\include\Language.inc(48) : Unbekannte Variable : "response"
    C:\Users\Tieger\Desktop\Server\pawno\include\Language.inc(48) : Unbekannte Variable : "playerid"
    C:\Users\Tieger\Desktop\Server\pawno\include\Language.inc(49) : Unbekannte Variable : "listitem"
    C:\Users\Tieger\Desktop\Server\pawno\include\Language.inc(53) : Unbekannte Variable : "playerid"
    C:\Users\Tieger\Desktop\Server\pawno\include\Language.inc(54) : Unbekannte Variable : "playerid"
    C:\Users\Tieger\Desktop\Server\pawno\include\Language.inc(58) : Unbekannte Variable : "playerid"
    C:\Users\Tieger\Desktop\Server\pawno\include\Language.inc(59) : Unbekannte Variable : "playerid"
    C:\Users\Tieger\Desktop\Server\pawno\include\Language.inc(63) : warning 209: function "LoadDialog" should return a value


    8 Errors, 1 Warnungen
    Du hast Errors im Skript. Kompilierung abgebrochen


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

    bei

    stock LoadDialog()
    {
    if(dialogid == LanguageDialog)
    {
    if(!response) return ShowPlayerDialog(playerid,LanguageDialog,DIALOG_STYLE_LIST,"Select your Language","German\nEnglish","Choose","Choose");
    switch(listitem)
    {
    case 0:
    {
    SendClientMessage(playerid,0xFF0000FF,"Du wählst die deutsche Sprache aus.");
    PlayerLanguage[playerid] = German;
    }
    case 1:
    {
    SendClientMessage(playerid,0xFF0000FF,"You Choosen the English Language");
    PlayerLanguage[playerid] = English;
    }
    }
    }
    }


    wenn ich LoadDialog rausnehme bekomm ich keine errors

    bekomm dieselben errors wie oben und mit {} ist schon gefixxt :)

    #if defined _Language_included
    #endinput
    #endif
    #define _Language_included


    //native GetPlayerLanguage(playerid);
    //native SetPlayerLanguage(playerid,Language[]);
    //native SendLanguageMessage(playerid,color,English,German);
    //native ShowPlayerLanguageDialog(playerid);
    //native LoadDialog();


    new PlayerLanguage[MAX_PLAYERS char];
    #define German 9991
    #define English 9992
    #define LanguageDialog 9993


    stock GetPlayerLanguage(playerid)
    {
    return PlayerLanguage(playerid);
    }


    stock SetPlayerLanguage(playerid,language)
    {
    PlayerLanguage[playerid] = language;
    return 1;
    }


    stock SendLanguageMessage(playerid,color,English[],German[])
    {
    switch(GetPlayerLanguage(playerid))
    {
    case German: SendClientMessage(playerid,color,German);
    case English: SendClientMessage(playerid,color,English);
    }
    return 1;
    }


    stock ShowPlayerLanguageDialog(playerid)
    {
    ShowPlayerDialog(playerid,LanguageDialog,DIALOG_STYLE_LIST,"Select your Language","German\nEnglish","Choose","Choose");
    return 1;
    }


    stock LoadDialog()
    {
    if(dialogid == LanguageDialog)
    {
    if(!response) return ShowPlayerDialog(playerid,LanguageDialog,DIALOG_STYLE_LIST,"Select your Language","German\nEnglish","Choose","Choose");
    switch(listitem)
    {
    case 0:
    {
    SendClientMessage(playerid,0xFF0000FF,"Du wählst die deutsche Sprache aus.");
    PlayerLanguage[playerid] = German;
    }
    case 1:
    {
    SendClientMessage(playerid,0xFF0000FF,"You Choosen the English Language");
    PlayerLanguage[playerid] = English;
    }
    }
    }
    }


    EDIT: Laut Error liegen die errors nur in zeile 28-30

    Moin ja hab ich
    und bekomm noch immer folgende errors:

    C:\Users\Tieger\Desktop\Server\pawno\include\Language.inc(28) : Unbekannte Funktion
    C:\Users\Tieger\Desktop\Server\pawno\include\Language.inc(28) : Unbekannte Funktion
    C:\Users\Tieger\Desktop\Server\pawno\include\Language.inc(28 -- 30) : Unbekannte Funktion
    C:\Users\Tieger\Desktop\Server\pawno\include\Language.inc(28 -- 30) : Zuviele Fehler in einer Zeile


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


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


    include

    #if defined _Language_included
    #endinput
    #endif
    #define _Language_included


    //native GetPlayerLanguage(playerid);
    //native SetPlayerLanguage(playerid,Language[]);
    //native SendLanguageMessage(playerid,color,English,German);
    //native ShowPlayerLanguageDialog(playerid);
    //native LoadDialog();


    new PlayerLanguage[MAX_PLAYERS char];
    #define German 9991
    #define English 9992
    #define LanguageDialog 9993


    stock GetPlayerLanguage(playerid)
    {
    return PlayerLanguage{playerid};
    }


    stock SetPlayerLanguage(playerid,language)
    {
    PlayerLanguage[playerid] = language;
    return 1;
    }


    stock SendLanguageMessage(playerid,color,English[],German[])
    {
    switch(GetPlayerLanguage[playerid])
    {
    case German: SendClientMessage(playerid,color,German);
    case English: SendClientMessage(playerid,color,English);
    }
    return 1;
    }


    stock ShowPlayerLanguageDialog(playerid)
    {
    ShowPlayerDialog(playerid,LanguageDialog,DIALOG_STYLE_LIST,"Select your Language","German\nEnglish","Choose","Choose");
    return 1;
    }


    stock LoadDialog()
    {
    if(dialogid == LanguageDialog)
    {
    if(!response) return ShowPlayerDialog(playerid,LanguageDialog,DIALOG_STYLE_LIST,"Select your Language","German\nEnglish","Choose","Choose");
    switch(listitem)
    {
    case 0:
    {
    SendClientMessage(playerid,0xFF0000FF,"Du wählst die deutsche Sprache aus.);
    PlayerLanguage[playerid] = German;
    }
    case 1:
    {
    SendClientMessage(playerid,0xFF0000FF,"You Choosen the English Language");
    PlayerLanguage[playerid] = English;
    }
    }
    }
    }