Beiträge von Maurice.

    mein savePlaye ist jetzt so : savePlayer(playerid)
    {
    if(sInfo[playerid][eingeloggt]==0)return 1;
    new query[600];
    format(query,sizeof(query),"UPDATE user SET level='%i',money='%i',alevel='%i',Fraktion='%i',SkinID='%i',Rang='%i',Wanted='%i' WHERE id='%i'",sInfo[playerid][level],GetPlayerMoney(playerid),sInfo[playerid][alevel],sInfo[playerid][Fraktion],sInfo[playerid][SkinID],sInfo[playerid][Rang],sInfo[playerid][Wanted],sInfo[playerid][id]);
    mysql_function_query(dbhandle,query,false,"","");

    return 1;
    }


    und wenn ich jetzte bei onplayerdeath einfach savePlayer(playerid); einfüge wird es doch nicht gespeichert oder ?

    Halllo,


    ich habe mal ne frage ich will ein wanted System machen nur mal eine frage wie mache ich so das er dann bei OnPlayerDeath 1 wanted mehr bekommt ?

    Das: public OnPlayerSpawn(playerid)
    {


    new query[200];
    format(query,sizeof(query),"SELECT * FROM user WHERE Fraktion='%i'",sInfo[playerid][Fraktion]);
    mysql_function_query(dbhandle,query,true,"Test123","i",playerid);
    printf("Fraktion: %i",sInfo[playerid][Fraktion]);
    switch(sInfo[playerid][Fraktion])
    {
    case 0:{}
    case 1:{SetPlayerPos(playerid,polizeispawn);SetPlayerColor(playerid,Blau);}
    }


    }


    public Test123(playerid)
    {
    new num_fields,num_rows;
    cache_get_data(num_rows,num_fields,dbhandle);
    sInfo[playerid][Fraktion] = cache_get_field_content_int(0,"Fraktion",dbhandle);
    return 1;
    }


    Hat auch nix gebracht ;(

    C:\Dokumente und Einstellungen\Maurice\Desktop\Maurice RolePlay\gamemodes\script.pwn(287) : error 002: only a single statement (or expression) can follow each "case"
    C:\Dokumente und Einstellungen\Maurice\Desktop\Maurice RolePlay\gamemodes\script.pwn(287) : warning 215: expression has no effect
    C:\Dokumente und Einstellungen\Maurice\Desktop\Maurice RolePlay\gamemodes\script.pwn(288) : error 014: invalid statement; not in switch
    C:\Dokumente und Einstellungen\Maurice\Desktop\Maurice RolePlay\gamemodes\script.pwn(288) : warning 215: expression has no effect
    C:\Dokumente und Einstellungen\Maurice\Desktop\Maurice RolePlay\gamemodes\script.pwn(288) : error 001: expected token: ";", but found ":"
    C:\Dokumente und Einstellungen\Maurice\Desktop\Maurice RolePlay\gamemodes\script.pwn(288) : error 029: invalid expression, assumed zero
    C:\Dokumente und Einstellungen\Maurice\Desktop\Maurice RolePlay\gamemodes\script.pwn(288) : fatal error 107: too many error messages on one line


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



    5 Errors.


    switch(sInfo[playerid][Fraktion])
    {
    print("Test 1");
    case 1:
    {
    printf("Meine FraktionsNumber: %d", sInfo[playerid][Fraktion]);
    SetPlayerPos(playerid,245.3005,186.0758,1008.1719);
    SetPlayerInterior(playerid,3);
    SetCameraBehindPlayer(playerid);
    sInfo[playerid][SkinID] = GetPlayerSkin(playerid);
    SetPlayerColor(playerid,Blau);
    }
    }


    was ist daran falsch

    Hi , ich versuche schon den ganzen Tag es zu fixxen aber es geht nicht. Ich habe es jetzt mal so gemacht das er wenn er in Fraktion 1 ist dort spawnt und wenn nicht spawnt er bei diesen bauernhof(hab ich extra gemacht). So er ist in der Fraktion 1 aber er spawnt nicht da wo er spawnen soll. Aber in der stats steht das er in der fraktion 1 ist ?
    switch(sInfo[playerid][Fraktion])
    {
    case 1:
    {
    SetPlayerPos(playerid,245.3005,186.0758,1008.1719);
    SetPlayerInterior(playerid,3);
    SetCameraBehindPlayer(playerid);
    sInfo[playerid][SkinID] = GetPlayerSkin(playerid);
    SetPlayerColor(playerid,Blau);
    }
    }

    C:\Dokumente und Einstellungen\Maurice\Desktop\Maurice RolePlay\gamemodes\script.pwn(865) : warning 202: number of arguments does not match definition
    Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    1 Warning.


    if(dialogid==DIALOG_S_HOSTNAME)
    {
    new hostname3[128];
    format(hostname3,128,inputtext);
    SendRconCommand("hostname %s",hostname3);
    return 1;
    }


    ?

    if(dialogid==DIALOG_S_HOSTNAME)
    {
    new hostname3[300];
    hostname3 = strval(inputtext);
    SendRconCommand("hostname %s",hostname3);


    return 1;
    }


    C:\Dokumente und Einstellungen\Maurice\Desktop\Maurice RolePlay\gamemodes\script.pwn(864) : error 033: array must be indexed (variable "hostname3")
    C:\Dokumente und Einstellungen\Maurice\Desktop\Maurice RolePlay\gamemodes\script.pwn(865) : warning 202: number of arguments does not match definition
    Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    1 Error.

    nur hier
    ocmd:makeleader(playerid,params[])
    {
    if(!isAdmin(playerid,4))return SendClientMessage(playerid,COLOR_RED,"Dein Adminrang ist zu niedrig.");
    new pID,f_Fraktion,gemacht[250],juhu[230],ftext[60];
    if(sscanf(params,"ui",pID,f_Fraktion))return SendClientMessage(playerid,COLOR_RED,"INFO: /makeFraktion [playerid] [Fraktion 0-2]");


    if(sInfo[playerid][Fraktion] == 0) { ftext = "Zivilist"; }
    else if(sInfo[playerid][Fraktion] == 1) { ftext = "Polizei"; }


    sInfo[pID][Fraktion]=f_Fraktion;
    sInfo[pID][Rang]=6;
    savePlayer(pID);
    format(juhu,sizeof(juhu),"Admin %s hat dich als Fraktion in der Fraktion %s gemacht.",PlayerName(playerid),ftext);
    SendClientMessage(pID,Orange,juhu);
    format(gemacht,sizeof(gemacht),"Du wurdest als Fraktion in der Fraktion: %s gemacht.",ftext);
    SendClientMessage(playerid,Orange,gemacht);
    return 1;
    }


    ich teste das mal mit printf


    //EDIT


    Es kommt der wert 0 raus

    public OnPasswordResponse(playerid)
    {
    new num_fields,num_rows;
    cache_get_data(num_rows,num_fields,dbhandle);
    if(num_rows==1)
    {
    //Passwort richtig
    sInfo[playerid][eingeloggt] = 1;
    sInfo[playerid][level] = cache_get_field_content_int(0,"level",dbhandle);
    SetPlayerScore(playerid,sInfo[playerid][level]);
    sInfo[playerid][id] = cache_get_field_content_int(0,"id",dbhandle);
    SetPlayerMoney(playerid,cache_get_field_content_int(0,"money",dbhandle));
    sInfo[playerid][alevel] = cache_get_field_content_int(0,"alevel",dbhandle);
    sInfo[playerid][Fraktion] = cache_get_field_content_int(0,"Fraktion",dbhandle);
    sInfo[playerid][Rang] = cache_get_field_content_int(0,"Rang",dbhandle);
    }
    else
    {
    //Passwort falsch
    SendClientMessage(playerid,COLOR_RED,"Das eingegebene Passwort ist falsch.");
    ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","Gibt bitte dein Passwort ein:","Okay","Abbrechen");
    }
    return 1;
    }

    [15:05:47] [DEBUG] mysql_connect - -
    [15:05:47] [DEBUG] CMySQLHandle::Create - creating new connection..
    [15:05:47] [DEBUG] CMySQLHandle::CMySQLHandle - constructor called
    [15:05:47] [DEBUG] CMySQLHandle::Create - connection created with ID = 1
    [15:05:48] [DEBUG] CMySQLHandle::Connect - connection was successful
    [15:05:48] [DEBUG] CMySQLHandle::Connect - auto-reconnect has been enabled
    [15:06:08] [DEBUG] mysql_tquery - connection handle: 1
    [15:06:08] [DEBUG] mysql_tquery - scheduling query "SELECT id FROM user WHERE username='Mauricde'"..
    [15:06:08] [DEBUG] CMySQLQuery::Execute[OnUserCheck(i)] - starting query execution
    [15:06:08] [DEBUG] CMySQLQuery::Execute[OnUserCheck(i)] - query was successful
    [15:06:08] [DEBUG] CMySQLQuery::Execute[OnUserCheck(i)] - data being passed to ProcessCallbacks()
    [15:06:08] [DEBUG] Calling callback "OnUserCheck"..
    [15:06:08] [DEBUG] cache_get_data - connection handle: 1
    [15:06:08] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called
    [15:06:10] [DEBUG] mysql_escape_string - connection handle: 1
    [15:06:10] [DEBUG] mysql_tquery - connection handle: 1
    [15:06:10] [DEBUG] mysql_tquery - scheduling query "SELECT * FROM user WHERE username='Mauricde' AND password='elta123'"..
    [15:06:10] [DEBUG] CMySQLQuery::Execute[OnPasswordResponse(i)] - starting query execution
    [15:06:10] [DEBUG] CMySQLQuery::Execute[OnPasswordResponse(i)] - query was successful
    [15:06:10] [DEBUG] CMySQLQuery::Execute[OnPasswordResponse(i)] - data being passed to ProcessCallbacks()
    [15:06:10] [DEBUG] Calling callback "OnPasswordResponse"..
    [15:06:10] [DEBUG] cache_get_data - connection handle: 1
    [15:06:10] [DEBUG] cache_get_field_content_int - connection handle: 1
    [15:06:10] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "level", data: "0"
    [15:06:10] [DEBUG] cache_get_field_content_int - connection handle: 1
    [15:06:10] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "id", data: "22"
    [15:06:10] [DEBUG] cache_get_field_content_int - connection handle: 1
    [15:06:10] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "money", data: "0"
    [15:06:10] [DEBUG] cache_get_field_content_int - connection handle: 1
    [15:06:10] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "alevel", data: "5"
    [15:06:10] [DEBUG] cache_get_field_content_int - connection handle: 1
    [15:06:10] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Fraktion", data: "1"
    [15:06:10] [DEBUG] cache_get_field_content_int - connection handle: 1
    [15:06:10] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Rang", data: "5"
    [15:06:10] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called
    [15:06:14] [DEBUG] mysql_tquery - connection handle: 1
    [15:06:14] [DEBUG] mysql_tquery - scheduling query "UPDATE user SET level='0',money='0',alevel='5',Fraktion='1',SkinID='0',Rang='5' WHERE id='22'"..
    [15:06:14] [DEBUG] CMySQLQuery::Execute[()] - starting query execution
    [15:06:14] [DEBUG] CMySQLQuery::Execute[()] - query was successful
    [15:06:14] [DEBUG] CMySQLQuery::Execute[()] - no callback specified, skipping result saving
    [15:06:18] [DEBUG] mysql_close - connection handle: 1
    [15:06:18] [DEBUG] CMySQLHandle::Disconnect - connection was closed
    [15:06:18] [DEBUG] CMySQLHandle::~CMySQLHandle - deconstructor called

    OnPlayerConnect und OnPlayerSpawn public OnPlayerConnect(playerid)
    {
    new query[200];
    format(query,sizeof(query),"SELECT id FROM user WHERE username='%s'",PlayerName(playerid));
    mysql_function_query(dbhandle,query,true,"OnUserCheck","i",playerid);
    SetTimerEx("CheckLogin",60000,0,"d",playerid);
    sInfo[playerid][eingeloggt]=0;
    //OnPlayerSpawn(playerid);
    return 1;
    }


    savePlayer(playerid)
    {
    if(sInfo[playerid][eingeloggt]==0)return 1;
    new query[600];
    format(query,sizeof(query),"UPDATE user SET level='%i',money='%i',alevel='%i',Fraktion='%i',SkinID='%i',Rang='%i' WHERE id='%i'",sInfo[playerid][level],GetPlayerMoney(playerid),sInfo[playerid][alevel],sInfo[playerid][Fraktion],sInfo[playerid][SkinID],sInfo[playerid][Rang],sInfo[playerid][id]);
    mysql_function_query(dbhandle,query,false,"","");

    return 1;
    }



    er macht keine mysql_log obwohl es so im script steht: mysql_log(1);

    Aber hier ist doch alles richtig oder ? public OnPasswordResponse(playerid)
    {
    new num_fields,num_rows;
    cache_get_data(num_rows,num_fields,dbhandle);
    if(num_rows==1)
    {
    //Passwort richtig
    sInfo[playerid][eingeloggt] = 1;
    sInfo[playerid][level] = cache_get_field_content_int(0,"level",dbhandle);
    SetPlayerScore(playerid,sInfo[playerid][level]);
    sInfo[playerid][id] = cache_get_field_content_int(0,"id",dbhandle);
    SetPlayerMoney(playerid,cache_get_field_content_int(0,"money",dbhandle));
    sInfo[playerid][alevel] = cache_get_field_content_int(0,"alevel",dbhandle);
    sInfo[playerid][Fraktion] = cache_get_field_content_int(0,"Fraktion",dbhandle);
    sInfo[playerid][Rang] = cache_get_field_content_int(0,"Rang",dbhandle);
    }
    else
    {
    //Passwort falsch
    SendClientMessage(playerid,COLOR_RED,"Das eingegebene Passwort ist falsch.");
    ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","Gibt bitte dein Passwort ein:","Okay","Abbrechen");
    }
    return 1;
    }