Beiträge von LuxX

    hallo,.


    Was muss ich bei meinem Register System machen damit man gekickt wird wenn man noch nicht Eingeloggt ist und seinen Skin auswählt?


    Das Reg. System habe ich


    forward OnPlayerUpdate(playerid);
    forward Encrypt(string[]);
    forward OnPlayerLogin(playerid,const string[]);


    new PlayerInfo[MAX_PLAYERS][pInfo];
    new gPlayerLogged[MAX_PLAYERS];
    new gPlayerAccount[MAX_PLAYERS];

    public OnPlayerConnect(playerid)
    {
    new playrname[MAX_PLAYER_NAME];
    new connect[128];
    GetPlayerName(playerid, playrname, sizeof(playrname));
    format(connect, sizeof(connect), "%s.ini", playrname);
    if(fexist(connect))
    {
    gPlayerAccount[playerid] = 1;
    SendClientMessage(playerid, COLOR_YELLOW, "Du bist registriert, bitte logge dich mit /login password ein");
    return 1;
    }
    else
    {
    gPlayerAccount[playerid] = 0;
    SendClientMessage(playerid, COLOR_YELLOW, "Bitte registriere dich mit /register password");
    }
    new pName[MAX_PLAYER_NAME];
    new string[56];
    GetPlayerName(playerid, pName, sizeof(pName));
    format(string, sizeof(string), "%s hat den Server betreten.", pName);
    SendClientMessageToAll(0xAAAAAAAA, string);
    GameTextForPlayer(playerid,"~w~Fun & DM",3000,4);
    SendClientMessage(playerid,COLOR_WHITE,"Willkommen auf dem Server");
    return 1;
    }

    public OnPlayerDisconnect(playerid, reason)
    {
    OnPlayerUpdate(playerid);
    gPlayerLogged[playerid] = 0;
    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;
    }


    public OnPlayerCommandText(playerid, cmdtext[])
    {
    new cmd[256];
    new idx;
    cmd = strtok(cmdtext, idx);
    new tmp[256];
    new playername[MAX_PLAYER_NAME];
    if (strcmp(cmd, "/login", true) ==0 )
    {
    if(IsPlayerConnected(playerid))
    {
    new tmppass[64];
    if(gPlayerLogged[playerid] == 1)
    {
    SendClientMessage(playerid, COLOR_GREY, " Du bist bereits eingeloggt.");
    return 1;
    }
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GREY, " Benutze: /login [password]");
    return 1;
    }
    strmid(tmppass, tmp, 0, strlen(cmdtext), 255);
    Encrypt(tmppass);
    OnPlayerLogin(playerid,tmppass);
    }
    return 1;
    }
    if (strcmp(cmd, "/register", true)==0)
    {
    new string[265];
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GREY, "Benutze: /register [password]");
    return 1;
    }
    if (gPlayerAccount[playerid] == 1)
    {
    SendClientMessage(playerid, COLOR_GREY, " Der Name ist bereits registriert");
    return 1;
    }


    strmid(PlayerInfo[playerid][pPassword], tmp, 0, strlen(cmdtext), 255);
    Encrypt(PlayerInfo[playerid][pPassword]);
    GetPlayerName(playerid, playername, sizeof(playername));
    format(string, sizeof(string), "%s.ini", playername);
    new File: file = fopen(string, io_read);
    if (file)
    {
    SendClientMessage(playerid, COLOR_GREY, " Der Name ist bereits registriert");
    fclose(file);
    return 1;
    }
    new File:hFile;
    hFile = fopen(string, io_append);
    new var[32];//
    format(var, 32, " Passwort=%s\n ", PlayerInfo[playerid][pPassword]);fwrite(hFile, var);
    format(var, 32, "Admin=%s\n ", PlayerInfo[playerid][pAdmin]);fwrite(hFile, var);
    SendClientMessage(playerid, COLOR_WHITE, "Erfolgreich registriert!");
    SendClientMessage(playerid, COLOR_WHITE, "Gebe nächstes mal /login <password> zum einloggen ein.");
    fclose(hFile);
    OnPlayerLogin(playerid,PlayerInfo[playerid][pPassword]);
    return 1;
    }

    public OnPlayerUpdate(playerid)
    {
    if(IsPlayerConnected(playerid))
    {
    if(gPlayerLogged[playerid])
    {
    new string3[32];
    new pname3[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname3, sizeof(pname3));
    format(string3, sizeof(string3), "%s.ini", pname3);
    new File: pFile = fopen(string3, io_write);
    if (pFile)
    {
    new var[32];
    format(var, 32, "%s\n", PlayerInfo[playerid][pPassword]);fwrite(pFile, var);
    fclose(pFile);
    new File: hFile = fopen(string3, io_append);
    format(var, 32, "Admin=%d\n ",PlayerInfo[playerid][pAdmin]);fwrite(hFile, var);
    fclose(hFile);
    }
    }
    }
    return 1;
    }


    public OnPlayerLogin(playerid,const string[])
    {
    new pname2[MAX_PLAYER_NAME];
    new pname3[MAX_PLAYER_NAME];
    new string2[64];
    new string3[128];
    GetPlayerName(playerid, pname2, sizeof(pname2));
    format(string2, sizeof(string2), "%s.ini", pname2);
    new File: UserFile = fopen(string2, io_read);


    if (UserFile)
    {
    new valtmp[128];
    fread(UserFile, valtmp);strmid(PlayerInfo[playerid][pPassword], valtmp, 0, strlen(valtmp)-1, 255);


    if ((strcmp(PlayerInfo[playerid][pPassword], string, true, strlen(valtmp)-1) == 0))
    {
    new key[128],val[128];
    new Data[128];
    while(fread(UserFile,Data,sizeof(Data)))
    {
    key = ini_GetKey(Data);
    if( strcmp( key , "Admin" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pAdmin] = strval( val ); }
    }
    fclose(UserFile);
    gPlayerLogged[playerid] = 1;
    gPlayerAccount[playerid] = 1;
    GetPlayerName(playerid, pname3, sizeof(pname3));
    format(string3, sizeof(string3), "Welcome %s, du bist bereits eingeloggt!", pname3);
    SendClientMessage(playerid, COLOR_WHITE,string3);
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, " Falsches Passwort");
    fclose(UserFile);
    }
    }
    return 1;
    }

    stock ini_GetKey( line[] )
    {
    new keyRes[128];
    keyRes[0] = 0;
    if ( strfind( line , "=" , true ) == -1 ) return keyRes;
    strmid( keyRes , line , 0 , strfind( line , "=" , true ) , sizeof( keyRes) );
    return keyRes;
    }


    stock ini_GetValue( line[] )
    {
    new valRes[128];
    valRes[0]=0;
    if ( strfind( line , "=" , true ) == -1 ) return valRes;
    strmid( valRes , line , strfind( line , "=" , true )+1 , strlen( line ) , sizeof( valRes ) );
    return valRes;
    }
    public Encrypt(string[])
    {
    for(new x=0; x < strlen(string); x++)
    {
    string[x] += (3^x) * (x % 15);
    if(string[x] > (0xff))
    {
    string[x] -= 64;
    }
    }
    return 1;
    }

    Hallo,


    Ich weis nicht wie ich es machen soll das meine 4 gTeams Jeweils an einem anderen Ort spawnen sollen. Die Skinnauswahl soll am selben Ort bleiben. Meine Teams sehen so aus

    #define TEAM_ALPHA 0
    #define TEAM_BETA 1
    #define TEAM_GAMMA 2
    #define TEAM_DELTA 3


    static gTeam[MAX_PLAYERS];



    //Team ALPHA
    AddPlayerClass(165,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
    AddPlayerClass(163,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
    AddPlayerClass(166,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
    //Team BETA
    AddPlayerClass(98,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
    AddPlayerClass(127,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
    AddPlayerClass(113,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
    //Team Gamma
    AddPlayerClass(107,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
    AddPlayerClass(106,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
    AddPlayerClass(269,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
    //Team Delta
    AddPlayerClass(123,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
    AddPlayerClass(120,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
    AddPlayerClass(118,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);


    public OnPlayerRequestClass(playerid, classid)
    {
    SetPlayerInterior(playerid,3);
    SetPlayerPos(playerid,349.0453,193.2271,1014.1797);
    SetPlayerFacingAngle(playerid,286.25);
    SetPlayerCameraPos(playerid,352.9164,194.5702,1014.1875);
    SetPlayerCameraLookAt(playerid,349.0453,193.2271,1014.1797);
    if(classid == 0 || classid == 1 || classid == 2)
    {
    gTeam[playerid] = TEAM_ALPHA;
    GameTextForPlayer(playerid, "~b~TEAM ALPHA", 5000, 4);
    SetPlayerColor(playerid, COLOR_GREEN);
    }
    if(classid == 3 || classid == 4 || classid == 5)
    {
    gTeam[playerid] = TEAM_BETA;
    GameTextForPlayer(playerid, "~b~TEAM BETA", 5000, 4);
    SetPlayerColor(playerid, COLOR_PINK);
    }
    if(classid == 6 || classid == 7 || classid == 8)
    {
    gTeam[playerid] = TEAM_GAMMA;
    GameTextForPlayer(playerid, "~b~TEAM GAMMA", 5000, 4);
    SetPlayerColor(playerid, COLOR_BLUE);
    }
    if(classid == 9 || classid == 10 || classid == 11)
    {
    gTeam[playerid] = TEAM_DELTA;
    GameTextForPlayer(playerid, "~b~TEAM DELTA", 5000, 4);
    SetPlayerColor(playerid, COLOR_YELLOW);
    }
    return 1;
    }


    Bitte kann mir jemand helfen Danke

    Hallo Leute,


    Ich bekomme das einfach nicht hin und habe schon überall gesucht ich finde keine Lösung.
    Ich will das wenn sich ein Spieler in einer Gangzone befindet unten rechts ein Textraw erscheind "Anti Waffen Zone"
    Die Gangzone habe ich schon alles. Kann mir vll jemand weiter helfen?

    Hallo ich weis nicht wie ich das machen soll....ich habe non gf
    also wenn ich /heal eingebe soll an jeden spieler auf dem Server kommen
    [INFO} LuxX hat sich geheilt
    was muss ich da machen=?
    mfg.

    Hallo Leute,
    Ich häte gerne einen Command den nur 1334 Admins Eingeben können, und zwar wenn man den eingibt sollen alle Autos auf dem Server Respawnt werden! Aber wenn ein Spieler In einem Fahrzeug sitz sollte das net Respawnt werden!
    Wäre echt coll wennn mir jemand so was scripten könnte