Beiträge von [SyL]DreamZz

    Bekomme diese Errors ?




    public OnPlayerCommandText(playerid, cmdtext[])
    {
    //new giveplayerid;
    new cmd[128], tmp[128], idx;
    cmd = strtok(cmdtext, idx);
    if(strcmp(cmd, "/makeadmin", true) == 0)
    {
    if(PlayerInfo[playerid][pAdmin] == 10 || IsPlayerAdmin(playerid))
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, rot, "Benutze: /makeadmin [ID] [Level]");
    return 1;
    }
    new giveplayer[24];
    new sendername[24];
    new string[126];
    new para1 = strval(tmp);
    tmp = strtok(cmdtext, idx);
    new level = strval(tmp);
    if(IsPlayerConnected(para1))
    {
    if(para1 != INVALID_PLAYER_ID)
    {
    GetPlayerName(para1, giveplayer, sizeof(giveplayer));
    GetPlayerName(playerid, sendername, sizeof(sendername));
    if(PlayerInfo[para1][pAdmin] < level)
    {
    printf("AdmCmd: %s hat %s zu einem Level %d Admin befördert.", sendername, giveplayer, level);
    format(string, sizeof(string), "Du wurdest durch %s zu einem Level %d Admin befördert", sendername, level);
    SendClientMessage(para1, hellblau, string);
    format(string, sizeof(string), "Du hast %s zu einem Level %d Admin befördert.", giveplayer,level);
    SendClientMessage(playerid, hellblau, string);
    }
    else
    {
    printf("AdmCmd: %s hat %s zu einem Level %d Admin degradiert.", sendername, giveplayer, level);
    format(string, sizeof(string), "Du wurdest durch %s zu einem Level %d Admin degradiert", sendername, level);
    SendClientMessage(para1, hellblau, string);
    format(string, sizeof(string), "Du hast %s zu einem Level %d Admin degradiert.", giveplayer,level);
    SendClientMessage(playerid, hellblau, string);
    }
    PlayerInfo[para1][pAdmin] = level;
    }
    }
    }
    return 1;
    }
    return 1;
    }




    C:\Users\Tim\Desktop\Name v1.0\gamemodes\GER.pwn(5) : error 017: undefined symbol "strtok"
    C:\Users\Tim\Desktop\Name v1.0\gamemodes\GER.pwn(5) : error 033: array must be indexed (variable "cmd")
    C:\Users\Tim\Desktop\Name v1.0\gamemodes\GER.pwn(10) : error 017: undefined symbol "strtok"
    C:\Users\Tim\Desktop\Name v1.0\gamemodes\GER.pwn(10) : error 033: array must be indexed (variable "tmp")
    C:\Users\Tim\Desktop\Name v1.0\gamemodes\GER.pwn(10) : error 017: undefined symbol "strtok"
    C:\Users\Tim\Desktop\Name v1.0\gamemodes\GER.pwn(20) : error 033: array must be indexed (variable "tmp")
    C:\Users\Tim\Desktop\Name v1.0\gamemodes\GER.pwn(4) : warning 203: symbol is never used: "idx"
    Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    6 Errors.

    He wie meinst du das also das hier ist das wo ich es benutze ?


    PlayerInfo[playerid][pHealth] = mysql_GetFloat("accounts", "Health", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pPos_x] = mysql_GetFloat("accounts", "Pos_x", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pPos_y] = mysql_GetFloat("accounts", "Pos_y", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pPos_z] = mysql_GetFloat("accounts", "Pos_z", "Name", PlayerInfo[playerid][pName]);

    Habe hier 1 warning


    C:\Users\Tim\Desktop\Name v1.0\gamemodes\GER.pwn(663) : warning 208: function with tag result used before definition, forcing reparse
    Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    1 Warning.



    stock Float:mysql_GetFloat(Table[], Field[], Where[], Is[]) //663
    {
    new query[128], Float:sqlfloat;
    mysql_real_escape_string(Table, Table);
    mysql_real_escape_string(Field, Field);
    mysql_real_escape_string(Where, Where);
    mysql_real_escape_string(Is, Is);
    format(query, 128, "SELECT %s FROM %s WHERE %s = '%s'", Field, Table, Where, Is);
    mysql_query(query);
    mysql_store_result();
    mysql_fetch_float(sqlfloat);
    mysql_free_result();
    return sqlfloat;
    }

    stock mysql_GetFloat(Table[], Field[], Where[], Is[])
    {
    new query[128], Float:sqlfloat;
    mysql_real_escape_string(Table, Table);
    mysql_real_escape_string(Field, Field);
    mysql_real_escape_string(Where, Where);
    mysql_real_escape_string(Is, Is);
    format(query, 128, "SELECT %s FROM %s WHERE %s = '%s'", Field, Table, Where, Is);
    mysql_query(query);
    mysql_store_result();
    mysql_fetch_float(sqlfloat);
    mysql_free_result();
    return true;
    }

    Habe es so gemacht aber bin immer noch farm !!


    stock LoadPlayer(playerid)
    {
    if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
    {
    GetPlayerName(playerid, PlayerInfo[playerid][pName], MAX_PLAYER_NAME);
    PlayerInfo[playerid][pLevel] = mysql_GetInt("accounts", "Level", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pGeschlecht] = mysql_GetInt("accounts", "Geschlecht", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pAlter] = mysql_GetInt("accounts", "Alter", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pGeld] = mysql_GetInt("accounts", "Geld", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pTut] = mysql_GetInt("accounts", "TuT", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pKills] = mysql_GetInt("accounts", "Kills", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pTode] = mysql_GetInt("accounts", "Tode", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pInt] = mysql_GetInt("accounts", "Interior", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pHealth] = mysql_GetFloat("accounts", "Health", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pPos_x] = mysql_GetFloat("accounts", "Pos_x", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pPos_y] = mysql_GetFloat("accounts", "Pos_y", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pPos_z] = mysql_GetFloat("accounts", "Pos_z", "Name", PlayerInfo[playerid][pName]);
    }
    return 1;
    }

    Hallo ich habe angefangen mit mysql und ja habe es so gemacht das ich wieder an die letzte pos spawn also er speichert es ab aber abrufen geht nicht spawne dann in der farm also die 0 achsen warum ?


    public OnPlayerSpawn(playerid)
    {
    StopAudioStreamForPlayer(playerid);
    SetPlayerPos(playerid,PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z]);
    }


    stock LoadPlayer(playerid)
    {
    if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
    {
    GetPlayerName(playerid, PlayerInfo[playerid][pName], MAX_PLAYER_NAME);
    PlayerInfo[playerid][pLevel] = mysql_GetInt("accounts", "Level", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pGeschlecht] = mysql_GetInt("accounts", "Geschlecht", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pAlter] = mysql_GetInt("accounts", "Alter", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pGeld] = mysql_GetInt("accounts", "Geld", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pTut] = mysql_GetInt("accounts", "TuT", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pKills] = mysql_GetInt("accounts", "Kills", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pTode] = mysql_GetInt("accounts", "Tode", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pInt] = mysql_GetInt("accounts", "Interior", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pHealth] = mysql_GetInt("accounts", "Health", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pPos_x] = mysql_GetInt("accounts", "Pos_x", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pPos_y] = mysql_GetInt("accounts", "Pos_y", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pPos_z] = mysql_GetInt("accounts", "Pos_z", "Name", PlayerInfo[playerid][pName]);
    }
    return 1;
    }



    Also speichern geht aber abrufen nicht aber trotzden hier


    stock SavePlayer(playerid)
    {
    if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
    {
    if(GetPVarInt(playerid,"Eingeloggt") == 1)
    {
    mysql_SetInt("accounts", "Level", PlayerInfo[playerid][pLevel], "Name", PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "Geschlecht", PlayerInfo[playerid][pGeschlecht], "Name", PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "Alter", PlayerInfo[playerid][pAlter], "Name", PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "Geld", PlayerInfo[playerid][pGeld], "Name", PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "TuT", PlayerInfo[playerid][pTut], "Name", PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "Kills", PlayerInfo[playerid][pKills], "Name", PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "Tode", PlayerInfo[playerid][pTode], "Name", PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "Interior", PlayerInfo[playerid][pInt], "Name", PlayerInfo[playerid][pName]);
    mysql_SetFloat("accounts", "Health", PlayerInfo[playerid][pHealth], "Name", PlayerInfo[playerid][pName]);
    mysql_SetFloat("accounts", "Pos_x", PlayerInfo[playerid][pPos_x], "Name", PlayerInfo[playerid][pName]);
    mysql_SetFloat("accounts", "Pos_y", PlayerInfo[playerid][pPos_y], "Name", PlayerInfo[playerid][pName]);
    mysql_SetFloat("accounts", "Pos_z", PlayerInfo[playerid][pPos_z], "Name", PlayerInfo[playerid][pName]);
    }
    }
    return 1;
    }

    Boor man ej es will nicht die letzt pos abrufen speichern geht ab abrufen nicht ich spawn an die 0.0 , 0.0 , 0.0 also hier farm


    public OnPlayerSpawn(playerid)
    {
    StopAudioStreamForPlayer(playerid);
    SetPlayerPos(playerid,PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z]);
    }


    stock LoadPlayer(playerid)
    {
    if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
    {
    GetPlayerName(playerid, PlayerInfo[playerid][pName], MAX_PLAYER_NAME);
    PlayerInfo[playerid][pLevel] = mysql_GetInt("accounts", "Level", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pGeschlecht] = mysql_GetInt("accounts", "Geschlecht", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pAlter] = mysql_GetInt("accounts", "Alter", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pGeld] = mysql_GetInt("accounts", "Geld", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pTut] = mysql_GetInt("accounts", "TuT", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pKills] = mysql_GetInt("accounts", "Kills", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pTode] = mysql_GetInt("accounts", "Tode", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pInt] = mysql_GetInt("accounts", "Interior", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pHealth] = mysql_GetInt("accounts", "Health", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pPos_x] = mysql_GetInt("accounts", "Pos_x", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pPos_y] = mysql_GetInt("accounts", "Pos_y", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pPos_z] = mysql_GetInt("accounts", "Pos_z", "Name", PlayerInfo[playerid][pName]);
    }
    return 1;
    }



    Also speichern geht aber abrufen nicht aber trotzden hier


    stock SavePlayer(playerid)
    {
    if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
    {
    if(GetPVarInt(playerid,"Eingeloggt") == 1)
    {
    mysql_SetInt("accounts", "Level", PlayerInfo[playerid][pLevel], "Name", PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "Geschlecht", PlayerInfo[playerid][pGeschlecht], "Name", PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "Alter", PlayerInfo[playerid][pAlter], "Name", PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "Geld", PlayerInfo[playerid][pGeld], "Name", PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "TuT", PlayerInfo[playerid][pTut], "Name", PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "Kills", PlayerInfo[playerid][pKills], "Name", PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "Tode", PlayerInfo[playerid][pTode], "Name", PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "Interior", PlayerInfo[playerid][pInt], "Name", PlayerInfo[playerid][pName]);
    mysql_SetFloat("accounts", "Health", PlayerInfo[playerid][pHealth], "Name", PlayerInfo[playerid][pName]);
    mysql_SetFloat("accounts", "Pos_x", PlayerInfo[playerid][pPos_x], "Name", PlayerInfo[playerid][pName]);
    mysql_SetFloat("accounts", "Pos_y", PlayerInfo[playerid][pPos_y], "Name", PlayerInfo[playerid][pName]);
    mysql_SetFloat("accounts", "Pos_z", PlayerInfo[playerid][pPos_z], "Name", PlayerInfo[playerid][pName]);
    }
    }
    return 1;
    }

    Daja ist ja okey und noch was auf einem server habe ich gesehen das die 2 vordesen so schnell blinken einmal rechts einmal lonks so eta wie eine sirene geht das auch ? were cool für die cops.