Beiträge von CubedDeath

    /////////////////
    // AFK Script ///
    // von ///
    // <|Chilla|> ///
    /////////////////


    #include <a_samp>
    #define FILTERSCRIPT
    #if defined FILTERSCRIPT


    // COLORS
    #define COLOR_GREY 0xBEBEBEAA
    #define COLOR_WHITE 0xFFFFFFAA
    #define COLOR_GREEN 0x008C0000
    #define color_green 0x33AA33AA
    #define color_dgreen 0x33AA33AA
    #define COLOR_BLACK 0x000000
    #define COLOR_GRAD5 0xE3E3E3FF
    #define COLOR_GRAD4 0xD8D8D8FF
    #define COLOR_GRAD1 0xB4B5B7FF
    #define COLOR_LIGHTBLUE 0x33CCFFAA
    #define COLOR_YELLOW 0xF6F60000
    #define COLOR_BLUE 0x0000F600
    #define COLOR_GRAD2 0xBFC0C2FF
    #define COLOR_LIGHTBLUE 0x33CCFFAA
    #define COLOR_LIGHTRED 0xFF6347AA
    #define COLOR_GRAD3 0xCBCCCEFF
    #define COLOR_RED 0xCE000000
    #define color_lred 0xAA3333AA
    #define COLOR_FADE1 0xE6E6E6E6
    #define COLOR_FADE2 0xC8C8C8C8
    #define COLOR_FADE3 0xAAAAAAAA
    #define COLOR_FADE4 0x8C8C8C8C
    #define COLOR_FADE5 0x6E6E6E6E
    #define COLOR_PURPLE 0xC2A2DAAA
    #define COLOR_CADETBLUE 0x5F9EA0
    #define COLOR_GRAD6 0xF0F0F0FF
    #define COLOR_INVISIBLE 0xFFFFFF00
    #define COLOR_ORANGE 0xFF830000
    #define color_lorange 0xFF830000
    #define COLOR_SHOW 0xFFC4C4FF
    ///////////////////////////


    // ISTAFK, STRING, PNAME //
    new istafk[MAX_PLAYERS];
    new string[48];
    new string1[48];
    new pName[16];
    new string2[48];
    new s[48];
    new pName2[16];
    //////////////////////////


    ////////////////////////////////////////////////////////////////////////////////


    public OnFilterScriptInit()
    {
    print("\n--------------------------------------");
    print(" Filterscript von <|Chilla|> || LOADED ");
    print("--------------------------------------\n");
    return 1;
    }


    ////////////////////////////////////////////////////////////////////////////////


    public OnFilterScriptExit()
    {
    print("\n--------------------------------------");
    print(" Filterscript von <|Chilla|> || UNLOADED");
    print("--------------------------------------\n");
    return 1;
    }


    ////////////////////////////////////////////////////////////////////////////////


    #else
    #endif


    ////////////////////////////////////////////////////////////////////////////////


    public OnPlayerCommandText(playerid, cmdtext[])
    {
    ////////////////////////// AFK /////////////////////////////////////////////
    if (strcmp("/afk", cmdtext, true, 4) == 0)
    {
    if(istafk[playerid] == 0)
    {
    istafk[playerid] = 1;
    GetPlayerName(playerid, pName, sizeof(pName));
    format(string, sizeof (string), " ** %s ist nun AFK ! **", pName);
    TogglePlayerControllable(playerid, 0);
    SendClientMessageToAll(COLOR_LIGHTBLUE, string);
    SendClientMessage(playerid, COLOR_GREEN, "Tippe /back um von AFK zurück zu sein !");
    }
    else
    {
    SendClientMessage(playerid, COLOR_RED, "ERROR: Du bist schon AFK !");
    }
    return 1;
    }
    ////////////////////////// RE //////////////////////////////////////////////
    if (strcmp("/back", cmdtext, true, 3) == 0)
    {
    if(istafk[playerid] == 1)
    {
    istafk[playerid] = 0;
    GetPlayerName(playerid, pName, sizeof(pName));
    format(string2, sizeof (string2), " ** %s ist zurück ! **", pName);
    format(s, sizeof (s), " Willkommen zurueck %s !", pName2);
    TogglePlayerControllable(playerid, 1);
    SendClientMessageToAll(COLOR_LIGHTBLUE, string);
    GameTextForPlayer(playerid, s, 2500, 3);
    }
    else
    {
    SendClientMessage(playerid, COLOR_RED, "ERROR: Du bist schon von AFK zurück !");
    }
    return 1;
    }
    return 0;
    }


    ////////////////////////////////////////////////////////////////////////////////


    Ungetestet, sollte aber gehen. Der Fehler war das die Funktion schon vor dem else returnt wurde ;)

    Pardon, das hatte ich vergessen :S


    //ongamemodeinit
    SetTimer("Check",120,1)
    //oben
    forward Check();
    //unten
    public Check(){
    for(new i=0;i<MAX_PLAYERS;i++){
    new Float:leben;
    GetPlayerHealth(i,leben);
    if(leben!=altesleben[i]) {
    altesleben[i]=leben; }
    return 1;}}


    so sollte es gehen

    Ich denke mal so ist das richtig bin mir aber nicht sicher:


    GetPlayerPos(playerid,Float:x,Float:y,Float:z);
    if(Float:x+10,Float:y+10,Float:z+10) //10 für den Radius

    //ongamemodeinit
    SetTimer("Check",120,1)
    //oben
    forward Check();
    //unten
    public Check(){
    new Float:leben;
    GetPlayerHealth(playerid/*oder i*/,leben);
    if(leben!=altesleben[playerid]) {
    altesleben[playerid]=leben; }
    return 1;}

    Da waren mehrer Fehler drinen, ich hab sie soweit mal alle behoben, würde dir aber mal empfehlen sich noch ein par Tutorials anzuschauen so wie es aussah war das nehmlich nur ein GM aus Codeschnipseln.


    #include <a_samp>
    #include <core>
    #include <float>


    forward bankcountdown();
    forward raubin4min();
    forward raubin3min();
    forward raubin2min();
    forward raubin1min();
    forward raubin30sek();
    forward rauberlauben1();
    forward ausgeraubt(playerid);


    new glav;
    new reauber[MAX_PLAYERS];
    new rauberlauben;
    //bank countdown
    new bankcountdown1;
    new bankcountdown2;
    new bankcountdown3;
    new bankcountdown4;
    new bankcountdown5;
    new ausgeraubt1;



    #define COLOR_RED 0xAA3333AA
    #define COLOR_YELLOW 0xFFFF00AA
    #define COLOR_LIGHTBLUE 0x33CCFFAA
    #define COLOR_GREY 0xAFAFAFAA
    #define COLOR_ORANGE 0xFF9900AA



    public OnPlayerCommandText(playerid, cmdtext[])
    {
    if(strcmp(cmdtext, "/robbank", true) == 0)
    {
    //if (PlayerInfo[playerid][pLevel] >= 1)//PlayerInfo hast du noch nicht in deinem script
    {
    if (PlayerToPoint(20, playerid,2312.2136,-6.9591,26.7422))//mitten in der bank ls
    {
    if(IsPlayerConnected(playerid))
    {
    if(rauberlauben == 0)
    {
    SendClientMessage(playerid, COLOR_RED, "__________________________________________________________________________________");
    SendClientMessage(playerid,COLOR_YELLOW,"Sie haben die Bank ausgeraubt.");
    SendClientMessage(playerid,COLOR_YELLOW,"Wenn sie es schaffen 5 Minuten in der Bank zubleiben bekommen sie das Geld");
    SendClientMessage(playerid, COLOR_RED, "__________________________________________________________________________________");
    new s[100];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(s,sizeof(s),"%s hat die Bank ausgeraubt... und ist auf der Flucht<---",name);
    SendClientMessageToAll(COLOR_LIGHTBLUE,s);
    reauber[playerid] = 1;
    rauberlauben = 1;
    glav = 14400;
    ausgeraubt1 = SetTimerEx("ausgeraubt", 300000,false,"d",playerid);
    bankcountdown1 = SetTimer("raubin4min", 60000, 0);
    SetPlayerColor(playerid, 0xFF66FFAA);
    //SetPlayerCriminal(playerid,255, "Ausraub der Bank"); Diese Funktion gibt es nicht meinst du vll SetPlayerWantedLevel?
    //WantedLevel[playerid]+=3; //WantedLevel ist ebefalls nicht deklariert
    }
    else
    {
    new s[100];
    format(s,sizeof(s),"Die Bank kann erst wieder in %d Sekunden ausgeraubt werden.(%d Minuten)(ca:%d Stunden)",glav,glav/60,glav/3600);
    SendClientMessage(playerid,COLOR_LIGHTBLUE,s);
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, "Du bist nicht in der LS Bank!");
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, "Du musst Level 2 sein um die Bank auszurauben");
    }
    }
    return 1;
    }
    return 0;
    }
    public OnGameModeInit()
    {
    SetTimer("bankcountdown",1000,1);
    }
    public bankcountdown()
    {
    glav--;
    }
    public ausgeraubt(playerid)
    {
    GivePlayerMoney(playerid, 50000); //hab es mal durch GivePlayerMoney ersetzt
    new s[100], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(s,sizeof(s),"%s °°°°° hat die Bank erfolgreich ausgeraubt",name);
    SendClientMessageToAll(COLOR_LIGHTBLUE,s);
    SendClientMessage(playerid,COLOR_ORANGE,"Hertzlichen Glückwunsch. Du hast es geschaft die Bank auszurauben");
    glav = 14400;
    }
    public raubin4min()
    {
    SendClientMessageToAll(COLOR_LIGHTBLUE,"Der Räuber hat in 4 Minuten die Bank ausgeraubt");
    bankcountdown2 = SetTimer("raubin3min",60000, 0);
    return 1;
    }
    public raubin3min()
    {
    SendClientMessageToAll(COLOR_LIGHTBLUE,"Der Räuber hat in 3 Minuten die Bank ausgeraubt");
    bankcountdown3 = SetTimer("raubin2min",60000, 0);
    return 1;
    }
    public raubin2min()
    {
    SendClientMessageToAll(COLOR_LIGHTBLUE,"Der Räuber hat in 2 Minuten die Bank ausgeraubt");
    bankcountdown4 = SetTimer("raubin1min",60000, 0);
    return 1;
    }
    public raubin1min()
    {
    SendClientMessageToAll(COLOR_LIGHTBLUE,"Der Räuber hat in 30 Sekunden die Bank ausgeraubt");
    bankcountdown5 = SetTimer("raubin30sek",30000, 0);
    return 1;
    }
    public rauberlauben1()
    {
    rauberlauben = 0;
    return 1;
    }
    public OnPlayerDeath(playerid, killerid, reason)
    {
    if (PlayerToPoint(20.0, playerid,2305.6890,-16.0881,26.7496))
    {
    if(reauber[playerid] == 1)
    {
    new s[100],name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    reauber[playerid] = 0;
    glav = 14400;
    KillTimer(bankcountdown1);
    KillTimer(bankcountdown2);
    KillTimer(bankcountdown3);
    KillTimer(bankcountdown4);
    KillTimer(bankcountdown5);
    KillTimer(ausgeraubt1);
    SetTimer("rauberlauben1", 14400000, 0);
    format(s,sizeof(s),"%s wurde GETÖTET. Der Bankraub ist fehlgeschlagen!!!",name);
    SendClientMessageToAll(COLOR_LIGHTBLUE,s);
    }
    return 1;
    }
    if (PlayerToPoint(2.0, playerid,2305.6890,-16.0881,26.7496))
    {
    if(reauber[playerid] == 1)
    {
    new s[100], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    SetTimer("rauberlauben1", 14400000, 0);
    reauber[playerid] = 0;
    glav = 14400;
    KillTimer(bankcountdown1);
    KillTimer(bankcountdown2);
    KillTimer(bankcountdown3);
    KillTimer(bankcountdown4);
    KillTimer(bankcountdown5);
    KillTimer(ausgeraubt1);
    format(s,sizeof(s),"%s °°°°°° Hat die Bank Verlassen. Der Bankraub ist fehlgeschlagen!!!",name);
    SendClientMessageToAll(COLOR_LIGHTBLUE,s);
    }
    }
    return 1;
    }


    stock PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z){
    if(IsPlayerConnected(playerid)){
    new Float:oldposx, Float:oldposy, Float:oldposz;
    new Float:tempposx, Float:tempposy, Float:tempposz;
    GetPlayerPos(playerid, oldposx, oldposy, oldposz);
    tempposx = (oldposx -x);
    tempposy = (oldposy -y);
    tempposz = (oldposz -z);
    if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
    {
    return 1;
    }
    }
    return 0;
    }

    dann must du es auch so einfügen also :

    if(strcmp(cmd, "/taxi", true) == 0)
    {
    new Geld;
    new string[80];
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid,Grün,"Benutze: /taxi [Geld]");
    return 1;
    }
    Geld = strval(tmp);
    new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, sizeof(pName));
    format(string, sizeof(string),"%s braucht ein Taxi! Er bezahlt: %d$ Phonenr: %d",pName,Geld,PlayerInfo[playerid][pPnumber]);
    SendClientMessageToAll(Grün,string);
    return 1;
    }

    if(strcmp(cmd, "/taxi", true) == 0)
    {
    new Geld;
    new string[80];
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid,Grün,"Benutze: /taxi [Geld]");
    return 1;
    }
    Geld = strval(tmp);
    new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, sizeof(pName));
    format(string, sizeof(string),"%s braucht ein Taxi! Er bezahlt: %d$ Phonenr: Nummer",pName,Geld);
    SendClientMessageToAll(Grün,string);
    return 1;
    }


    Das wäre der Befehl


    //oben
    new Armeeleader[MAX_PLAYERS];
    //command
    if(strcmp(cmd, "/atombombe", true) == 0)
    {
    if(PlayerToPoint(1.0,playerid,268.6444,1883.1410,-30.0938) && Armeeleader[playerid] == 1)//musst du halt ändern wie du es haben willst
    {
    SendRconCommand("weather 999");
    }
    return 1;
    }


    Allerdings ohne die Explosion das ist mit CreateExplosion leider nicht möglich.

    public OnPlayerDisconnect(playerid, reason)
    {
    new pName[MAX_PLAYER_NAME], string[56];
    GetPlayerName(playerid, pName, sizeof(pName));
    switch(reason)
    {
    case 0: format(string, sizeof(string), "%s hat den Server verlassen. (Lost Connection)", pName);
    case 1: format(string, sizeof(string), "%s hat den Server verlassen. (Leaving)", pName);
    case 2: format(string, sizeof(string), "%s hat den Server verlassen. (Kicked)", pName);
    }
    SendClientMessageToAll(0xAAAAAAAA, string);
    return 1;
    }