Beiträge von Optiimal

    public OnPlayerCommandText(playerid, cmdtext[])
    {
    new cmd[256],tmp[256],idx;
    cmd = strtok(cmdtext, idx);
    if (strcmp(cmd, "/register", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if(AccountInfo[playerid][aLogged] == 1)
    {
    SendClientMessage(playerid, RED, "You are already logged in.");
    return 1;
    }
    new sendername[MAX_PLAYER_NAME],string[128];
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), ACCOUNTS_FOLDER, sendername);
    new File: hFile = fopen(string, io_read);
    if (hFile)
    {
    SendClientMessage(playerid, RED, "That name is already taken. Please reconnect using a different username.");
    fclose(hFile);
    return 1;
    }
    new tmppass[128];
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, ORANGE, "USAGE: /register [password]");
    return 1;
    }
    strmid(tmppass, tmp, 0, strlen(cmdtext), 255);
    Encrypt(tmppass);
    OnPlayerRegister(playerid,tmppass);
    }
    return 1;
    }
    return 0;
    }
    public ShowLoginMenu(playerid)
    {
    TextDrawShowForPlayer(playerid, Nick);
    TextDrawShowForPlayer(playerid, Password);
    TextDrawShowForPlayer(playerid, Login);
    TextDrawShowForPlayer(playerid, BottomMsg[playerid]);
    TextDrawShowForPlayer(playerid, Name[playerid]);
    TextDrawShowForPlayer(playerid, Pass[playerid]);
    }


    public HideLoginMenu(playerid)
    {
    TextDrawHideForPlayer(playerid, Nick);
    TextDrawHideForPlayer(playerid, Password);
    TextDrawHideForPlayer(playerid, Login);
    TextDrawHideForPlayer(playerid, BottomMsg[playerid]);
    TextDrawHideForPlayer(playerid, Name[playerid]);
    TextDrawHideForPlayer(playerid, Pass[playerid]);
    }


    stock strtok(const string[], &index,seperator=' ')
    {
    new length = strlen(string);
    new offset = index;
    new result[128];
    while ((index < length) && (string[index] != seperator) && ((index - offset) < (sizeof(result) - 1)))
    {
    result[index - offset] = string[index];
    index++;
    }


    result[index - offset] = EOS;
    if ((index < length) && (string[index] == seperator))
    {
    index++;
    }
    return result;
    }
    stock ini_GetKey( line[] )
    {
    new keyRes[256];
    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[256];
    valRes[0]=0;
    if ( strfind( line , "=" , true ) == -1 ) return valRes;
    strmid( valRes , line , strfind( line , "=" , true )+1 , strlen( line ) , sizeof( valRes ) );
    return valRes;
    }
    public OnPlayerRegister(playerid, password[])
    {
    if(IsPlayerConnected(playerid))
    {
    new player[MAX_PLAYER_NAME];
    GetPlayerName(playerid, player, 50);
    new string3[32];
    new playername3[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername3, sizeof(playername3));
    format(string3, sizeof(string3), ACCOUNTS_FOLDER, playername3);
    new ip[20];
    GetPlayerIp(playerid,ip,sizeof(ip));
    new File: hFile = fopen(string3, io_write);
    if (hFile)
    {
    strmid(AccountInfo[playerid][aPassword], password, 0, strlen(password), 255);
    new var[128];
    format(var, 128, "Password=%s\n", AccountInfo[playerid][aPassword]);fwrite(hFile, var);
    format(var, 128, "IP=%s\n",ip);fwrite(hFile, var);
    fclose(hFile);
    SendClientMessage(playerid, GREEN, "|- Account successfully registered. You may now login. -|");
    TextDrawSetString(Name[playerid], playername3);
    TextDrawSetString(Pass[playerid], "l");
    ShowLoginMenu(playerid);
    MenuShown[playerid] = 1;
    TogglePlayerControllable(playerid, false);
    TextDrawSetString(BottomMsg[playerid], "Enter your password");
    }
    }
    return 1;
    }


    public OnPlayerUpdate(playerid)
    {
    if(IsPlayerConnected(playerid))
    {
    if(AccountInfo[playerid][aLogged] == 1)
    {
    new string3[128];
    new playername3[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername3, sizeof(playername3));
    format(string3, sizeof(string3), ACCOUNTS_FOLDER, playername3);
    new ip[20];
    GetPlayerIp(playerid,ip,sizeof(ip));
    new File: hFile = fopen(string3, io_write);
    if (hFile)
    {
    new var[128];
    format(var, 128, "Password=%s\n", AccountInfo[playerid][aPassword]);fwrite(hFile, var);
    format(var, 128, "IP=%s\n",ip);fwrite(hFile, var);
    fclose(hFile);
    }
    }
    }
    return 1;
    }


    public OnPlayerLogin(playerid,password[])
    {
    // new tmp2[256];
    new string2[128];
    new playername2[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername2, sizeof(playername2));
    format(string2, sizeof(string2), ACCOUNTS_FOLDER, playername2);
    new File: UserFile = fopen(string2, io_read);
    if ( UserFile )
    {
    new PassData[256];
    new keytmp[256], valtmp[256];
    fread( UserFile , PassData , sizeof( PassData ) );
    keytmp = ini_GetKey( PassData );
    if( strcmp( keytmp , "Password" , true ) == 0 )
    {
    valtmp = ini_GetValue( PassData );
    strmid(AccountInfo[playerid][aPassword], valtmp, 0, strlen(valtmp)-1, 255);
    }
    if(strcmp(AccountInfo[playerid][aPassword],password, true ) == 0 )
    {
    for(new p = 0; p < strlen(AccountInfo[playerid][aPassword]); p++)
    {
    password[p] = '?';
    }
    TextDrawSetString(Pass[playerid], password);
    TextDrawSetString(BottomMsg[playerid], "~g~You are now logging in...");
    SetTimerEx("LogIn", LOGIN_DELAY*1000, 0, "d", playerid);
    printf("%s is logging in...",playername2);
    new key[256] ;
    new Data[256];
    while ( fread( UserFile , Data , sizeof( Data ) ) )
    {
    key = ini_GetKey( Data );
    /*if(strcmp(key, "AdminLevel", true) == 0) // This is only an example if you want to add more stuff to store in a file.
    {
    val = ini_GetValue( Data );
    AccountInfo[playerid][AdminLevel] = strval(val); // Uncommenting this will give you errors if the variable isn't defined.
    }*/
    }
    fclose(UserFile);


    }
    else
    {
    TextDrawSetString(BottomMsg[playerid], "~r~Invalid Password");
    fclose(UserFile);
    return 0;
    }
    }
    return 0;
    }


    public LogIn(playerid)
    {
    AccountInfo[playerid][aLogged] = 1;
    HideLoginMenu(playerid);
    TogglePlayerControllable(playerid, true);
    MenuShown[playerid] = 0;
    }


    Encrypt(string[])
    {
    for(new x=0; x < strlen(string); x++)
    {
    string[x] += (3^x) * (x % 15);
    if(string[x] > (0xff))
    {
    string[x] -= 256;
    }
    }
    }


    ich kann mich nicht registrieren, was ist hier falsch wenn die dialog box erscheint kann ich nichts eingeben

    C:\Users\Mipu\Desktop\gta 0.3\gamemodes\lvdm.pwn(236) : warning 219: local variable "tmp" shadows a variable at a preceding level
    C:\Users\Mipu\Desktop\gta 0.3\gamemodes\lvdm.pwn(241) : error 017: undefined symbol "login"
    C:\Users\Mipu\Desktop\gta 0.3\gamemodes\lvdm.pwn(241) : warning 215: expression has no effect
    C:\Users\Mipu\Desktop\gta 0.3\gamemodes\lvdm.pwn(241) : error 001: expected token: ";", but found "]"
    C:\Users\Mipu\Desktop\gta 0.3\gamemodes\lvdm.pwn(241) : error 029: invalid expression, assumed zero
    C:\Users\Mipu\Desktop\gta 0.3\gamemodes\lvdm.pwn(241) : fatal error 107: too many error messages on one line


    Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    4 Errors.
    public OnPlayerCommandText(playerid, cmdtext[])
    {
    new string[256];
    new playermoney;
    new sendername[MAX_PLAYER_NAME];
    new giveplayer[MAX_PLAYER_NAME];
    new cmd[256];
    new giveplayerid, moneys, idx;
    cmd = strtok(cmdtext, idx);
    new tmp[256]; //<----236
    new playername[MAX_PLAYER_NAME];
    cmd = strtok(cmdtext, idx);
    if (strcmp(cmd, "/login", true) ==0 )
    {
    login[playerid] = true //<---das ist zeile 241


    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;
    }


    Habe das selbe system in einen anderen script auch drinnen und da funkt es warum hier nicht

    ne nicht ganz so :rolleyes:
    ich meine das


    if(strcmp(cmd, "/Gibgeld", true) == 0) {


    SendClientMessage(playerid, COLOR_WHITE, "Benutze: /Gibgeld [SPIELER ID] [WIEVIEL]");


    man kann bei diesen cmd auch noch eingeben an welche spieler id das gehen so und wieviel^^

    upps hier nochmal der ganze cmd^^


    if(strcmp(cmd, "/Gibgeld", true) == 0) {
    new tmp[256];
    tmp = strtok(cmdtext, idx);


    if(!strlen(tmp)) {
    SendClientMessage(playerid, COLOR_WHITE, "Benutze: /Gibgeld [SPIELER ID] [WIEVIEL]");
    return 1;
    }
    giveplayerid = strval(tmp);

    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)) {
    SendClientMessage(playerid, COLOR_WHITE, "Benutze: /Gibgeld [SPIELER ID] [WIEVIEL]");
    return 1;
    }
    moneys = strval(tmp);

    //printf("givecash_command: %d %d",giveplayerid,moneys);



    if (IsPlayerConnected(giveplayerid)) {
    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
    GetPlayerName(playerid, sendername, sizeof(sendername));
    playermoney = GetPlayerMoney(playerid);
    if (moneys > 0 && playermoney >= moneys) {
    GivePlayerMoney(playerid, (0 - moneys));
    GivePlayerMoney(giveplayerid, moneys);
    format(string, sizeof(string), "Du gibst %s(Spielerid: %d), $%d.", giveplayer,giveplayerid, moneys);
    SendClientMessage(playerid, COLOR_YELLOW, string);
    format(string, sizeof(string), "Du bekommst $%d von %s(Spielerid: %d).", moneys, sendername, playerid);
    SendClientMessage(giveplayerid, COLOR_YELLOW, string);
    printf("%s(Spielerid:%d) Gibt %d zu %s(Spielerid:%d)",sendername, playerid, moneys, giveplayer, giveplayerid);
    }
    else {
    SendClientMessage(playerid, COLOR_YELLOW, "Falsche Geld angabe.");
    }
    }
    else {
    format(string, sizeof(string), "%d Ist kein Aktiver Spieler.", giveplayerid);
    SendClientMessage(playerid, COLOR_YELLOW, string);
    }
    return 1;
    }




    return 0;
    }

    if(strcmp(cmd, "/givecash", true) == 0) {
    new tmp[256];
    tmp = strtok(cmdtext, idx);


    if(!strlen(tmp)) {
    SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givecash [playerid] [amount]");
    return 1;
    }
    giveplayerid = strval(tmp);

    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)) {
    SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givecash [playerid] [amount]");
    return 1;
    }
    moneys = strval(tmp);


    Wo ist hier defienirt an welche playerid man das geld gibt und das man denn amount auch eingeben kann

    ----------
    Loaded log file: "server_log.txt".
    ----------


    SA-MP Dedicated Server
    ----------------------
    v0.3-beta-RC6, (C)2005-2009 SA-MP Team


    [00:05:28] filterscripts = "" (string)
    [00:05:28] weburl = "www.sa-mp.com" (string)
    [00:05:28]
    [00:05:28] Server Plugins
    [00:05:28] --------------
    [00:05:28] Loaded 0 plugins.


    [00:05:28]
    [00:05:28] Ban list
    [00:05:28] --------
    [00:05:28] Loaded: samp.ban
    [00:05:28]
    [00:05:28]
    [00:05:28] Filter Scripts
    [00:05:28] ---------------
    [00:05:28] Loaded 0 filter scripts.


    [00:05:28]
    ----------------------------------
    [00:05:28] Running LVDM ~MoneyGrub


    [00:05:28] Coded By
    [00:05:28] Jax
    [00:05:28] ----------------------------------



    bitte schön

    Hallo ich bin gerade dabei das LVDM script zu gestallten nur wenn ich denn server starte kommt immer server didn´t respoon hier mal die server cfg.
    echo Executing Server Config...
    lanmode 0
    rcon_password
    maxplayers 500
    port 7777
    hostname Chaos Deathmatch
    gamemode0 lvdm
    filterscripts
    announce 0
    query 1
    weburl
    bind 127.0.0.1
    maxnpc 6
    onfoot_rate 40
    incar_rate 40
    weapon_rate 40
    stream_distance 400.0
    stream_rate 500

    Hallo es geht um folgendes ich hatte zurzeit nur login systeme wo man shift drücken muss das man spawnt wie funkt das das dass ohne shift auch geht also das mit shift überhaupt nichts geht beginne gerade mit ein DM script (selfmade)


    MFG